MCPcopy Create free account
hub / github.com/PenguLoader/PenguLoader / parseHexColor

Function parseHexColor

plugins/src/preload/api/Effect.ts:52–72  ·  view source on GitHub ↗
(color: string)

Source from the content-addressed store, hash-verified

50}
51
52function parseHexColor(color: string): number {
53 if (typeof color === 'string') {
54 if (color.startsWith('#')) {
55 let hex = color.slice(1)
56 let size = hex.length
57 let i = 0, step = size > 4 ? 1 : 0
58
59 let r = parseInt(hex[i] + hex[i += step], 16);
60 let g = parseInt(hex[++i] + hex[i += step], 16)
61 let b = parseInt(hex[++i] + hex[i += step], 16)
62 let a = 255
63
64 if (size === 4 || size === 8) {
65 a = parseInt(hex[++i] + hex[i += step], 16)
66 }
67
68 return ((a << 24) | (b << 16) | (g << 8) | r) >>> 0
69 }
70 }
71 return 0
72}
73
74function applyWindowEffectMac(name: EffectName, options) {
75 if (name === 'vibrancy') {

Callers 1

applyWindowEffectWinFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected