MCPcopy Create free account
hub / github.com/TheOrcDev/github-creature / hexToRgb

Function hexToRgb

components/plasma.tsx:15–23  ·  view source on GitHub ↗
(hex: string)

Source from the content-addressed store, hash-verified

13}
14
15const hexToRgb = (hex: string): [number, number, number] => {
16 const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
17 if (!result) return [1, 0.5, 0.2];
18 return [
19 parseInt(result[1], 16) / 255,
20 parseInt(result[2], 16) / 255,
21 parseInt(result[3], 16) / 255,
22 ];
23};
24
25const vertex = `#version 300 es
26precision highp float;

Callers 1

PlasmaFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected