Calculates the 'distance' of two HSL colors
Namespace:
Eto.Drawing
Assembly:
Eto (in Eto.dll) Version: 2.5.3-dev
Syntax public static float Distance(
ColorHSL value1,
ColorHSL value2
)
Public Shared Function Distance (
value1 As ColorHSL,
value2 As ColorHSL
) As Single
static member Distance :
value1 : ColorHSL *
value2 : ColorHSL -> float32
Parameters
- value1
- Type: Eto.DrawingColorHSL
First color to compare - value2
- Type: Eto.DrawingColorHSL
Second color to compare
Return Value
Type:
SingleThe overall distance/difference between the two colours. A lower value indicates a closer match
Remarks
This is useful for comparing two different color values to determine if they are similar.
The HSL comparison algorithm, while not essentially accurate, gives a good representation of like-colours
to the human eye. This method of calculating distance is preferred over the other methods (RGB, CMYK, HSB)
See Also