colors library Null safety

Offers Color operators & operator exposure methods, shading methods Color.withBlack() and withWhite(), and Spectrum color utilities such as complementary colors or MaterialColor generation.


This import is a module library for package:spectrum.

For gradients functionality:

import 'package:spectrum/gradients.dart';

Or for the all-in-one library:

import 'package:spectrum/spectrum.dart';
Color API References: Shading | ColorOperators | ColorOperatorsMethods | Spectrum | SpectrumUtils
🐸 Zaba.app ― simple packages, simple names.

Classes

Spectrum
Abstract helper class for functionality provided by Spectrum. [...]

Extensions

ColorOperators
ColorOperators extends Color with operators support. [...]
ColorOperatorsMethods
  • inverted, for returning -this
  • compareLuminance, for returning the brighter or darker Color utilizing >
  • or, for randomization by Color | List<Color>
  • [...]
    MaterialAccentToList
    Offers methods asList and toList to convert a MaterialAccentColor into a boiled-down List<Color>.
    MaterialColorToList
    Offers methods asList and toList to convert a MaterialColor into a boiled-down List<Color>.
    Shading
    [...]
    SpectrumUtils
    Spectrum-branded Color extension methods and getters, namely for the generation of complementary colors.

    Enums

    SwatchMode
    Describes the methods that may be employed to derive a range of Colors.