LabColor class

A color in the CIELAB color space.

The CIELAB color space contains channels for lightness, a (red and green opponent values), and b (blue and yellow opponent values.)

Inheritance
Implemented types

Constructors

LabColor(num lightness, num a, num b, [int alpha = 255])
A color in the CIELAB color space. [...]
const
LabColor.extrapolate(List<double> lab)
Constructs a LabColor from a list of lab values on a 0 to 1 scale. [...]
factory
LabColor.from(ColorModel color)
Constructs a LabColor from color.
factory
LabColor.fromColor(Color color)
Constructs a LabColor from color.
factory
LabColor.fromHex(String hex)
Constructs a LabColor from a hex color. [...]
factory
LabColor.fromList(List<num> lab)
Constructs a LabColor from a list of lab values. [...]
factory
LabColor.random({num minLightness: 0, num maxLightness: 100, num minA: 0, num maxA: 100, num minB: 0, num maxB: 100})
Generates a LabColor at random. [...]
factory

Properties

a num
The red to green opponent color value. [...]
final, inherited
alpha int
The alpha value of this color. [...]
final, inherited
b num
The yellow to blue opponent color value. [...]
final, inherited
blue int
The blue value of this color.
read-only, inherited
green int
The green value of this color.
read-only, inherited
hashCode int
The hash code for this object. [...]
read-only, inherited
hex String
Returns this as a hexidecimal string.
read-only, inherited
hue num
Gets the hue value of this color. [...]
read-only, inherited
inverted LabColor
Inverts the values of this ColorModel, excluding alpha, in its own color space.
read-only, override
isBlack bool
Returns true if this color is pure black.
read-only, inherited
isMonochromatic bool
Returns true if this color is monochromatic.
read-only, inherited
isWhite bool
Returns true if this color is pure white.
read-only, inherited
lightness num
Lightness represents the black to white value. [...]
final, inherited
opacity double
The alpha value as a double normalized to a 0.0 to 1.0 range.
read-only, inherited
opposite LabColor
Returns the color with the hue opposite of this colors'.
read-only, override
red int
The red value of this color.
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
saturation num
The saturation value of this color. Color spaces without a saturation value will be converted to HSL to retrieve the value. [...]
read-only, inherited
value int
A 32 bit value representing this color. [...]
read-only, override

Methods

computeLuminance() double
Returns a brightness value between 0 for darkest and 1 for lightest. [...]
inherited
cooler(num amount, {bool relative: true}) LabColor
Adjusts the hue of this color by amount towards 270 degrees, capping the value at 270. [...]
override
distanceTo(ColorModel color) double
Returns the distance between this color's hue and color's hue in degrees.
inherited
equals(ColorModel color) bool
Compares colors in the RGB color space. [...]
inherited
lerpTo(ColorModel color, int steps, {bool excludeOriginalColors: false}) List<LabColor>
Returns the interpolated steps between this color and color. [...]
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
rotateHue(num amount) LabColor
Rotates the hue of this color by amount in degrees.
override
toCmykColor() CmykColor
Converts this to the CMYK color space.
inherited
toColor() Color
Returns this as a Color, converting the model to RGB if necessary. Returns color as a Color.
inherited
toHsbColor() HsbColor
Converts this to the HSV color space.
inherited
toHsiColor() HsiColor
Converts this to the HSI color space.
inherited
toHslColor() HslColor
Converts this to the HSL color space.
inherited
toHspColor() HspColor
Converts this to the HSP color space.
inherited
toLabColor() LabColor
Converts this to the LAB color space.
override
toList() List<num>
Returns a fixed-length List containing the lightness, a, and b values, in that order.
inherited
toListWithAlpha() List<num>
Returns a fixed-length List containing the lightness, a, b, and alpha values, in that order.
inherited
toRgbColor() RgbColor
Converts this to the RGB color space.
inherited
toString() String
Returns a string representation of this object.
inherited
toXyzColor() XyzColor
Converts this to the XYZ color space.
inherited
warmer(num amount, {bool relative: true}) LabColor
Adjusts the hue of this color by amount towards 90 degrees, capping the value at 90. [...]
override
withA(num a) LabColor
Returns this LabColor modified with the provided a value.
override
withAlpha(int alpha) LabColor
Returns this LabColor modified with the provided alpha value.
override
withB(num b) LabColor
Returns this LabColor modified with the provided b value.
override
withBlue(num blue) LabColor
Returns a new color that matches this color with the blue channel replaced with b (which ranges from 0 to 255). [...]
override
withGreen(num green) LabColor
Returns a new color that matches this color with the green channel replaced with g (which ranges from 0 to 255). [...]
override
withHue(num hue) LabColor
Returns this LabColor modified with the provided hue value.
override
withLightness(num lightness) LabColor
Returns this LabColor modified with the provided lightness value.
override
withOpacity(double opacity) LabColor
Returns this ColorModel with the provided opacity value. [...]
override
withRed(num red) LabColor
Returns a new color that matches this color with the red channel replaced with r (which ranges from 0 to 255). [...]
override

Operators

operator ==(Object o) bool
The equality operator. [...]
inherited