FHUColorValueNotifierExtension extension
Extension: ColorValueNotifierExtension
Description:
Adds convenience methods to ValueNotifier<Color>
for managing color state changes
Example:
final colorValueNotifier = Colors.blue.notifier;
colorValueNotifier.withOpacity(0.5);
- on
Properties
- alpha → int
-
The alpha channel of this color in an 8 bit value.
no setter
- blue → int
-
The blue channel of this color in an 8 bit value.
no setter
- green → int
-
The green channel of this color in an 8 bit value.
no setter
- opacity → double
-
The alpha channel of this color as a double.
no setter
- red → int
-
The red channel of this color in an 8 bit value.
no setter
Methods
-
computeLuminance(
) → double - Returns a brightness value between 0 for darkest and 1 for lightest.
-
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). -
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). -
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). -
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). -
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).