From 5f0d2d01a50ec85813133fdf0f5e07f4b84b3f3b Mon Sep 17 00:00:00 2001 From: Corwin Date: Sun, 12 May 2024 20:15:18 +0100 Subject: [PATCH] got it the wrong way around --- website/agb/src/app/colour/colour.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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");