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

Function hexToRgb

js/filter.js:3286–3294  ·  view source on GitHub ↗
(hex)

Source from the content-addressed store, hash-verified

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

Callers 1

filter.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected