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

outdated

A Material Colors parsing library. Parse MaterialColor and MaterialAccentColor values with an optional indexed shade as well as black and white variants and even hex values.

A Material Colors parsing library.

The colors_parser package provides string parsing operations for MaterialColor and MaterialAccentColor values with an optional indexed shade as well as black and white variants and even hex values.

Installing #

Use pub to install this package. Add the following to your pubspec.yaml file.

dependencies:
  colors_parser: any

Then run pub install.

For more information, see the colors_parser package on pub.dev.

Using #

The colors_parser package was designed to be imported with a prefix, though you don't have to if you don't want to:

import 'package:colors_parser/colors_parser.dart' as cp;

The most common way to use the library is through the top-level functions. These parse Material Colors based on English language names. For example:

cp.parse('blue');

This calls the top-level parse() function to parse "blue" using English language names.

If you want to work with colors for a different language, you can create a ColorsParser and give it an explicit colors map:

var cpES = new cp.ColorsParser(colorsMap: ["azul", Colors.blue]);
cpES.parse('azul');

This will parse "azul" using the supplied Spanish language colors map.

0
likes
0
pub points
0%
popularity

Publisher

verified publisherjncsol.com

A Material Colors parsing library. Parse MaterialColor and MaterialAccentColor values with an optional indexed shade as well as black and white variants and even hex values.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on colors_parser