Color class

An immutable representation of a 32 bit color.

Annotations
  • @immutable

Constructors

Color(int value)
Creates an immutable representation of a 32 bit color.
const
Color.fromARGB(int a, int r, int g, int b)
Creates an immutable representation of color from its alpha, red, green, and blue parts.
const
Color.fromRGBO(int r, int g, int b, double opacity)
Creates an immutable representation of color from its red, green, blue, and 0..1 opacity parts.
const

Properties

a int
The opacity channel value from 0..255.
no setter
b int
The blue channel value from 0..255.
no setter
g int
The green channel value from 0..255.
no setter
hashCode int
The hash code for this object.
no setteroverride
r int
The red channel value from 0..255.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value int
The raw 32 bit color value.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override
withOpacity(double opacity) Color
Creates a new color based on this color with the specified opacity, unpremultiplied.

Operators

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

Constants

opaqueBlack → const Color
Fully opaque black.