MCPcopy Create free account
hub / github.com/Rello/analytics / hexToRgb

Function hexToRgb

js/filter.js:2148–2156  ·  view source on GitHub ↗
(hex)

Source from the content-addressed store, hash-verified

2146
2147 // Convert HEX to RGB
2148 const hexToRgb = (hex) => {
2149 hex = hex.replace('#', '');
2150 let bigint = parseInt(hex, 16);
2151 return {
2152 r: (bigint >> 16) & 255, // Extract red value
2153 g: (bigint >> 8) & 255, // Extract green value
2154 b: bigint & 255, // Extract blue value
2155 };
2156 };
2157
2158 // Calculate brightness based on luminance formula
2159 const calculateBrightness = ({r, g, b}) => {

Callers 1

filter.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected