colors_stuff 0.0.1+1 copy "colors_stuff: ^0.0.1+1" to clipboard
colors_stuff: ^0.0.1+1 copied to clipboard

A library that provides useful functions for working with colors.

example/example.md

Example #

Usage of the various helpers provided by the library.

var color = randomColor(); // Generates a random color
var isDark = isColorDark(color); // Returns true if the color is dark

var lightColor = lightenColor(color, 0.2); // Lightens the color by 50%
var darkColor = darkenColor(color); // Darkens the color (by 10% default)

var reducedAlphaColor = reduceAlpha(color); // Reduces the alpha (by 10% default)
var increasedAlphaColor = increaseAlpha(color, 0.5); // Increases the alpha by 50%

Example of ColorSet usage.

var set = ColorSet.ofSomeRandomColor(); // Generates a set with random background color.
...
// Now some where in your UI logic, you have a card on which you have some text.
// You can use the set colors easily to style the card.
Card(
    color: set.backgroundColor,
    child: Padding(
        padding: EdgeInsets.all(24),
        child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        mainAxisAlignment: MainAxisAlignment.start,
        children: [
            Text(
                "Title",
                style: TextStyle(
                    color: set.foregroundColor),
            ),
            SizedBox(height: 16),
            Text(
                "Some descriptive text",
                style: TextStyle(
                color: set.mutedForegroundColor),
            ),
        ],
        ),
    ),
),
1
likes
110
pub points
1%
popularity

Publisher

unverified uploader

A library that provides useful functions for working with colors.

Repository (GitHub)
View/report issues

Documentation

API reference

License

Apache-2.0 (LICENSE)

Dependencies

flutter

More

Packages that depend on colors_stuff