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

Function hexToRgb

js/filter.js:3289–3297  ·  view source on GitHub ↗
(hex)

Source from the content-addressed store, hash-verified

3287
3288 // Convert HEX to RGB
3289 const hexToRgb = (hex) => {
3290 hex = hex.replace('#', '');
3291 let bigint = parseInt(hex, 16);
3292 return {
3293 r: (bigint >> 16) & 255, // Extract red value
3294 g: (bigint >> 8) & 255, // Extract green value
3295 b: bigint & 255, // Extract blue value
3296 };
3297 };
3298
3299 // Calculate brightness based on luminance formula
3300 const calculateBrightness = ({r, g, b}) => {

Callers 1

filter.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected