class MappedValue
A class that represents a derived color or gradient value.
class MappedValue;
Notes
- Use UIColor.mappedValue() to create instances of this class.
- Use map() to derive a new instance from the resolved value.
- Results are cached and invalidated when the color registry changes (e.g. along with the theme).
Examples
UIColor.mappedValue("background", bg =>
UIColor.isBrightColor(bg as UIColor)
? UI.colors.white
: UIColor.linearGradient(180, darkGray, black)
)
Constructor
new UIColor.MappedValue()
Creates a new MappedValue instance.
Instance members
resolve()
Returns the resolved background value.map()
Returns a new MappedValue that transforms the resolved source value.
Related
class UIColor
A class that represents a single color value.
