FColorScheme 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 and disabled colors are derived by adjusting the opacity. To derive these colors, use the hover and disable methods. The opacity can be adjusted with enabledHoveredOpacity and disabledOpacity.

See FThemes for predefined themes and color schemes.

Mixed-in types

Constructors

FColorScheme({required Brightness brightness, 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 enabledHoveredOpacity = 0.9, double disabledOpacity = 0.5})
Creates a FColorScheme.
const

Properties

background Color
The background 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
enabledHoveredOpacity double
The opacity of the foreground color when a widget is hovered and enabled. Defaults to 0.9.
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
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

Methods

copyWith({Brightness? brightness, 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? enabledHoveredOpacity, double? disabledOpacity}) FColorScheme
Returns a copy of this FColorScheme 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 foreground, [Color? background]) Color
Returns a hovered color for the foreground on the background.
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