mirror of
https://github.com/RoboSats/robosats.git
synced 2025-08-03 17:00:19 +00:00

* Add SVG icons for map pins * Add federation basis and new coordinator form (#793) * Add new coordinator entry issue form * Add Federation basis * Fix eslint errors from F2F and fix languages * Redo eslint @typescript-eslint/strict-boolean-expressions * Robot Page working * Contexts Working * Garage Working * CurrentOrder working * Federation model working --------- Co-authored-by: Reckless_Satoshi <reckless.satoshi@protonmail.com> Co-authored-by: Reckless_Satoshi <90936742+Reckless-Satoshi@users.noreply.github.com>
14 lines
403 B
TypeScript
14 lines
403 B
TypeScript
export default function hexToRgb(c: string): string[] | undefined {
|
|
if (c.includes('rgb')) {
|
|
const vals = c.split('(')[1].split(')')[0];
|
|
return vals.split(',');
|
|
}
|
|
if (/^#([a-f0-9]{3}){1,2}$/.test(c)) {
|
|
if (c.length === 4) {
|
|
c = '#' + [c[1], c[1], c[2], c[2], c[3], c[3]].join('');
|
|
}
|
|
c = '0x' + c.substring(1);
|
|
return [(c >> 16) & 255, (c >> 8) & 255, c & 255];
|
|
}
|
|
}
|