UIColor.mappedValue()
Creates a lazily-evaluated mapped color or gradient value.
static mappedValue(
source: UIColor | UIColor.Gradient | UIColor.ColorName,
fn?: (
source: UIColor | UIColor.Gradient | UIColor.MappedValue,
) => UIColor | UIColor.Gradient | UIColor.MappedValue,
): UIColor.MappedValue;
Notes
- Use this to derive a value that may resolve to either a UIColor or UIColor.Gradient.
Parameters
- source — A color, gradient, or color name string to use as the source.
- fn — Optional transform function; if provided, equivalent to calling
.map(fn)on the result.
Return value
A UIColor.MappedValue instance.
Related
class UIColor
A class that represents a single color value.
