Skip to content

Commit

Permalink
HSL hacking
Browse files Browse the repository at this point in the history
  • Loading branch information
tomkennedy22 committed May 14, 2024
1 parent 5dd950f commit de523fb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/display.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,12 @@ const getSkinAccent = (skinColor: string): string => {
return skinColor;
}

hsl.l = Math.max(0, hsl.l * 0.85, hsl.l - 0.2);
let modifiedLVals: number[] = [hsl.l * 0.9, hsl.l ** 2, (1 - hsl.l) * 1.25];
let lFurthestFromHalf: number[] = modifiedLVals.sort(
(a, b) => Math.abs(b - 0.5) - Math.abs(a - 0.5),
);

hsl.l = lFurthestFromHalf[0] as number;
return rgbToHex(hslToRgb(hsl));
};

Expand Down

0 comments on commit de523fb

Please sign in to comment.