faabul_color_conversion 1.0.0 copy "faabul_color_conversion: ^1.0.0" to clipboard
faabul_color_conversion: ^1.0.0 copied to clipboard

Flutter extensions on String to parse web colors and on Color to produce web color String.

faabul_color_conversion #

faabul_color_conversion is used by Faabul Color Picker package and developed by Faabul Live Quizzes.

Getting Started #

To convert Color to String, call asWebColor() on the Color object:

final color = Colors.teal;
final hex = color.asWebColor();

To parse a String to Color, call parseAsColor() on the String object:

final color = '#8D3B72'.parseAsColor();

String can be either RRGGBB or AARRGGBB format, case insensitive.

parseAsColor() method will throw FormatException if the string is not a valid color. For convenience, you can use tryParseAsColor() method instead, which will return null if the string is not a valid color:

final color = '#INVALID'.tryParseAsColor(); // null
0
likes
150
pub points
5%
popularity

Publisher

verified publisherfaabul.com

Flutter extensions on String to parse web colors and on Color to produce web color String.

Homepage
Repository (GitHub)
View/report issues

Topics

#color #parser #extension

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on faabul_color_conversion