# Change lighting in ChromaticityPlot3D

It looks to me like ChromaticityPlot3D has some default lighting, but unlike most Graphics3D functions the Lighting option doesn't seem to have any effect.

However, the documentation states "ChromaticityPlot3D accepts all Graphics3D options with the following additions and changes: ...".

Any ideas how to affect the lighting? Is it possible to produce a Graphics3D object from the chromaticity plot? I am trying to achieve unshaded lighting like Lighting -> {{"Ambient", White}}.

• Lighting -> "Neutral" is the default. Why is it not suitable for you? – J. M.'s discontentment Jul 19 '16 at 18:21
• J.M.: What is "suitable", this is just a question of aesthetics / "readability" isn't it? Anyway in my specific case the darkening of the colours causes a problem and I would like Lighting -> none, as to be able to see different views of the surface (projections) as you would in a typical 2D plot, with a uniform / normalized lightness. The darkening of the colours makes it very difficult to see the chromaticity. – ddd Jul 19 '16 at 18:29
• Okay, maybe a screenshot showing this "darkening" might help. "Neutral" corresponds to using white lights in a few places, and some of those places are not lit (maybe that's what you're bothered by)? Lighting -> None will not help, because... what do you expect to see without lights? ;) – J. M.'s discontentment Jul 19 '16 at 18:36
• Sorry, I had wrongly understood the behaviour of None, but anyway what I want is pure diffuse colour, no shading. I updated the original question to clarify. – ddd Jul 19 '16 at 20:29
• @ddd - This can be done by the method below – Jason B. Jul 19 '16 at 20:34

If you look at the InputForm of ChromaticityPlot3D[{"WideGamutRGB", "sRGB"}] you'll find several spots where it says Lighting -> "Neutral"

So if you want to change that, you'll have to modify the output of ChromaticityPlot3D using a replacement rule. Here is an extreme example, one that totally ruins the plot but shows how to change the lighting,

ChromaticityPlot3D["WideGamutRGB"] /.
Rule[Lighting, "Neutral"] :> Rule[Lighting, #] & /@ {"Neutral",
None, {{"Ambient", White}}}


• Or, keeping your fingers crossed, "Neutral" :> {{"Directional", RGBColor[0, 1, 0], {{5, 5, 4}, {5, 5, 0}}}} :) – Kuba Jul 19 '16 at 18:59
• But what if they have some other setting with that value? :-) – Jason B. Jul 19 '16 at 19:01
• I told you to keep fingers crossed while doing that :) – Kuba Jul 19 '16 at 19:08
• Thanks for suggesting to look at the InputForm. ChromaticityPlot3D["sRGB"] /. (Lighting -> "Neutral") :> Lighting -> {{"Ambient", White}} gets me what I was after. I think really the proper solution is for Mathematica to not override the Lighting option though. – ddd Jul 19 '16 at 20:48

One could override the setting for each polygon group (or GraphicsGroup[]):

cp /. p_Polygon :> {Lighting -> {{"Ambient", White}}, p}
cp /. gg_GraphicsGroup :> {Lighting -> {{"Ambient", White}}, gg}


While Lighting shows up in Options@ChromaticityPlot3D, it is not listed among the options in the docs for ChromaticityPlot3D. However, it inherits the setting for Lighting from ParametricPlot3D before it is embedded as styling in the graphics primitives: If the setting is not Automatic, then ChromaticityPlot3D won't override it.

With[{opts = Options[ParametricPlot3D]},
InternalWithLocalSettings[
SetOptions[ParametricPlot3D, Lighting -> {{"Ambient", White}}],
ChromaticityPlot3D[{"WideGamutRGB", "sRGB"}],
SetOptions[ParametricPlot3D, opts]
]
]
(* same plot as above *)


See this answer or this one for more on InternalWithLocalSettings. In this case one might simply handle things oneself as follows:

  SetOptions[ParametricPlot3D, Lighting -> {{"Ambient", White}}];
ChromaticityPlot3D[{"WideGamutRGB", "sRGB"}]
SetOptions[ParametricPlot3D, Lighting -> Automatic];

• Nice detective work! I would even call this a bug, since the docs say that it can take any options that Graphics3D takes. But perhaps it's intentional since the whole point of the plot is to show the colors in as correct a fashion as possible. – Jason B. Jul 19 '16 at 22:34
• Thanks! My feeling is that it's probably intentional. Oddly, the default option setting is Lighting -> {{"Ambient", White}}, but it is changed to neutral plus transparency for color spaces. I guess the advantage of "Neutral" is that the orientation of a surface and the surfaces of the overlapping colorspaces are easier to distinguish, and the disadvantage is that the color is mixed with gray. (Not sure why users are not allowed to mess with it, with the options Lighting, PlotStyle, and ColorFunction. PlotTheme -> "Monochrome" is an interesting special case.) – Michael E2 Jul 20 '16 at 14:34