This commit is contained in:
Lani Aung
2025-06-07 16:45:53 -07:00
parent aa58a30b6d
commit 660dd859d1
4 changed files with 63 additions and 25 deletions
+7
View File
@@ -49,4 +49,11 @@ export default class RGB {
return new RGB((red + match) * 255, (green + match) * 255, (blue + match) * 255)
}
public static fromHex(color: number): RGB {
const red = color >> 16
const green = (color - (red << 16)) >> 8
const blue = color - (red << 16) - (green << 8)
return new RGB(red, green, blue)
}
}