ZetaColorSwatch class Theme
A swatch of colors with values from 10 (light) to 100 (dark).
- Inheritance
-
- Object
- Color
- ColorSwatch<
int> - ZetaColorSwatch
- Mixed in types
- Available Extensions
- Annotations
Constructors
-
ZetaColorSwatch({Brightness brightness = Brightness.light, ZetaContrast contrast = ZetaContrast.aa, required int primary, required Map<
int, Color> swatch}) -
Constructs a ZetaColorSwatch.
const
- ZetaColorSwatch.fromColor(Color primary, {Brightness brightness = Brightness.light, ZetaContrast contrast = ZetaContrast.aa, Color background = Colors.white})
-
ZetaColorSwatch
is a color swatch utility to produce different shades of a primary color, following a specific progression of lightness and darkness.factory
Properties
- alpha → int
-
The alpha channel of this color in an 8 bit value.
no setterinherited
- blue → int
-
The blue channel of this color in an 8 bit value.
no setterinherited
- border → Color
-
Returns the color shade for a border depending on the ZetaContrast value.
no setter
- brightness → Brightness
-
Selected contrast level of the system
final
- contrast → ZetaContrast
-
Selected contrast level of the system
final
- focus → Color
-
Returns the color shade for a focus state depending on the ZetaContrast value.
no setter
- 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
- hover → Color
-
Returns the color shade for a hover state depending on the ZetaContrast value.
no setter
- icon → Color
-
Returns the color shade for an icon depending on the ZetaContrast value.
no setter
- opacity → double
-
The alpha channel of this color as a double.
no setterinherited
-
props
→ List<
Object?> -
The list of properties that will be used to determine whether
two instances are equal.
no setteroverride
- 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
- selected → Color
-
Returns the color shade for a selected state depending on the ZetaContrast value.
no setter
- shade10 → Color
-
The lightest shade.
no setter
- shade20 → Color
-
The second lightest shade.
no setter
- shade30 → Color
-
The third lightest shade.
no setter
- shade40 → Color
-
The fourth lightest shade.
no setter
- shade50 → Color
-
The fifth lightest shade.
no setter
- shade60 → Color
-
The default shade.
no setter
- shade70 → Color
-
The fourth darkest shade.
no setter
- shade80 → Color
-
The third darkest shade.
no setter
- shade90 → Color
-
The second darkest shade.
no setter
- shade100 → Color
-
The darkest shade.
no setter
- stringify → bool?
-
If set to
true
, the toString method will be overridden to output this instance's props.no setterinherited - subtle → Color
-
Returns the color shade for a subtle visual element depending on the ZetaContrast value.
no setter
- surface → Color
-
Returns the color shade for a surface depending on the ZetaContrast value.
no setter
- text → Color
-
Returns the color shade for a surface depending on the ZetaContrast value.
no setter
- value → int
-
A 32 bit value representing this color.
finalinherited
Methods
-
apply(
{ZetaContrast contrast = ZetaContrast.aa, Brightness brightness = Brightness.light}) → ZetaColorSwatch -
Creates a copy of the current ZetaColorSwatch with potential modifications
based on the provided
contrast
andbrightness
. -
computeLuminance(
) → double -
Returns a brightness value between 0 for darkest and 1 for lightest.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
shade(
int number) → Color - Takes an integer as argument and returns a color shade based on that number. If no shade with the given number exists, it returns the color itself.
-
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).inherited -
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).inherited -
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).inherited -
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).inherited -
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).inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
-
operator [](
int index) → Color? -
This method is an override of the index operator.
override