PaletteGenerator class abstract
Generates a complete ThemePalette from a ThemeSeed.
This is the "black box" that derives all colors from minimal input. Uses WCAG contrast algorithms for foreground colors.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
blendColors(
int color1, int color2, double amount) → int -
Blend two colors together.
amountis the weight ofcolor1(0.0 = all color2, 1.0 = all color1). -
container(
int background, int color, {double opacity = 0.1}) → int - Create a container color (background with color overlay at opacity).
-
contrastingForeground(
int color) → int - Get a contrasting foreground color (black or white) for a background. Uses WCAG relative luminance formula.
-
darken(
int color, double amount) → int - Darken a color by a percentage (0.0 - 1.0).
-
generate(
ThemeSeed seed) → ThemePalette - Generate a full palette from seed colors.
-
lighten(
int color, double amount) → int - Lighten a color by a percentage (0.0 - 1.0).
-
relativeLuminance(
int color) → double - Calculate relative luminance (0.0 - 1.0) per WCAG 2.1.
-
setAlpha(
int color, double alpha) → int - Set the alpha channel of a color (0.0 - 1.0).
-
toHex(
int color) → String - Convert to CSS hex: "#ffffff"
-
toRgba(
int color) → String - Convert to CSS rgba: "rgba(255, 255, 255, 0.5)"
-
toRgbString(
int color) → String - Extract RGB as string for CSS: "255, 255, 255"