ColorUtil extension Null safety

on

Methods

addOpacity([double value = 0.5]) Color
Makes the current color more transparent, by the given value, from 0 (total transparency) to 1 (no change). If value is not provided, it will be 0.5 (50% change). If value is less than 0, it's 0. If more than 1, it's 1. Makes it more transparent if percent < 1.
average(Color color, [double value = 0.5]) Color
Makes the current color more similar to the given color, by the given value, from 0 (no change) to 1 (equal to color). If value is not provided, it will be 0.5 (50% change). If value is less than 0, it's 0. If more than 1, it's 1. Doesn't change the opacity.
darker([double value = 0.5]) Color
Makes the color darker (more black), by the given value, from 0 (no change) to 1 (black). If value is not provided, it will be 0.5 (50% change). If value is less than 0, it's 0. If more than 1, it's 1. Doesn't change the opacity.
decolorize([double value = 1]) Color
Makes the current color more grey (aprox. keeping its luminance), by the given value, from 0 (no change) to 1 (grey). If value is not provided, it will be 1 (100% change, no color at all). If value is less than 0, it's 0. If more than 1, it's 1. Doesn't change the opacity.
lighter([double value = 0.5]) Color
Makes the color lighter (more white), by the given value, from 0 (no change) to 1 (white). If value is not provided, it will be 0.5 (50% change). If value is less than 0, it's 0. If more than 1, it's 1. Doesn't change the opacity.

Static Methods

abgrToArgb(int argbColor) int
Converts the ABGR color representation to ARGB.
rgbaToArgb(int rgbaColor) int
Converts the RGBA color representation to ARGB.