YaruColorExtension extension

Set of useful methods when working with Color

on

Methods

adjust({double alpha = 0.0, double hue = 0.0, double saturation = 0.0, double lightness = 0.0}) Color
Adjust color attributes by the given values. alpha, saturation and lightness values must be clamped between -1.0 and 1.0 hue value must be clamped between -360.0 and 360.0
cap({double alpha = 1.0, double saturation = 1.0, double lightness = 1.0}) Color
capDown({double alpha = 0.0, double saturation = 0.0, double lightness = 0.0}) Color
copyWith({double? alpha, double? hue, double? saturation, double? lightness}) Color
Return a copy of this color with attributes replaced by given values. alpha, saturation and lightness values must be clamped between 0.0 and 1.0 hue value must be clamped between 0.0 and 360.0
scale({double alpha = 0.0, double hue = 0.0, double saturation = 0.0, double lightness = 0.0}) Color
Scale color attributes relatively to current ones. alpha, hue, saturation and lightness values must be clamped between -1.0 and 1.0
toHex() String
Returns a hex representation (#AARRGGBB) of the color.