FxColor class abstract
Custom color palette for easy access to predefined color options. This abstract class provides a set of static color constants for consistent theming across the application.
It also includes utility methods for color manipulation, accessibility checks, and Material 3 support.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
contrastColor(
Color color, {double threshold = 0.5}) → Color - Returns either black or white depending on which provides better contrast with the given color.
-
contrastRatio(
Color color1, Color color2) → double - Calculates the contrast ratio between two colors according to WCAG guidelines.
-
darken(
Color color, double amount) → Color - Returns a darker version of the given color.
-
generateMaterial3ColorScheme(
Color seedColor, {Brightness brightness = Brightness.light}) → ColorScheme - Generates a color palette based on Material 3 color system from a seed color.
-
isAccessible(
Color foreground, Color background, {bool isLargeText = false}) → bool - Checks if the contrast between two colors meets WCAG AA standards.
-
lighten(
Color color, double amount) → Color - Returns a lighter version of the given color.
-
withAlpha(
Color color, double alpha) → Color - Returns a color with modified alpha value.
Constants
- amber50 → const Color
- A set of amber scale colors from lightest to darkest. These can be used for warning states or amber-themed elements.
- amber100 → const Color
- amber200 → const Color
- amber300 → const Color
- amber400 → const Color
- amber500 → const Color
- amber600 → const Color
- amber700 → const Color
- amber800 → const Color
- amber900 → const Color
- black → const Color
- Pure black color.
- blue50 → const Color
- A set of blue scale colors from lightest to darkest. These can be used for informational states or blue-themed elements.
- blue100 → const Color
- blue200 → const Color
- blue300 → const Color
- blue400 → const Color
- blue500 → const Color
- blue600 → const Color
- blue700 → const Color
- blue800 → const Color
- blue900 → const Color
- danger → const Color
- The color used to indicate errors or dangerous actions.
- dark → const Color
- A dark color, typically used for text or dark-themed elements.
- gray50 → const Color
- A set of gray scale colors from lightest to darkest. These can be used for various UI elements requiring different shades of gray.
- gray100 → const Color
- gray200 → const Color
- gray300 → const Color
- gray400 → const Color
- gray500 → const Color
- gray600 → const Color
- gray700 → const Color
- gray800 → const Color
- gray900 → const Color
- green50 → const Color
- A set of green scale colors from lightest to darkest. These can be used for success states or green-themed elements.
- green100 → const Color
- green200 → const Color
- green300 → const Color
- green400 → const Color
- green500 → const Color
- green600 → const Color
- green700 → const Color
- green800 → const Color
- green900 → const Color
- info → const Color
- The color used for informational elements or neutral states.
- kcDangerLight → const Color
- A lighter shade of the danger color, used for backgrounds or subtle errors.
- kcDisabled → const Color
- The color used for disabled elements or text.
- kcLabel → const Color
- The color used for labels or secondary text.
- kcSuccessLight → const Color
- A lighter shade of the success color, used for backgrounds or subtle success indicators.
- kcText → const Color
- The primary text color used in the application.
- kcTextField → const Color
- The background color used for text fields.
- kcWarningLight → const Color
- A lighter shade of the warning color, used for backgrounds or subtle warnings.
- light → const Color
- A light color, typically used for backgrounds or light-themed elements.
- neutral50 → const Color
- A set of neutral scale colors from lightest to darkest. These provide a range of neutral tones for UI elements.
- neutral100 → const Color
- neutral200 → const Color
- neutral300 → const Color
- neutral400 → const Color
- neutral500 → const Color
- neutral600 → const Color
- neutral700 → const Color
- neutral800 → const Color
- neutral900 → const Color
- primary → const Color
- The primary color of the application. Used for key UI elements and primary actions.
- red50 → const Color
- A set of red scale colors from lightest to darkest. These can be used for error states or red-themed elements.
- red100 → const Color
- red200 → const Color
- red300 → const Color
- red400 → const Color
- red500 → const Color
- red600 → const Color
- red700 → const Color
- red800 → const Color
- red900 → const Color
- secondary → const Color
- The secondary color of the application. Used for complementary UI elements and secondary actions.
- success → const Color
- The color used to indicate successful actions or positive states.
- surfaceTint → const Color
- Material 3 surface tint color for elevation effects
- transparent → const Color
- Fully transparent color.
- violet50 → const Color
- A set of violet scale colors from lightest to darkest. These can be used for accent states or violet-themed elements.
- violet100 → const Color
- violet200 → const Color
- violet300 → const Color
- violet400 → const Color
- violet500 → const Color
- violet600 → const Color
- violet700 → const Color
- violet800 → const Color
- violet900 → const Color
- warning → const Color
- The color used to indicate warnings or caution states.
- white → const Color
- Pure white color.