SheenColors class Foundation
The colours of a sheen theme, one set per brightness.
Build a palette with SheenColors.light or SheenColors.dark and an accent; change single colours with copyWith. Every text colour reads at WCAG AA (4.5:1) on background and surface.
- Mixed-in types
- Annotations
Constructors
- SheenColors({required Color background, required Color surface, required Color surfaceMuted, required Color track, required Color separator, required Color text, required Color textSecondary, required Color textTertiary, required Color accent, required Color onAccent, required Color accentText, required Color success, required Color warning, required Color danger, required Color rating, required Color sheet})
-
A palette from its parts. Prefer SheenColors.light and SheenColors.dark, which derive the accent colours.
const
- SheenColors.dark({Color accent = defaultDarkAccent})
-
The dark palette.
factory
- SheenColors.light({Color accent = defaultLightAccent})
-
The light palette.
factory
Properties
- accent → Color
-
The accent fill: prominent glass, primary buttons, selected states, the switch. Labels on it use onAccent.
final
- accentText → Color
-
Accent-coloured text and icons on background or surface: links, selected tab labels. Never put white text on
it.
final
- background → Color
-
The page ground.
final
- danger → Color
-
Errors, destructive actions and the last moments of a countdown.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- onAccent → Color
-
Labels and icons drawn on accent.
final
- rating → Color
-
Star rating glyphs.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- separator → Color
-
Hairline separators.
final
- sheet → Color
-
The background of sheets and dialogs.
final
- success → Color
-
Positive states: success, available, included, free cancellation.
final
- surface → Color
-
Cards, lists and grouped rows.
final
- surfaceMuted → Color
-
Inputs, secondary buttons and surfaces nested in a surface.
final
- text → Color
-
Primary text and icons.
final
- textSecondary → Color
-
Secondary text: subtitles, captions, values next to a label.
final
- textTertiary → Color
-
Tertiary text: hints, placeholders, disabled labels.
final
- track → Color
-
Tracks of sliders, progress bars and switches; skeleton placeholders.
final
- warning → Color
-
Caution states: time running out, conditions apply.
final
Methods
-
copyWith(
{Color? background, Color? surface, Color? surfaceMuted, Color? track, Color? separator, Color? text, Color? textSecondary, Color? textTertiary, Color? accent, Color? onAccent, Color? accentText, Color? success, Color? warning, Color? danger, Color? rating, Color? sheet}) → SheenColors - A copy with the given colours replaced.
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringShort(
) → String -
A brief description of this object, usually just the runtimeType and the
hashCode.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override
Static Methods
-
contrastOf(
Color a, Color b) → double - The WCAG contrast ratio of two opaque colours, from 1 to 21.
-
lerp(
SheenColors a, SheenColors b, double t) → SheenColors -
Blends every colour of
aandbatt(0 givesa, 1 givesb). -
liftedFor(
Color color, Color ground) → Color -
colormixed with white in 5 % steps until it reaches 4.5:1 contrast onground. -
onColorFor(
Color color) → Color -
White or near-black, whichever reads better on
color.
Constants
- defaultDarkAccent → const Color
- The default accent of the dark theme.
- defaultLightAccent → const Color
- The default accent of the light theme, a blue with 5.6:1 contrast on white.