6
$\begingroup$

I wish to extract the colors on the L axis in the CIELab color space such that the CIE2000 distance between a corresponding color and LABColor[0., 0., 0.] will be gradually increasing by a factor 0.01. For example, {LABColor[0, 0, 0], LABColor[0.01733965, 0, 0], LABColor[0.0344219, 0, 0], LABColor[0.0512525, 0, 0], LABColor[0.0678371, 0, 0], LABColor[0.0841806, 0, 0], LABColor[0.100288, 0, 0]} are the first few colors in this series. I have got these values by manually checking. However, to automate this, when I tried the following (to get the second element in the series)

Solve[ColorDistance[LABColor[0, 0, 0], LABColor[l, 0, 0], 
DistanceFunction -> "CIE2000"] == 0.01, l]

I got an error message.

How can I automate this process to complete the series.

$\endgroup$
8
$\begingroup$
f[l_?NumericQ] := 
   ColorDistance[LABColor[0, 0, 0], LABColor[l, 0, 0], DistanceFunction -> "CIE2000"]

FindRoot[f[l] == 0.01, {l, .5}]
(* {l -> 0.0173396} *)

ColorDistance does not work with symbolic inputs. Write a function that evaluates with numeric inputs only.

Solve is meant for exact symbolic computations. Use FindRoot instead.

| improve this answer | |
$\endgroup$
  • $\begingroup$ Perfect. Now I can get the complete list. Thanks. $\endgroup$ – Majis Apr 5 '19 at 8:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.