From 8137b91ab6b82ba884f92544be060f6a6fa61338 Mon Sep 17 00:00:00 2001 From: Louca Dufault <40028187+loucadufault@users.noreply.github.com> Date: Thu, 6 Jan 2022 04:54:18 -0500 Subject: [PATCH] don't rescale [0,255] to [0,1] --- src/color_from_uuid.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/color_from_uuid.js b/src/color_from_uuid.js index fea8ff5..571181d 100644 --- a/src/color_from_uuid.js +++ b/src/color_from_uuid.js @@ -29,9 +29,9 @@ export function colorFromUuid(uuid, options={}) { const encodedUuid = encoder.encode(uuid); const colorCode = encodedUuid % 0x1000000; - const red = (colorCode >> 16) / 256; - const green = ((colorCode >> 8) & 0xff) / 256; - const blue = (colorCode & 0xff) / 256; + const red = colorCode >> 16; + const green = (colorCode >> 8) & 0xff; + const blue = colorCode & 0xff; const receivers = {}; if (options.hasOwnProperty("receivers")) {