# Weird colors in Mathematica 10.2

I was trying to run a code that I saw on a answer for this question

The code is simply

ParametricPlot[{Cos[u], Sin[u]}, {u, 0, 2 Pi}] /.
Line[l_List] :> {{Red, Polygon[l]}, {Black, Line[l]}}


And the result was supposed to be: However, when I run the same code in Mathematica 10.2 I get this result: I'm running exactly the same code, no extra global variables. Also, the color Red works perfectly fine in other situations. I've tried RGBColor[1,0,0] and the result is the same.

Similar issues happen with other colors too. Every color is "brighter".

The answer is simple. Per default Mathematica reduces the opacity of the colors. Try the following:

ParametricPlot[{Cos[u], Sin[u]}, {u, 0, 2 Pi}] /.
Line[l_List] :> {{Red, Polygon[l]}, {Black, Line[l]}}

% /. _Opacity :> Opacity


If you look at the InputForm of your graphics, you will notice a

FaceForm[Opacity[0.3]]


call right in the front. With this knowledge, you can simply fix it by calling:

ParametricPlot[{Cos[u], Sin[u]}, {u, 0, 2 Pi},
PlotStyle -> Opacity] /.
Line[l_List] :> {{Red, Polygon[l]}, {Black, Line[l]}}


I think using the 2nd argument of Opacity is a slightly simpler way to correct the problem than the methods given by halirutan, although those are perfectly fine.

ParametricPlot[{Cos[u], Sin[u]}, {u, 0, 2 Pi}] /.
Line[l_List] :> {{Opacity[1, Red], Polygon[l]}, {Black, Line[l]}} • Explicitly setting the alpha channel is even simpler: ParametricPlot[{Cos[u], Sin[u]}, {u, 0, 2 Pi}] /. Line[l_List] :> {{RGBColor[1, 0, 0, 1], Polygon[l]}, {Black, Line[l]}}. – J. M. will be back soon May 11 '17 at 10:54