Color Math

Colors and conversion into different formats.


EColorSpace

EColorSpace = enum(RGB, HSV, HSL, XYZ, LAB, LCH, DELTAE)

Enum of color spaces Simba supports.

Note

This enum is scoped, which means it must be used like: EColorSpace.HSL, or EColorSpace.RGB etc.


TColorRGB.ToXYZ

function TColorRGB.ToXYZ: TColorXYZ;

TColorRGB.ToLAB

function TColorRGB.ToLAB: TColorLAB;

TColorRGB.ToLCH

function TColorRGB.ToLCH: TColorLCH;

TColorRGB.ToHSV

function TColorRGB.ToHSV: TColorHSV;

TColorRGB.ToHSL

function TColorRGB.ToHSL: TColorHSL;

TColorRGB.ToColor

function TColorRGB.ToColor: TColor;

TColor.ToBGRA

function TColor.ToBGRA: TColorBGRA;

TColor.ToRGB

function TColor.ToRGB: TColorRGB;

TColor.ToXYZ

function TColor.ToXYZ: TColorXYZ;

TColor.ToLAB

function TColor.ToLAB: TColorLAB;

TColor.ToLCH

function TColor.ToLCH: TColorLCH;

TColor.ToHSV

function TColor.ToHSV: TColorHSV;

TColor.ToHSL

function TColor.ToHSL: TColorHSL;

TColorHSL.ToRGB

function TColorHSL.ToRGB: TColorRGB;

TColorHSL.ToColor

function TColorHSL.ToColor: TColor;

TColorHSV.ToRGB

function TColorHSV.ToRGB: TColorRGB;

TColorHSV.ToColor

function TColorHSV.ToColor: TColor;

TColorXYZ.ToRGB

function TColorXYZ.ToRGB: TColorRGB;

TColorXYZ.ToColor

function TColorXYZ.ToColor: TColor;

TColorLAB.ToRGB

function TColorLAB.ToRGB: TColorRGB;

TColorLAB.ToColor

function TColorLAB.ToColor: TColor;

TColorLCH.ToRGB

function TColorLCH.ToRGB: TColorRGB;

TColorLCH.ToColor

function TColorLCH.ToColor: TColor;

ColorIntensity

function ColorIntensity(Color: TColor): Byte;

ColorToGray

function ColorToGray(Color: TColor): Byte;

ColorToRGB

function ColorToRGB(Color: TColor): TColorRGB;

ColorToBGRA

function ColorToBGRA(Color: TColor): TColorBGRA;

ColorToHSL

function ColorToHSL(Color: TColor): TColorHSL;

ColorToHSV

function ColorToHSV(Color: TColor): TColorHSV;

ColorToXYZ

function ColorToXYZ(Color: TColor): TColorXYZ;

ColorToLAB

function ColorToLAB(Color: TColor): TColorLAB;

ColorToLCH

function ColorToLCH(Color: TColor): TColorLCH;

SimilarColors

function SimilarColors(Color1, Color2: TColor; Tolerance: Single; ColorSpace: EColorSpace; Multipliers: TChannelMultipliers): Boolean;

SimilarColors

function SimilarColors(Color1, Color2: TColor; Tolerance: Single): Boolean;

ColorDistance

function ColorDistance(const Color1, Color2: TColor; const ColorSpace: EColorSpace; const Multipliers: TChannelMultipliers): Single;

ColorDistance

function ColorDistance(const Color1, Color2: TColor): Single;

GetBestColor

function GetBestColor(ColorSpace: EColorSpace; Colors: TColorArray): TBestColor;

TColor.R

function TColor.R: Byte;

Return the red channel value of a TColor


TColor.G

function TColor.G: Byte;

Return the green channel value of a TColor


TColor.B

function TColor.B: Byte;

Return the blue channel value of a TColor


Colors

This record constants of -140 HTML colors.

