FColors class final
The color tokens.
The main color groups in this scheme are primary, secondary, muted, destructive, and error.
- Primary colors are used for key widgets across the UI.
- Secondary colors are used for less prominent widgets.
- Mute colors are typically used for disabled widgets.
- Destructive colors are used for destructive actions such as "Delete" buttons.
- Error colors are typically used to highlight errors, such as invalid input in text-fields.
Each color group includes a -Foreground suffixed color, i.e. primaryForeground, used to color text and other
visual elements on top of their respective background colors.
Hovered colors are derived by adjusting the lightness of the original color. To derive these colors, use the hover method. The lightness can be adjusted with hoverLighten.
Disabled colors are derived by adjusting the opacity. To derive these colors, use the disable method. The opacity can be adjusted with disabledOpacity.
See FThemes for predefined themes and color schemes.
- Mixed-in types
Constructors
- FColors({required Brightness brightness, required SystemUiOverlayStyle systemOverlayStyle, required Color barrier, required Color background, required Color foreground, required Color primary, required Color primaryForeground, required Color secondary, required Color secondaryForeground, required Color muted, required Color mutedForeground, required Color destructive, required Color destructiveForeground, required Color error, required Color errorForeground, required Color card, required Color border, double hoverLighten = 0.075, double hoverDarken = 0.05, double disabledOpacity = 0.5})
-
Creates a FColors.
const
- FColors.lerp(FColors a, FColors b, double t)
-
Creates a linear interpolation between two FColors using the given factor
t.factory
Properties
- background → Color
-
The background color.
final
- barrier → Color
-
The barrier color.
final
- border → Color
-
The border color.
final
- brightness → Brightness
-
The system brightness.
final
- card → Color
-
The card color.
final
- destructive → Color
-
The destructive color.
final
- destructiveForeground → Color
-
The destructive foreground color.
final
- disabledOpacity → double
-
The factor by which to multiply a color's opacity when a widget is disabled. Defaults to 0.5.
final
- error → Color
-
The error color.
final
- errorForeground → Color
-
The error foreground color.
final
- foreground → Color
-
The foreground color.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- hoverDarken → double
-
The percentage to darken light colors by. A higher value will result in a more pronounced darkening effect.
final
- hoverLighten → double
-
The percentage to lighten dark colors by. A higher value will result in a more pronounced lightening effect.
final
- muted → Color
-
The muted color.
final
- mutedForeground → Color
-
The muted foreground color.
final
- primary → Color
-
The primary color.
final
- primaryForeground → Color
-
The primary foreground color.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- secondary → Color
-
The secondary color.
final
- secondaryForeground → Color
-
The secondary foreground color.
final
- systemOverlayStyle → SystemUiOverlayStyle
-
The system overlay style.
final
Methods
-
copyWith(
{Brightness? brightness, SystemUiOverlayStyle? systemOverlayStyle, Color? barrier, Color? background, Color? foreground, Color? primary, Color? primaryForeground, Color? secondary, Color? secondaryForeground, Color? muted, Color? mutedForeground, Color? destructive, Color? destructiveForeground, Color? error, Color? errorForeground, Color? card, Color? border, double? hoverLighten, double? hoverDarken, double? disabledOpacity}) → FColors - Returns a copy of this FColors with the given properties replaced.
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
override
-
disable(
Color color, [Color? background]) → Color -
Returns a disabled variant of the
colorby multiplying its opacity by disabledOpacity. -
hover(
Color color) → Color -
Generates a hovered variant of the given
colorby darkening light colors and lighting dark colors based on their HSL lightness. -
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
Constants
- blueDark → const FColors
- The Blue dark color scheme.
- blueLight → const FColors
- The Blue light color scheme.
- greenDark → const FColors
- The Green dark color scheme.
- greenLight → const FColors
- The Green light color scheme.
- neutralDark → const FColors
- The Neutral dark color scheme.
- neutralLight → const FColors
- The Neutral light color scheme.
- orangeDark → const FColors
- The Orange dark color scheme.
- orangeLight → const FColors
- The Orange light color scheme.
- redDark → const FColors
- The Red dark color scheme.
- redLight → const FColors
- The Red light color scheme.
- roseDark → const FColors
- The Rose dark color scheme.
- roseLight → const FColors
- The Rose light color scheme.
- slateDark → const FColors
- The Slate dark color scheme.
- slateLight → const FColors
- The Slate light color scheme.
- violetDark → const FColors
- The Violet dark color scheme.
- violetLight → const FColors
- The Violet light color scheme.
- yellowDark → const FColors
- The Yellow dark color scheme.
- yellowLight → const FColors
- The Yellow light color scheme.
- zincDark → const FColors
- The Zinc dark color scheme.
- zincLight → const FColors
- The Zinc light color scheme.