FColors class final

A set of colors that is part of a FThemeData. It is used to configure the color properties of Forui widgets.

These properties are not used directly by Forui widgets. Instead, they are the defaults for the corresponding colors of widget styles configured via inherit(...) constructors.

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.new({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 border, double hoverLighten = 0.075, double hoverDarken = 0.05, double disabledOpacity = 0.5})
Creates a FColors.
const

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
destructive Color
The destructive color.
final
destructiveForeground Color
The destructive foreground color.
final
disabledOpacity double
The opacity of the foreground color 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? 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 foreground, [Color? background]) Color
Returns a disabled color for the foreground on the background.
hover(Color color) Color
Generates a hovered variant of the given color by 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