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.)
- Implemented types
- Available extensions
Constructors
- LabColor(num lightness, num a, num b, [int alpha = 255])
- 
          A color in the CIELAB color space.
            const
- 
          LabColor.extrapolate(List<double> values)
- 
          Constructs a LabColor from a list of labvalues on a0to1scale.factory
- LabColor.from(ColorModel color)
- 
          Constructs a LabColor from a RGB hex color.
            factory
- LabColor.fromColor(Color color)
- 
          Constructs a LabColor from color.factory
- LabColor.fromHex(String hex)
- 
          
            factory
- 
          LabColor.fromList(List<num> values)
- 
          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, int? seed})
- 
          Generates a LabColor at random.
            factory
Properties
- a → double
- 
  The alpha channel of this color.
  finalinherited
- alpha → int
- 
  The alpha value of this color.
  finalinherited
- b → double
- 
  The blue channel of this color.
  finalinherited
- blue → int
- 
  The blue value of this color.
  no setterinherited
- chroma → double
- 
  Calculates a value representing this color's lightness on a linear scale.
  no setterinherited
- colorSpace → ColorSpace
- 
  The color space of this color.
  finalinherited
- g → double
- 
  The green channel of this color.
  finalinherited
- green → int
- 
  The green value of this color.
  no setterinherited
- hashCode → int
- 
  The hash code for this object.
  no setterinherited
- hex → String
- 
  Returns thisas a hexidecimal string.no setterinherited
- hue → num
- 
  Gets the hue value of this color.
  no setterinherited
- inverted → LabColor
- 
  Inverts the values of this ColorModel, excluding alpha, in its own color space.no setter
- isBlack → bool
- 
  Returns trueif this color is pure black.no setterinherited
- isMonochromatic → bool
- 
  Returns trueif this color is monochromatic.no setterinherited
- isWhite → bool
- 
  Returns trueif this color is pure white.no setterinherited
- lightness → num
- 
  Lightness represents the black to white value.
  finalinherited
- opacity → double
- 
  The alphavalue as a double normalized to a0.0to1.0range.no setterinherited
- opposite → LabColor
- 
  Returns the color with the hue opposite of this colors'.
  no setter
- r → double
- 
  The red channel of this color.
  finalinherited
- red → int
- 
  The red value of this color.
  no setterinherited
- runtimeType → Type
- 
  A representation of the runtime type of the object.
  no setterinherited
- saturation → num
- 
  The saturation value of this color. Color spaces without a saturation
value will be converted to HSL to retrieve the value.
  no setterinherited
- value → int
- 
  A 32 bit value representing this color.
  no setteroverride
Methods
- 
  castTo(ColorModel other) → ColorModel 
- 
  Converts this color to other's color space.inherited
- 
  computeLuminance() → double 
- 
  Returns a brightness value between 0 for darkest and 1 for lightest.
  inherited
- 
  convert(ColorModel other) → LabColor 
- 
  Converts otherto this color's color space.
- 
  cooler(num amount, {bool relative = true}) → LabColor 
- 
  Adjusts the hue of this color by amounttowards270degrees, capping the value at270.
- 
  copyWith({num? lightness, num? a, num? b, int? alpha}) → LabColor 
- Returns a copy of this color modified with the provided values.
- 
  distanceTo(ColorModel color) → double 
- 
  Returns the distance between thiscolor's hue andcolor's hue in degrees.inherited
- 
  equals(ColorModel color) → bool 
- 
  Compares colors in the RGB color space.
  inherited
- 
  interpolate(Color end, double step) → Color 
- 
      Available on Color, provided by the LerpToColor extension Interpolates to the definedstepbetween this color andend.
- 
  interpolate(ColorModel end, double step) → LabColor 
- 
  Interpolates to stepbetweenthisandend.
- 
  lerpTo(ColorModel color, int steps, {ColorSpace? colorSpace, bool excludeOriginalColors = false}) → List< LabColor> 
- 
  Returns the interpolated stepsbetween this color andcolor.
- 
  lerpTo(Color color, int steps, {ColorSpace? colorSpace, bool excludeOriginalColors = false}) → List< Color> 
