# LAB colors functioning in an unexpected way

I was trying to make a program that calculates the brightness of a diffraction pattern, when I encountered this while using LAB Colors: So LABColor[0.01,0.8,0.8] will give out a natural black color, but LABColor[0.01,0,-1] should also do that, but instead, it would surprisingly give out a bright blue color. I tried other colors, and the only thing I know now is that the unusual brightness only occurs to b->1 and b->-1.

the problem occurs on the far left of the image. Why? Shouldn't every color be black with l->0? So I made another attempt with l->-1, and that did show that all the colors are black, but their RGB color decreases in different scales, rendering l useless in deciding whether the color is bright or not...

• The issue is still present in MMA 11.3. I have contacted support... Apr 7 '18 at 13:06

This is more an extended comment than an answer. Yes, something seems to be wrong. Let us suppose, we represent the plane $L=0$, all the squares should be black:

Graphics[DeleteDuplicates@{{LABColor[#], Rectangle[Rest@#, Rest@# + {.2, .2}]} & /@
Tuples[{ConstantArray[0, 5], Range[-1, 1, .4], Range[-1, 1, .4]}]}, Axes -> True,
AxesLabel -> {"a", "b"}]


But they are not. Therefore, let us investigate their RGB conversion. If $L=0$ means that all the coordinates in RGB should be zero also. However:

ColorConvert[DeleteDuplicates@(LABColor[#] & /@ Tuples[{ConstantArray[0, 6],
Range[-1, 1, .4], Range[-1, 1, .4]}]), "RGB"] // Chop[#, 10^-4] & // InputForm

(* {RGBColor[0, 0.07978506283947867, 0.5847606693969404],
RGBColor[0, 0.029956707406784244, 0.3447675409720798],
RGBColor[0, 0.004804407681413552, 0.13147226039098525],
RGBColor[0, 0, 0],
RGBColor[0, 0, 0],
RGBColor[0, 0, 0],
RGBColor[0, 0.07978506283947867, 0.5847606693969404],
RGBColor[0, 0.029956707406784244, 0.3447675409720798],
RGBColor[0, 0.004804407681413552, 0.13147226039098525],
RGBColor[0, 0, 0],
RGBColor[0, 0, 0],
RGBColor[0, 0, 0],
RGBColor[0, 0.07978506283947867, 0.5847606693969404],
RGBColor[0, 0.029956707406784244, 0.3447675409720798],
RGBColor[0, 0.004804407681413552, 0.13147226039098525],
RGBColor[0, 0, 0],
RGBColor[0, 0, 0],
RGBColor[0, 0, 0],
RGBColor[0, 0.02996327773049831, 0.5850760888790785],
RGBColor[0, 0, 0.3453763338813659],
RGBColor[0.10029469805817337, 0, 0.1332331739778148],
RGBColor[0.1309857317647039, 0, 0.004603936794368831],
RGBColor[0.1309857317647039, 0, 0.004603936794368831],
RGBColor[0.1309857317647039, 0, 0.004603936794368831],
RGBColor[0, 0, 0.5858135021464239],
RGBColor[0.23851504852018163, 0, 0.1372670806596635],
RGBColor[0.2524245138829351, 0, 0.015379827894536315],
RGBColor[0.2524245138829351, 0, 0.015379827894536315],
RGBColor[0.2524245138829351, 0, 0.015379827894536315],
RGBColor[0.10917014559406288, 0, 0.5871250115245642],
RGBColor[0.31825963178832845, 0, 0.3493098968135841],
RGBColor[0.3674034699089572, 0, 0.1441775650469683],
RGBColor[0.37591747422303856, 0, 0.034587975350480686],
RGBColor[0.37591747422303856, 0, 0.034587975350480686],
RGBColor[0.37591747422303856, 0, 0.034587975350480686]}  *)


Too many colors that are not black, and they should be. Why?

According to the data I found, LAB is indeed not black when l=0, which is rather confusing and hard to avoid

• well that's unfortunate. Apr 24 '18 at 11:07