Color class

Image pixel colors are instantiated as an int object rather than an instance of the Color class in order to reduce object allocations. Image pixels are stored in 32-bit RGBA format (8 bits per channel). Internally in dart, this will be stored in a "small integer" on 64-bit machines, or a "medium integer" on 32-bit machines. In Javascript, this will be stored in a 64-bit double.

The Color class is used as a namespace for color operations, in an attempt to create a cleaner API for color operations.

Constructors

Color()

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) bool
The equality operator. [...]
inherited

Static Methods

distance(List<num> c1, List<num> c2, bool compareAlpha) num
Compare colors from a 3 or 4 dimensional color space
fromHsl(num hue, num saturation, num lightness) int
Create a color value from HSL values in the range 0, 1.
fromHsv(num hue, num saturation, num value) int
Create a color value from HSV values in the range 0, 1.
fromLab(num L, num a, num b) int
Create a color value from CIE-L*ab values.
fromRgb(int red, int green, int blue) int
Create a color value from RGB values in the range 0, 255. [...]
fromRgba(int red, int green, int blue, int alpha) int
Create a color value from RGBA values in the range 0, 255. [...]
fromXyz(num x, num y, num z) int
Create a color value from XYZ values.