colors_stuff library

Functions

darkenColor(Color color, {double amount = 0.1}) Color
Returns a darker version of the given color. The amount of darkening is specified by the amount parameter. The default value of the amount is 0.1.
getOnSurfaceColor(Color surfaceColor, {Color colorIfDark = Colors.white, Color colorIfLight = Colors.black}) Color
Returns a color that would be suitable to be drawn on a surface whose color is the given surfaceColor. If the surface color is dark, then the returned color will be light, otherwise it will be dark. By default, white color will be returned if the surface color is dark, and black color will be returned if the surface color is light.
increaseAlpha(Color color, {double amount = 0.1}) Color
Increases the alpha of the given color by the given amount.
isColorDark(Color color, {double assertionFactor = 0.5}) bool
Checks if the given color is dark. This is done by checking if the luminance of the color is less than the assertionFactor or not. The default value for the assertionFactor is 0.5.
isColorLight(Color color, {double assertionFactor = 0.5}) bool
Checks if the given color is light. This is done by checking if the luminance of the color is greater than the assertionFactor or not. The default value for the assertionFactor is 0.5.
lightenColor(Color color, {double amount = 0.1}) Color
Returns a lighter version of the given color. The amount of lightening is specified by the amount parameter. The default value of the amount is 0.1.
randomColor() Color
Returns a random color.
randomDarkColor({int mode = -1}) Color
Returns a random dark color. The mode can be optionally specified, which has to be either 1 (for one-primary) or 2 (for two-primary). Any other value will result in a random mode.
randomLightColor({int mode = -1}) Color
Returns a random light color. The mode can be optionally specified, which has to be either 1 (for one-primary) or 2 (for two-primary). Any other value will result in a random mode.
reduceAlpha(Color color, {double amount = 0.1}) Color
Decreases the alpha of the given color by the given amount.