Color class abstract

An object representing a color.

A Color can be constructed be specifying its value as either an RGB vector, a 6 digit hex string, an HSL vector, an XYZ vector, or a LAB vector using the appropriate named constructor. Alternatively, the appropriate subclass can be instantiated directly.

Colors can be directly compared using the == operator, which will return true if the two Color objects represent the same RGB color.

Implementers

Constructors

Color()
const
Color.cielab(num l, num a, num b)
const
factory
Color.hex(String hexCode)
factory
Color.hsl(num h, num s, num l)
const
factory
Color.hsv(num h, num s, num v)
const
factory
Color.rgb(num r, num g, num b)
const
factory
Color.xyz(num x, num y, num z)
const
factory

Properties

hashCode int
The hash code for this object.
no setteroverride
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
toCielabColor() CielabColor
toHexColor() HexColor
toHslColor() HslColor
toHsvColor() HsvColor
toMap() Map<String, num?>
toRgbColor() RgbColor
toString() String
A string representation of this object.
override
toXyzColor() XyzColor

Operators

operator ==(Object other) bool
The equality operator.
override
operator [](String key) → dynamic