MCPcopy
hub / github.com/omgovich/colord / parseRgba

Function parseRgba

src/colorModels/rgb.ts:19–28  ·  view source on GitHub ↗
({ r, g, b, a = 1 }: InputObject)

Source from the content-addressed store, hash-verified

17});
18
19export 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

Calls 2

isPresentFunction · 0.90
clampRgbaFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…