flutter_colorpicker/utils library

Common function lib

Constants

kCompleteValidHexPattern → const String
RegExp pattern for validation complete HEX color String, allows only:
kValidHexPattern → const String
RegExp pattern for validation HEX color String inputs, allows only:

Functions

colorFromHex(String inputString, {bool enableAlpha = true}) Color?
Try to convert text input or any String to valid Color. The String must be provided in one of those formats:
colorToHex(Color color, {bool includeHashSign = false, bool enableAlpha = true, bool toUpperCase = true}) String
Converts dart:ui Color to the 6/8 digits HEX String.
hslToHsv(HSLColor color) HSVColor
Convert HSL to HSV
hsvToHsl(HSVColor color) HSLColor
Convert HSV to HSL
useWhiteForeground(Color backgroundColor, {double bias = 0.0}) bool
Check if is good condition to use white foreground color by passing the background color, and optional bias.