ColorRef class final

Token reference for Color values with directive support.

Inheritance
Implemented types
Mixed-in types

Constructors

ColorRef(Prop<Color> prop)

Properties

$directives → List<Directive<Color>>?
Optional directives to transform the resolved value.
finalinherited
a → double
The alpha channel of this color.
finalinherited
alpha → int
The alpha channel of this color in an 8 bit value.
no setterinherited
b → double
The blue channel of this color.
finalinherited
blue → int
The blue channel of this color in an 8 bit value.
no setterinherited
colorSpace → ColorSpace
The color space of this color.
finalinherited
g → double
The green channel of this color.
finalinherited
green → int
The green channel of this color in an 8 bit value.
no setterinherited
hashCode → int
The hash code for this object.
no setterinherited
hasToken → bool
Whether this property contains at least one token source.
no setterinherited
hasValue → bool
Whether this property contains at least one value source.
no setterinherited
opacity → double
The alpha channel of this color as a double.
no setterinherited
r → double
The red channel of this color.
finalinherited
red → int
The red channel of this color in an 8 bit value.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
sources → List<PropSource<Color>>
The list of sources that provide values for this property.
finalinherited
type → Type
The runtime type of the property's value.
no setterinherited
value → int
A 32 bit value representing this color.
no setterinherited

Methods

computeLuminance() → double
Returns a brightness value between 0 for darkest and 1 for lightest.
inherited
directives(List<Directive<Color>> directives) → Prop<Color>
Returns a new property with the given directives merged with existing ones.
inherited
mergeProp(covariant Prop<Color>? other) → Prop<Color>
Merges this property with another property.
inherited
noSuchMethod(Invocation invocation) → Never
Invoked when a nonexistent method or property is accessed.
inherited
toARGB32() → int
Returns a 32-bit value representing this color.
inherited
toString() → String
A string representation of this object.
inherited
withAlpha(int a) → Color
Returns a new color that matches this color with the alpha channel replaced with a (which ranges from 0 to 255).
override
withBlue(int b) → Color
Returns a new color that matches this color with the blue channel replaced with b (which ranges from 0 to 255).
override
withGreen(int g) → Color
Returns a new color that matches this color with the green channel replaced with g (which ranges from 0 to 255).
override
withOpacity(double opacity) → Color
Returns a new color that matches this color with the alpha channel replaced with the given opacity (which ranges from 0.0 to 1.0).
override
withRed(int r) → Color
Returns a new color that matches this color with the red channel replaced with r (which ranges from 0 to 255).
override
withValues({double? alpha, double? red, double? green, double? blue, ColorSpace? colorSpace}) → Color
Returns a new color with the provided components updated.
override

Operators

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