Function
parseRgba
({ r, g, b, a = 1 }: InputObject)
Source from the content-addressed store, hash-verified
| 17 | }); |
| 18 | |
| 19 | export const parseRgba = ({ r, g, b, a = 1 }: InputObject): RgbaColor | null => { |
| 20 | if (!isPresent(r) || !isPresent(g) || !isPresent(b)) return null; |
| 21 | |
| 22 | return clampRgba({ |
| 23 | r: Number(r), |
| 24 | g: Number(g), |
| 25 | b: Number(b), |
| 26 | a: Number(a), |
| 27 | }); |
| 28 | }; |
| 29 | |
| 30 | /** |
| 31 | * Converts an RGB channel [0-255] to its linear light (un-companded) form [0-1]. |
Callers
nothing calls this directly
Tested by
no test coverage detected
Used in the wild real call sites across dependent graphs
searching dependent graphs…