extractColor
ColorPicker
stable
Converts an internal HSVA color value to the format expected by the consumer (string → hex, RGB object, HSL object, or HSV object), preserving alpha when appropriate.
API
Signature
Full TypeScript signature sourced from the util file.
API
Parameters
Input parameters accepted by this util.
- colorrequiredTHSVA
- The internal HSVA color value to convert. THSVA = { h: number, s: number, v: number, a?: number }.
- inputrequiredany
- The original input value passed to the color picker. Its type determines the output format: null/string → hex string; { r, g, b } → RGB object; { h, s, l } → HSL object; { h, s, v } → HSV object.
API
Return value
The value returned by this util.
- The color in the same format as the input. Alpha is stripped when the original input had no alpha channel and the alpha value is 1.
Usage
Examples
Ready-to-paste usage snippets.
Extract to hex vs RGB object