The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....


Unit: SDL_colorscale
Class: TColorScale
Declaration: function ColorToValue (cl: TColor): double;

The method ColorToValue searches through the entire color array of the color scale to find the color most similar to cl and returns the corresponding scale value.

Please note that the transformation of a color to a numeric value may not be unique. In this case the lowest numeric value is used. If the color cl is not at all contained in the color array, the most similar color (calculated by RGBColorDistance) is used to find the numeric value.

Last Update: 2012-Oct-20