ColorExtension extension

Extension methods to help dealing with colors.

on

Properties

colorValue → int

Available on Color, provided by the ColorExtension extension

Get the color value as an integer.
no setter

Methods

basedOnLuminance({Color darkColor = Colors.black, Color lightColor = Colors.white}) → Color

Available on Color, provided by the ColorExtension extension

Get a constrast color based on the luminance of this color. If the luminance is bigger than 0.5, darkColor is used, otherwise lightColor is used.
lerpWith(Color color, double t) → Color

Available on Color, provided by the ColorExtension extension

Lerp this color with another color.
toAccentColor({double darkestFactor = 0.38, double darkerFactor = 0.30, double darkFactor = 0.15, double lightFactor = 0.15, double lighterFactor = 0.30, double lightestFactor = 0.38}) → AccentColor

Available on Color, provided by the ColorExtension extension

Creates a new accent color based on this color. This provides the shades by lerping this color with Colors.black if dark or darker, and with Colors.white if light or lighter.