FColors class - forui.theme library (original) (raw)

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.

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 anddisable methods. The opacity can be adjusted with enabledHoveredOpacity and disabledOpacity.

See FThemes for predefined themes and color schemes.

Constructors

FColors.new({required Brightness brightness, 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 enabledHoveredOpacity = 0.9, double disabledOpacity = 0.5})

Creates a FColors.

const

Methods

copyWith({Brightness? brightness, 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? enabledHoveredOpacity, 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 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 thehashCode.

inherited

transform(T function(T))→ T

Available on T, provided by the FTransformables extension

Transform this T using the given function.