mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-23 08:11:33 +11:00
got it the wrong way around
This commit is contained in:
parent
bdc799af36
commit
5f0d2d01a5
|
@ -18,14 +18,14 @@ function fromHex(hex: string): Colour {
|
|||
const c = parseInt(hex, 16);
|
||||
|
||||
return {
|
||||
r: c & 255,
|
||||
r: (c >> 16) & 255,
|
||||
g: (c >> 8) & 255,
|
||||
b: (c >> 16) & 255,
|
||||
b: c & 255,
|
||||
};
|
||||
}
|
||||
|
||||
function toHex(colour: Colour): string {
|
||||
const hex = (colour.r | (colour.g << 8) | (colour.b << 16))
|
||||
const hex = ((colour.r << 16) | (colour.g << 8) | colour.b)
|
||||
.toString(16)
|
||||
.padStart(6, "0");
|
||||
|
||||
|
|
Loading…
Reference in a new issue