**EDIT**

Thank you for comment from ybeltukov: `Exclusions->None`:

    fun[b_, x_] := 1/(2 b)*(Abs[x]^2 - Max[Abs[x] - b, 0]^2)
    Legended[ParametricPlot[{u, fun[a, u]}, {u, -2, 2}, {a, 0, 1}, 
      ColorFunction -> {ColorData["Rainbow"][#4] &}, Exclusions -> None, 
      ImageSize -> 500], BarLegend["Rainbow"]] 

![enter image description here][1]



  [1]: https://i.sstatic.net/XrScG.png