AppColors class

Flexible color configuration for neumorphic design.

All colors can be set individually or auto-derived from background.

Quick setup:

// Set background, rest auto-derives
AppColors.mainColor = Color(0xFFE0E5EC);

// Or configure multiple at once
AppColors.configure(
  backgroundColor: myBgColor,
  accent: Colors.pink,
);

// Or use dark/light mode preset
AppColors.switchColorMode(true);

Full control:

AppColors.mainColor = myBackground;
AppColors.textColor = myTextColor;
AppColors.lightShadowColor = myLightShadow;
AppColors.darkShadowColor = myDarkShadow;
AppColors.accentColor = myAccent;

Reset to defaults:

AppColors.reset(); // clears all overrides

Constructors

AppColors()

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 Properties

accentColor Color
Primary accent color for highlights.
getter/setter pair
altAccentColor Color
Secondary accent color for gradients.
getter/setter pair
darkShadowColor Color
Dark shadow color. Auto-computed if not set.
getter/setter pair
lightShadowColor Color
Light shadow color. Auto-computed if not set.
getter/setter pair
mainColor Color
The main background color. Setting this recalculates shadow/text defaults (unless overridden).
getter/setter pair
mainGradient Gradient
Gradient from accent to alt accent color
no setter
reversedGradient Gradient
Gradient from alt accent to accent color
no setter
reversedShadowGradient Gradient
Reversed gradient for shadow effects (dark to light)
no setter
shadowGradient Gradient
Gradient for shadow effects (light to dark)
no setter
textColor Color
Text color. Auto-computed for contrast if not set.
getter/setter pair

Static Methods

configure({Color? backgroundColor, Color? text, Color? lightShadow, Color? darkShadow, Color? accent, Color? altAccent}) → void
Configure multiple colors at once.
currentInnerShadows({double blurMultiplier = 1.0, double offsetMultiplier = 1.0}) List<Shadow>
Generates inner shadows with configurable intensity
currentShadows({double blurMultiplier = 1.0, double offsetMultiplier = 1.0}) List<Shadow>
Generates outer shadows with configurable intensity
reset() → void
Resets all colors to defaults.
switchColorMode(bool darkMode) → void
Switches to light or dark mode preset.