spectrum library

spectrum header image

pub.dev Listing | API Doc | GitHub


This import is the all-in-one library and includes both colors and gradients.

For only the functionality of either modular portion of spectrum:

import 'package:spectrum/colors.dart';
import 'package:spectrum/gradients.dart';
Gradient API References: GradientUtils | GradientTween | Steps | FooShadedSteps | AnimatedGradient
Color API References: Shading | ColorOperators | ColorOperatorsMethods | Spectrum | SpectrumUtils
More: ColorArithmetic Shades | StopsArithmetic Maths | SwatchMode | GradientStoryboard | NillGradients | MaterialColorToList
🐸 Zaba.app ― simple packages, simple names.

Classes

AnimatedGradient
An AnimatedWidget that expects to be provided an initialized Listenable.
GradientPacket
If a list of colors and list of stops makes a PrimitiveGradient, does this GradientPacket constitute a supergradient?
GradientTween
An interpolation between two Gradients.
IntermediateGradient
A new IntermediateGradient can be resolved to a discrete form of Gradient during tweens.
LinearShadedSteps
Construct a new LinearShadedSteps that progresses from one color to the next in hard steps, each with its own intrinsic "shading," as opposed to smooth transitions by way of "quadruplicating" colors and stops.
LinearSteps
Construct a new LinearSteps that progresses from one color to the next in hard steps as opposed to smooth transitions by way of duplicating colors and stops.
Maths
A few options for functions that fulfill the StopsArithmetic definition.
PrimitiveGradient
The most basic representation of a gradient.
RadialShadedSteps
Construct a new RadialShadedSteps that progresses from one color to the next in hard steps, each with its own intrinsic "shading," as opposed to smooth transitions by way of "quadruplicating" colors and stops.
RadialSteps
Construct a new RadialSteps that progresses from one color to the next in hard steps as opposed to smooth transitions by way of duplicating colors and stops.
Shades
A few options for functions that fulfill the ColorArithmetic definition.
Spectrum
Abstract helper class for functionality provided by Spectrum.
Steps
These Steps work a little bit differently than standard Gradients.
SweepShadedSteps
Construct a new SweepShadedSteps that progresses from one color to the next in hard steps, each with its own intrinsic "shading," as opposed to smooth transitions by way of "quadruplicating" colors and stops.
SweepSteps
Construct a new SweepSteps that progresses from one color to the next in hard steps as opposed to smooth transitions by way of duplicating colors and stops.

Enums

GradientAnimation
Defines the options for a variety of transformations to apply to a Gradient in the process of making it an AnimatedGradient.
GradientProperty
Potential gradient properties for tweenage, notably excluding colors, stops, transform, & tileMode, as well as shadeFunction for FooShadedSteps.
SwatchMode
Describes the methods that may be employed to derive a range of Colors.

Extensions

ColorOperators on Color
ColorOperators extends Color with operators support.
ColorOperatorsMethods on Color
  • inverted, for returning -this
  • compareLuminance, for returning the brighter or darker Color utilizing >
  • or, for randomization by Color | List<Color>
  • GradientUtils on Gradient
    Offers copyWith method to make duplicate Gradients as well as global getters for any Gradient with specific fallbacks; reversed to easily return a Gradient with its colors reversed; and animate, as a shortcut to provide this Gradient as an AnimatedGradient's source and return the AnimatedGradient.observe output.
    LinearGradientUtils on LinearGradient
    Offers copyWith method to make duplicate Gradients.
    MaterialAccentToList on MaterialAccentColor
    Offers methods asList and toList to convert a MaterialAccentColor into a boiled-down List<Color>.
    MaterialColorToList on MaterialColor
    Offers methods asList and toList to convert a MaterialColor into a boiled-down List<Color>.
    NillGradients on Gradient
    A wrapper for retrieving transparent, empty Gradients appropriate for smooth GradientTweens.
    RadialGradientUtils on RadialGradient
    Offers copyWith method to make duplicate Gradients.
    Shading on Color
    SpectrumUtils on Color
    Spectrum-branded Color extension methods and getters, namely for the generation of complementary colors.
    SweepGradientUtils on SweepGradient
    Offers copyWith method to make duplicate Gradients.

    Typedefs

    ColorArithmetic = Color Function(Color color, double factor)
    A ColorArithmetic is a function that returns a Color after accepting and considering a Color and an double factor.
    GradientCopyWith = Gradient Function(Gradient gradient, {AlignmentGeometry? begin, AlignmentGeometry? center, List<Color>? colors, double? distance, AlignmentGeometry? end, double? endAngle, AlignmentGeometry? focal, double? focalRadius, double? radius, double? shadeFactor, ColorArithmetic? shadeFunction, double? softness, double? startAngle, List<double>? stops, TileMode? tileMode, GradientTransform? transform})
    Provision of a function type defintion for the purpose of allowing the override of this package's default copyWith() method.
    StopsArithmetic = double Function(double stop, double factor)
    A StopsArithmetic is a function that returns a double after accepting and considering a double stop and an double factor.