Skip to content

Commit

Permalink
don't rescale [0,255] to [0,1]
Browse files Browse the repository at this point in the history
  • Loading branch information
loucadufault committed Jan 6, 2022
1 parent 4a6804c commit 8137b91
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/color_from_uuid.js
Original file line number Diff line number Diff line change
Expand Up @@ -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")) {
Expand Down

0 comments on commit 8137b91

Please sign in to comment.