fromRgbInto
Convert sRGB (0-255) to a Color, writing into out (allocation-free). Bit-identical to fromRgb.
import { fromRgbInto } from '@pbroom/color-kit';into.ts:161function fromRgbInto( out: Color, , rgb: Rgb,): Color;Parameters
Returns
Colorout
Example
import { fromRgbInto, toCss } from '@pbroom/color-kit';
const color = { l: 0, c: 0, h: 0, alpha: 1 };
fromRgbInto(color, { r: 59, g: 130, b: 246, alpha: 1 });
toCss(color, 'oklch'); // → 'oklch(0.6231 0.188 259.81)'