Colors.ALICEBLUE
Colors.ANTIQUEWHITE
Colors.AQUA
Colors.AQUAMARINE
Colors.AZURE
Colors.BEIGE
Colors.BISQUE
Colors.BLACK
Colors.BLANCHEDALMOND
Colors.BLUE
Colors.BLUEVIOLET
Colors.BROWN
Colors.BURLYWOOD
Colors.CADET_BLUE
Colors.CHARTREUSE
Colors.CHOCOLATE
Colors.CORAL
Colors.CORNFLOWER_BLUE
Colors.CORNSILK
Colors.CRIMSON
Colors.CYAN
Colors.DARK_BLUE
Colors.DARK_CYAN
Colors.DARK_GOLDENROD
Colors.DARK_GRAY
Colors.DARK_GREEN
Colors.DARK_GREY
Colors.DARK_KHAKI
Colors.DARK_MAGENTA
Colors.DARK_OLIVEGREEN
Colors.DARK_ORANGE
Colors.DARK_ORCHID
Colors.DARK_RED
Colors.DARK_SALMON
Colors.DARK_SEAGREEN
Colors.DARK_SLATEBLUE
Colors.DARK_SLATEGRAY
Colors.DARK_SLATEGREY
Colors.DARK_TURQUOISE
Colors.DARK_VIOLET
Colors.DEEPPINK
Colors.DEEPSKYBLUE
Colors.DIMGRAY
Colors.DIMGREY
Colors.DODGERBLUE
Colors.FIREBRICK
Colors.FLORALWHITE
Colors.FORESTGREEN
Colors.FUCHSIA
Colors.GAINSBORO
Colors.GHOSTWHITE
Colors.GOLD
Colors.GOLDENROD
Colors.GRAY
Colors.GREEN
Colors.GREENYELLOW
Colors.GREY
Colors.HONEYDEW
Colors.HOTPINK
Colors.INDIANRED
Colors.INDIGO
Colors.IVORY
Colors.KHAKI
Colors.LAVENDER
Colors.LAVENDERBLUSH
Colors.LAWNGREEN
Colors.LEMONCHIFFON
Colors.LIGHT_BLUE
Colors.LIGHT_CORAL
Colors.LIGHT_CYAN
Colors.LIGHT_GOLDENRODYELLOW
Colors.LIGHT_GRAY
Colors.LIGHT_GREEN
Colors.LIGHT_GREY
Colors.LIGHT_PINK
Colors.LIGHT_SALMON
Colors.LIGHT_SEAGREEN
Colors.LIGHT_SKYBLUE
Colors.LIGHT_SLATEGRAY
Colors.LIGHT_SLATEGREY
Colors.LIGHT_STEELBLUE
Colors.LIGHT_YELLOW
Colors.LIME
Colors.LIMEGREEN
Colors.LINEN
Colors.MAGENTA
Colors.MAROON
Colors.MEDIUM_AQUAMARINE
Colors.MEDIUM_BLUE
Colors.MEDIUM_ORCHID
Colors.MEDIUM_PURPLE
Colors.MEDIUM_SEAGREEN
Colors.MEDIUM_SLATEBLUE
Colors.MEDIUM_SPRINGGREEN
Colors.MEDIUM_TURQUOISE
Colors.MEDIUM_VIOLETRED
Colors.MIDNIGHTBLUE
Colors.MINTCREAM
Colors.MISTYROSE
Colors.MOCCASIN
Colors.NAVAJOWHITE
Colors.NAVY
Colors.OLDLACE
Colors.OLIVE
Colors.OLIVEDRAB
Colors.ORANGE
Colors.ORANGERED
Colors.ORCHID
Colors.PALE_GOLDENROD
Colors.PALE_GREEN
Colors.PALE_TURQUOISE
Colors.PALE_VIOLETRED
Colors.PAPAYAWHIP
Colors.PEACHPUFF
Colors.PERU
Colors.PINK
Colors.PLUM
Colors.POWDERBLUE
Colors.PURPLE
Colors.REBECCAPURPLE
Colors.RED
Colors.ROSYBROWN
Colors.ROYALBLUE
Colors.SADDLEBROWN
Colors.SALMON
Colors.SANDYBROWN
Colors.SEAGREEN
Colors.SEASHELL
Colors.SIENNA
Colors.SILVER
Colors.SKYBLUE
Colors.SLATEBLUE
Colors.SLATEGRAY
Colors.SLATEGREY
Colors.SNOW
Colors.SPRINGGREEN
Colors.STEELBLUE
Colors.TAN
Colors.TEAL
Colors.THISTLE
Colors.TOMATO
Colors.TURQUOISE
Colors.VIOLET
Colors.WHEAT
Colors.WHITE
Colors.WHITESMOKE
Colors.YELLOW
Colors.YELLOWGREEN