diff --git a/website/agb/src/app/colour/colour.tsx b/website/agb/src/app/colour/colour.tsx index 6a0af1ba..417475b1 100644 --- a/website/agb/src/app/colour/colour.tsx +++ b/website/agb/src/app/colour/colour.tsx @@ -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");