WeColorScheme class
The colour design tokens of Widgets Easier.
The naming follows the Element Plus palette: seven semantic colours, five text colours, six border colours, seven fill colours and three background colours. Two built-in palettes are provided through WeColorScheme.light and WeColorScheme.dark; use copyWith to derive a brand-specific palette.
- Available extensions
- Annotations
Constructors
- WeColorScheme({required Brightness brightness, required Color primary, required Color secondary, required Color success, required Color warning, required Color info, required Color danger, required Color fatal, required Color primaryText, required Color regularText, required Color secondaryText, required Color placeholderText, required Color disabledText, required Color darkerBorder, required Color darkBorder, required Color baseBorder, required Color lightBorder, required Color lighterBorder, required Color extraLightBorder, required Color darkerFill, required Color darkFill, required Color baseFill, required Color lightFill, required Color lighterFill, required Color extraLightFill, required Color blankFill, required Color pageBackground, required Color baseBackground, required Color overlayBackground, required Color mask})
-
const
- WeColorScheme.dark({Color primary = const Color(0xFF409EFF), Color secondary = const Color(0xFF909399), Color success = const Color(0xFF67C23A), Color warning = const Color(0xFFE6A23C), Color info = const Color(0xFF0DCAF0), Color danger = const Color(0xFFF56C6C), Color fatal = const Color(0xFFD65CF5)})
-
The default dark palette (values follow Element Plus' dark theme).
const
- WeColorScheme.light({Color primary = const Color(0xFF409EFF), Color secondary = const Color(0xFF909399), Color success = const Color(0xFF67C23A), Color warning = const Color(0xFFE6A23C), Color info = const Color(0xFF0DCAF0), Color danger = const Color(0xFFDC3545), Color fatal = const Color(0xFFC910F2)})
-
The default light palette.
const
Properties
- baseBackground → Color
-
final
- baseBorder → Color
-
final
- baseFill → Color
-
final
- blankFill → Color
-
final
- brightness → Brightness
-
Whether this palette is meant for a light or a dark surface.
final
- danger → Color
-
final
- darkBorder → Color
-
final
- darkerBorder → Color
-
final
- darkerFill → Color
-
final
- darkFill → Color
-
final
- disabledText → Color
-
final
- extraLightBorder → Color
-
final
- extraLightFill → Color
-
final
- fatal → Color
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- info → Color
-
final
- lightBorder → Color
-
final
- lighterBorder → Color
-
final
- lighterFill → Color
-
final
- lightFill → Color
-
final
- mask → Color
-
Colour of modal barriers behind dialogs and sheets.
final
- onSemantic → Color
-
The text colour that contrasts with a filled semantic surface.
no setter
- overlayBackground → Color
-
final
- pageBackground → Color
-
final
- placeholderText → Color
-
final
- primary → Color
-
final
- primaryText → Color
-
final
- regularText → Color
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- secondary → Color
-
final
- secondaryText → Color
-
final
- success → Color
-
final
- warning → Color
-
final
Methods
-
copyWith(
{Brightness? brightness, Color? primary, Color? secondary, Color? success, Color? warning, Color? info, Color? danger, Color? fatal, Color? primaryText, Color? regularText, Color? secondaryText, Color? placeholderText, Color? disabledText, Color? darkerBorder, Color? darkBorder, Color? baseBorder, Color? lightBorder, Color? lighterBorder, Color? extraLightBorder, Color? darkerFill, Color? darkFill, Color? baseFill, Color? lightFill, Color? lighterFill, Color? extraLightFill, Color? blankFill, Color? pageBackground, Color? baseBackground, Color? overlayBackground, Color? mask}) → WeColorScheme -
dark(
SemanticEnum type) → Color -
Available on WeColorScheme, provided by the WeColorShades extension
Mixestype's colour with black by0.2, the pressed colour of a filled button. -
darken(
Color color, [double amount = 0.2]) → Color -
Available on WeColorScheme, provided by the WeColorShades extension
Same as dark, for an arbitrarycolor. -
light(
SemanticEnum type, int level) → Color -
Available on WeColorScheme, provided by the WeColorShades extension
Mixestype's colour with the base background byleveltenths. -
lighten(
Color color, int level) → Color -
Available on WeColorScheme, provided by the WeColorShades extension
Same as light, for an arbitrarycolor. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
ramp(
SemanticEnum type) → List< Color> -
Available on WeColorScheme, provided by the WeColorShades extension
The Element Plus ramp fortypeas a list indexed by level. -
semantic(
SemanticEnum type) → Color -
Returns the colour that represents
type. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
lerp(
WeColorScheme a, WeColorScheme b, double t) → WeColorScheme - Linearly interpolates between two palettes.