ColorModel class Null safety

The base color model class.

Implementers
Annotations

Constructors

ColorModel({int alpha = 255})
The base color model class.
const

Properties

alpha int
The alpha value of this color.
final
chroma double
Calculates a value representing this color's lightness on a linear scale.
read-only
hashCode int
The hash code for this object.
read-onlyinherited
hex String
Returns this as a hexidecimal string.
read-only
hue num
Gets the hue value of this color.
read-only
inverted ColorModel
Inverts the values of this ColorModel, excluding alpha, in its own color space.
read-only
isBlack bool
Returns true if this color is pure black.
read-only
isMonochromatic bool
Returns true if this color is monochromatic.
read-only
isWhite bool
Returns true if this color is pure white.
read-only
opacity double
The alpha value as a double normalized to a 0.0 to 1.0 range.
read-only
opposite ColorModel
Returns the color with the hue opposite of this colors'.
read-only
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
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

Methods

castTo(ColorModel other) ColorModel
Converts this color to other's color space.
convert(ColorModel other) ColorModel
Converts other to this color's color space.
cooler(num amount, {bool relative}) ColorModel
Adjusts the hue of this color by amount towards 270 degrees, capping the value at 270.
copyWith({int? alpha}) ColorModel
Returns a copy of this color modified with the provided values.
distanceTo(ColorModel color) double
Returns the distance between this color's hue and color's hue in degrees.
equals(ColorModel color) bool
Compares colors in the RGB color space.
interpolate(ColorModel end, double step) ColorModel
Interpolates to step between this and end.
lerpTo(ColorModel color, int steps, {ColorSpace? colorSpace, bool excludeOriginalColors = false}) List<ColorModel>
Returns the interpolated steps between this color and color.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
rotateHue(num amount) ColorModel
Rotates the hue of this color by amount in degrees.
toCmykColor() CmykColor
Converts this to the CMYK color space.
toHsbColor() HsbColor
Converts this to the HSB color space.
toHsiColor() HsiColor
Converts this to the HSI color space.
toHslColor() HslColor
Converts this to the HSL color space.
toHspColor() HspColor
Converts this to the HSP color space.
toLabColor() LabColor
Converts this to the LAB color space.
toList() List<num>
Returns the values of the color model in the same order as their characters in their color space's abbreviation.
toListWithAlpha() List<num>
Returns the values of the color model in the same order as their characters in their color space's abbreviation plus the alpha value.
toOklabColor() OklabColor
Converts this to the Oklab color space.
toRgbColor() RgbColor
Converts this to the RGB color space.
toString() String
A string representation of this object.
inherited
toXyzColor() XyzColor
Converts this to the XYZ color space.
warmer(num amount, {bool relative}) ColorModel
Adjusts the hue of this color by amount towards 90 degrees, capping the value at 90.
withAlpha(int alpha) ColorModel
Returns this ColorModel with the provided alpha value.
withChroma(double chroma) ColorModel
Converts this color to the Oklab color space, calculates and applies a new lightness value from the proivded chroma value, and converts it back to the original color space.
withHue(num hue) ColorModel
Returns this ColorModel with the provided hue value.
withOpacity(double opacity) ColorModel
Returns this ColorModel with the provided opacity value.
withValues(List<num> values) ColorModel
Returns a color in this color's color space with the values provided.

Operators

operator ==(Object other) bool
The equality operator.
inherited