MCPcopy Create free account
hub / github.com/DavidHDev/react-bits / hexToRGB

Function hexToRGB

src/tailwind/Animations/SplashCursor/SplashCursor.jsx:883–890  ·  view source on GitHub ↗
(hex)

Source from the content-addressed store, hash-verified

881 }
882
883 function hexToRGB(hex) {
884 let val = hex.replace('#', '');
885 if (val.length === 3) val = val[0] + val[0] + val[1] + val[1] + val[2] + val[2];
886 const r = parseInt(val.slice(0, 2), 16) / 255;
887 const g = parseInt(val.slice(2, 4), 16) / 255;
888 const b = parseInt(val.slice(4, 6), 16) / 255;
889 return { r: r * 0.15, g: g * 0.15, b: b * 0.15 };
890 }
891
892 function generateColor() {
893 if (!config.RAINBOW_MODE) {

Callers 1

generateColorFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected