ColorConverter class
A utility class with color conversion methods to and from RGB for each color model included in this package.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
cmykToRgb(
CmykColor cmykColor) → RgbColor - Converts a CMYK color to a RGB color.
-
getHue(
RgbColor rgbColor) → double -
Calculates the
rgbColor
s hue on a 0 to 1 scale, as used by the HSL, HSP, and HSB color models. -
hexToRgb(
String hex) → RgbColor -
Returns a
hex
color as a RGB color. -
hsbToRgb(
HsbColor hsbColor) → RgbColor - Converts a HSB color to a RGB color.
-
hsiToRgb(
HsiColor hsiColor) → RgbColor - Converts a HSI color to a RGB color.
-
hslToRgb(
HslColor hslColor) → RgbColor - Converts a HSL color to a RGB color.
-
hspToRgb(
HspColor hspColor) → RgbColor - Converts a HSP color to a RGB color.
-
labToRgb(
LabColor labColor) → RgbColor - Converts a LAB color to a RGB color using the XYZ color space as an intermediary.
-
labToXyz(
LabColor labColor) → XyzColor - Converts a XYZ color to a LAB color.
-
oklabToRgb(
OklabColor oklabColor) → RgbColor - Converts an Oklab color to an RGB color.
-
rgbToCmyk(
RgbColor rgbColor) → CmykColor - Converts a RGB color to a CMYK color.
-
rgbToHsb(
RgbColor rgbColor) → HsbColor - Converts a RGB color to a HSB color.
-
rgbToHsi(
RgbColor rgbColor) → HsiColor - Converts a RGB color to a HSI color.
-
rgbToHsl(
RgbColor rgbColor) → HslColor - Converts a RGB color to a HSL color.
-
rgbToHsp(
RgbColor rgbColor) → HspColor - Converts a RGB color to a HSP color.
-
rgbToLab(
RgbColor rgbColor) → LabColor - Converts a RGB color to a LAB color using the XYZ color space as an intermediary.
-
rgbToOklab(
RgbColor rgbColor) → OklabColor - Converts an sRGB color to an Oklab color.
-
rgbToXyz(
RgbColor rgbColor) → XyzColor - Converts an RGB color to a XYZ color.
-
toCmykColor(
ColorModel color) → CmykColor - Converts a color from any color space to CMYK.
-
toHsbColor(
ColorModel color) → HsbColor - Converts a color from any color space to HSL.
-
toHsiColor(
ColorModel color) → HsiColor - Converts a color from any color space to HSI.
-
toHslColor(
ColorModel color) → HslColor - Converts a color from any color space to HSL.
-
toHspColor(
ColorModel color) → HspColor - Converts a color from any color space to HSL.
-
toLabColor(
ColorModel color) → LabColor - Converts a color from any color space to HSL.
-
toOklabColor(
ColorModel color) → OklabColor - Converts a color from any color space to Oklab.
-
toXyzColor(
ColorModel color) → XyzColor - Converts a color from any color space to XYZ.
-
xyzToLab(
XyzColor xyzColor) → LabColor - Converts an XYZ color to a LAB color.
-
xyzToRgb(
XyzColor xyzColor) → RgbColor - Converts an XYZ color to a RGB color.