color
Normalizes a color to a RGB(A) value.
Signature
color(input: string | undefined, operations?: (color: IColorOperations) => void): string
Parameters
Name | Type | Optional | Description |
---|---|---|---|
input | string | No | Specifies the input color (can be a hex, rgb, hsl or color name). |
operations | (color: IColorOperations ) => void | Yes | Optional operations to perform. |
Return value
Returns the color as a RGB(A) value.
Example
import { color } from "@tripetto/runner-fabric/color";
// Returns `rgb(255,0,0)`
color("red");
// Returns `rgb(0,0,0)`
color("blue", (color) => color.makeBlackOrWhite());