Color Spectrum Reversed?

Is there a node or shader like Spectrum(Color), which is reversed? I would like to identify colors by a value. This could be the wavelenght (nm). Or is there a simple way to “reverse” Spectrum with a Template(Color)? Thanks, Armin

Well, you can invert color setting Saturation -1, if that’s what you mean…

EDIT: no, sorry, wrong dumb statement.

or do you mean like hsl-(color-split) -> 1 - Hue -> hsl-(color-join) ? that should give you the complement colors, so the same spectrum in reverse.

no. sorry. maybe my description is not clear. i do not need hsl or rgb values.
i need a node where i can input any color and it outputs the “wavelenght” of that color (example: 555.00 nm).
why? because i could not find a way to clearly identify a color by one single number.
one value like wavelenght would be perfect as something like a “color id”. hope it is understandable now. thanks, armin

If you just need an id number and don’t really need the wavelength maybe this can work?

(edit: changed the patch so conversion to color back from id works (or at least I think it does…))

colorId.v4p (4.4 kB)

this could work. thanks beyon.

confused. tried to find one specific color but the AsString(Color Hex) output is different… how can i reduce a color(h:017, s:1.00, v:1.00) to only one “id”? please have a look at the attached patch. cheers, armin

colorIdCompare.v4p (9.0 kB)

The rounded HSV values displayed in the IOBoxes are the same but the colors are not the same! Hover over the color IOBox Input and Output pins and you will see that the RGB are not identical.

So it should work just fine as long as you make sure the colors are the same.

ok. using RGB values works. thanks.