Click or drag to resize

ColorHSLDistance Method

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
)

Parameters

value1
Type: Eto.DrawingColorHSL
First color to compare
value2
Type: Eto.DrawingColorHSL
Second color to compare

Return Value

Type: Single
The 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