- 
      Available on Color, provided by the LerpToColor extension Returns the interpolatedstepsbetween this color andcolor.
- 
  noSuchMethod(Invocation invocation) → dynamic 
- 
  Invoked when a nonexistent method or property is accessed.
  inherited
- 
  rotateHue(num amount) → LabColor 
- 
  Rotates the hue of this color by amountin degrees.
- 
  rotateHueRad(double amount) → LabColor 
- 
  Rotates the hue of this color by amountin radians.
- 
  toARGB32() → int 
- 
  Returns a 32-bit value representing this color.
  inherited
- 
  toCmykColor() → CmykColor 
- 
      Available on Color, provided by the ToColorModel extension Returns this color as a CmykColor.
- 
  toCmykColor() → CmykColor 
- 
  Converts thisto the CMYK color space.inherited
- 
  toColor() → Color 
- 
      Available on ColorModel, provided by the ToColor extension Returnsthisas a Color, converting the color to RGB if necessary.
- 
  toColorModel() → ColorModel 
- 
      Available on Color, provided by the ToColorModel extension Ifthisis a ColorModel, returnthis, otherwise construct a new RgbColor from this Color.
- 
  toHsbColor() → HsbColor 
- 
      Available on Color, provided by the ToColorModel extension Returns this color as a HsbColor.
- 
  toHsbColor() → HsbColor 
- 
  Converts thisto the HSV color space.inherited
- 
  toHsiColor() → HsiColor 
- 
  Converts thisto the HSI color space.inherited
- 
  toHsiColor() → HsiColor 
- 
      Available on Color, provided by the ToColorModel extension Returns this color as a HsiColor.
- 
  toHslColor() → HslColor 
- 
  Converts thisto the HSL color space.inherited
- 
  toHslColor() → HslColor 
- 
      Available on Color, provided by the ToColorModel extension Returns this color as a HslColor.
- 
  toHspColor() → HspColor 
- 
  Converts thisto the HSP color space.inherited
- 
  toHspColor() → HspColor 
- 
      Available on Color, provided by the ToColorModel extension Returns this color as a HspColor.
- 
  toLabColor() → LabColor 
- 
  Converts thisto the LAB color space.
- 
  toLabColor() → LabColor 
- 
      Available on Color, provided by the ToColorModel extension Returns this color as a LabColor.
- 
  toList() → List< num> 
- 
  Returns a fixed-length list containing the lightness,a, andbvalues, in that order.inherited
- 
  toListWithAlpha() → List< num> 
- 
  Returns a fixed-length list containing the lightness,a,b, andalphavalues, in that order.inherited
- 
  toOklabColor() → OklabColor 
- 
  Converts thisto the Oklab color space.inherited
- 
  toOklabColor() → OklabColor 
- 
      Available on Color, provided by the ToColorModel extension Returns this color as an OklabColor.
- 
  toRgbColor() → RgbColor 
- 
  Converts thisto the RGB color space.inherited
- 
  toRgbColor() → RgbColor 
- 
      Available on Color, provided by the ToColorModel extension Returns this color as a RgbColor.
- 
  toString() → String 
- 
  A string representation of this object.
  inherited
- 
  toXyzColor() → XyzColor 
- 
  Converts thisto the XYZ color space.inherited
- 
  toXyzColor() → XyzColor 
- 
      Available on Color, provided by the ToColorModel extension Returns this color as a XyzColor.
- 
  warmer(num amount, {bool relative = true}) → LabColor 
- 
  Adjusts the hue of this color by amounttowards90degrees, capping the value at90.
- 
  withAlpha(int alpha) → LabColor 
- 
  Returns this LabColormodified with the providedalphavalue.
- 
  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
- 
  withChroma(double chroma) → LabColor 
- 
  Converts this color to the Oklab color space, calculates and
applies a new lightness value from the proivded chromavalue, and converts it back to the original color space.
- 
  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 huevalue.
- 
  withOpacity(double opacity) → LabColor 
- 
  Returns this ColorModelwith the providedopacityvalue.
- 
  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
- 
  withValues(List< num> values) → LabColor
- Returns a color in this color's color space with the values provided.
Operators
- 
  operator ==(Object other) → bool 
- 
  The equality operator.
  inherited