ColorService class
Domain layer service for color manipulation operations.
Constructors
- ColorService()
-
factory
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
-
adjustLightness(
{required Color color, double amount = defaultAmount, bool darken = false}) → Color - Adjusts the lightness of a color.
-
createMaterialColor(
Color color) → MaterialColor - Creates a MaterialColor from a base Color by generating a swatch of shades.
-
getContrastText(
Color color) → Color - Gets a contrasting text color (white or black) for readability.
-
isDark(
Color color) → bool - Determines if a color is dark based on its luminance.
-
isLight(
Color color) → bool - Determines if a color is light based on its luminance.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toHex(
Color color, {bool withHashSign = true}) → String - Converts a color to a hex string.
-
toString(
) → String -
A string representation of this object.
inherited
-
withAlphaOpacity(
Color color, double opacity) → Color - Creates a color with the specified opacity.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- defaultAmount → const double
- Default amount for lightness adjustment.