ColourConversions
public static class ColourConversions
Provides static methods for converting one colour space into another. These methods have been implemented based on http://www.easyrgb.com/index.php?X=MATH and do not depend on code in Eto, Rhino, or any other assembly.
Fields
Methods
ApplyAdjective
#Apply an adjective to a colour.
public static Color ApplyAdjective()
Returns: Modified colour.
Cmy_Rgb
#Convert RGB channels into CMY channels.
Cmy_Rgb
#Convert RGB channels into CMY channels.
Cmyk_Rgb
#Convert CMYK channels into RGB channels.
Cmyk_Rgb
#Convert CMYK channels into RGB channels.
Hsl_Rgb
#Convert HSL channels into Standard RGB channels.
Hsl_Rgb
#Convert HSL channels into Standard RGB channels.
Hsp_Rgb
#Convert HSP (perceived luminance) channels into RGB channels.
Hsp_Rgb
#Convert HSP (perceived luminance) channels into RGB channels.
Hsv_Rgb
#Convert HSV/B channels into Standard RGB channels.
Hsv_Rgb
#Convert HSV/B channels into Standard RGB channels.
Lab_Xyz
#Convert Cie L*a*b* channels into Cie XYZ channels.
Lab_Xyz
#Convert Cie L*a*b* channels into Cie XYZ channels.
MapYxyPlanckianLoci
#Compute the points for key temperatures along the black body curve of the CIE Chromaticity diagram.
public static ColourConversions.PlanckianLocus[] MapYxyPlanckianLoci()
RectangleF
frame
Target frame for Yxy graph.
Returns: Temperature measure array.
MapYxyPlanckianLocus
#Compute the points for a degree=3 bezier curve describing the black body curve of the CIE Chromaticity diagram.
public static PointF[] MapYxyPlanckianLocus()
RectangleF
frame
Target frame for Yxy graph.
Returns: Point array.
MapYxyRgbGamut
#Compute the cornerpoints of the sRGB gamut triangle within the CIE Chromaticity diagram.
public static void MapYxyRgbGamut()
RectangleF
frame,
Target frame for Yxy graph.
out PointF
red,
Red corner.
out PointF
green,
Green corner.
out PointF
blue
Blue corner.
MapYxySpectralLoci
#Compute the points for key wavelengths along the spectral curve of the CIE Chromaticity diagram.
public static ColourConversions.SpectralLocus[] MapYxySpectralLoci()
RectangleF
frame
Target frame for Yxy graph.
Returns: Wavelength measure array.
MapYxySpectralLocus
#Compute the points for a degree=3 bezier curve describing the spectral curve of the CIE Chromaticity diagram.
public static PointF[] MapYxySpectralLocus()
RectangleF
frame
Target frame for Yxy graph.
Returns: Point array.
MixColourNames
#Mix two colours using the linguistic parser logic. This method interpolates between the colours inside the Sinusoidal model.
public static Color MixColourNames()
Color
a,
First colour.
Color
b
Second colour.
Returns: Midway colour.
Oklab_Oklch
#Convert Oklab channels into their polar Oklch form.
Oklch_Oklab
#Convert polar Oklch channels into Oklab channels.
Rgb_Cmy
#Convert RGB channels into CMY channels.
Rgb_Cmy
#Convert RGB channels into CMY channels.
Rgb_Cmyk
#Convert standard RGB channels into CMYK channels.
Rgb_Cmyk
#Convert standard RGB channels into CMYK channels.
Rgb_Hsl
#Convert Standard RGB channels into HSL channels.
Rgb_Hsl
#Convert Standard RGB channels into HSL channels.
Rgb_Hsp
#Convert RGB channels into H*SP (perceived luminance) channels.
Rgb_Hsp
#Convert RGB channels into H*SP (perceived luminance) channels.
Rgb_Hsv
#Convert Standard RGB channels into HSV/B channels.
Rgb_Hsv
#Convert Standard RGB channels into HSV/B channels.
Rgb_Xyz
#Convert Standard RGB channels into Cie XYZ channels.
Rgb_Xyz
#Convert Standard RGB channels into Cie XYZ channels.
TryParseNamedColour
#Try and parse a text describing a colour by name.
public static ColourParseSource TryParseNamedColour()
text,
Text to parse.
out Color
colour,
Resulting colour.
includeFuzzyParsing,
If true, near hits are allowed.
includeMixedParsing
If true, combinations of names are allowed.
Xyz_Lab
#Convert Cie XYZ channels into Cie L*a*b* channels.
Xyz_Lab
#Convert Cie XYZ channels into Cie L*a*b* channels.
Xyz_Rgb
#Convert Cie XYZ channels into Standard RGB channels. Note that the RGB values are neither clipped nor tonemapped, so they may well exceed the [0~1] range.
Xyz_Rgb
#Convert Cie XYZ channels into Standard RGB channels. Note that the RGB values are neither clipped nor tonemapped, so they may well exceed the [0~1] range.
Xyz_Yxy
#Convert Cie XYZ channels into Cie Chromaticity diagram channels.
Xyz_Yxy
#Convert Cie XYZ channels into Cie Chromaticity diagram channels.
Yxy_Xyz
#Convert Cie Chromaticity Diagram channels into Cie XYZ channels.
Yxy_Xyz
#Convert Cie Chromaticity Diagram channels into Cie XYZ channels.