3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-18 15:00:00 +00:00
zeppelin/backend/src/utils/intToRgb.ts

7 lines
187 B
TypeScript
Raw Normal View History

export function intToRgb(int: number): [number, number, number] {
const r = int >> 16;
const g = (int - (r << 16)) >> 8;
const b = int - (r << 16) - (g << 8);
return [r, g, b];
}