spectrum library
pub.dev Listing | API Doc | GitHub
A rainbow of Color
and Gradient
utilities. Interpolate intermediate
gradients with a realized GradientTween
. New gradient type Steps
as well as shaded varieties. Color generation & operators, and more!
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
🐸 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
Gradient
s. - IntermediateGradient
-
A
new IntermediateGradient
can be resolved to a discrete form of Gradient during tweens. - LinearShadedSteps
- 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 duplicating stops. - Maths
- A few options for functions that fulfill the StopsArithmetic definition.
- PrimitiveGradient
- The most basic representation of a gradient.
- RadialShadedSteps
- 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 duplicating 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 standardGradient
s. - SweepShadedSteps
- 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 duplicating 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 asshadeFunction
forFooShadedSteps
. - SwatchMode
- Describes the methods that may be employed to derive a range of Colors.
Extensions
- ColorOperators on Color
-
ColorOperators
extendsColor
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>
- inverted, for returning
- GradientUtils on Gradient
-
Offers copyWith method to make duplicate
Gradient
s as well as global getters for any Gradient with specific fallbacks; reversed to easily return aGradient
with its colors reversed; and animate, as a shortcut to providethis
Gradient as an AnimatedGradient's source and return the AnimatedGradient.observe output. - LinearGradientUtils on LinearGradient
-
Offers copyWith method to make duplicate
Gradient
s. - 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
Gradient
s appropriate for smoothGradientTween
s. - RadialGradientUtils on RadialGradient
-
Offers copyWith method to make duplicate
Gradient
s. - 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
Gradient
s.
Typedefs
- ColorArithmetic = Color Function(Color color, double factor)
-
A
ColorArithmetic
is a function that returns a Color after accepting and considering aColor
and andouble
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, num? 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 adouble
stop
and andouble
factor
.