gradients library
Offers an AnimatedGradient specification driven by an instantiated
Listenable (more like FooTransition than an AnimatedFoo).
Also provides Steps and ShadedSteps type gradients.
Gradient utilities include copyWith() many potential properties for a
variety of types, but also a GradientCopyWith template to override the
default in this library, as well as other extension methods.
NillGradients is an extension that maintains the concept of nillify()ing
a gradient.
Finally, the origin of package:spectrum, the realized GradientTween,
not just by Gradient.lerp, but by bespoke IntermediateGradients.
This import is a module library for package:spectrum.
For colors functionality:
import 'package:spectrum/colors.dart';
Or for the all-in-one library:
import 'package:spectrum/spectrum.dart';
Gradient API References: GradientUtils | GradientTween | Steps | FooShadedSteps | AnimatedGradient
🐸 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 IntermediateGradientcan be resolved to a discrete form of Gradient during tweens. - LinearShadedSteps
-
Construct a
new LinearShadedStepsthat 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 LinearStepsthat 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 RadialShadedStepsthat 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 RadialStepsthat 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.
- Steps
-
These
Stepswork a little bit differently than standardGradients. - SweepShadedSteps
-
Construct a
new SweepShadedStepsthat 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 SweepStepsthat 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
Gradientin the process of making it an AnimatedGradient. - GradientProperty
-
Potential gradient properties for tweenage, notably excluding
colors,stops,transform, &tileMode, as well asshadeFunctionforFooShadedSteps.
Extensions
- 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 aGradientwith its colors reversed; and animate, as a shortcut to providethisGradient as an AnimatedGradient's source and return the AnimatedGradient.observe output. - LinearGradientUtils on LinearGradient
-
Offers copyWith method to make duplicate
Gradients. - NillGradients on Gradient
-
A wrapper for retrieving transparent, empty
Gradients appropriate for smoothGradientTweens. - RadialGradientUtils on RadialGradient
-
Offers copyWith method to make duplicate
Gradients. - SweepGradientUtils on SweepGradient
-
Offers copyWith method to make duplicate
Gradients.
Typedefs
- ColorArithmetic = Color Function(Color color, double factor)
-
A
ColorArithmeticis a function that returns a Color after accepting and considering aColorand andoublefactor. -
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
StopsArithmeticis a function that returns a double after accepting and considering adoublestopand andoublefactor.