Skip to content

Commit

Permalink
make activity chart more pleasing to look at
Browse files Browse the repository at this point in the history
  • Loading branch information
TsFreddie committed Jan 7, 2025
1 parent 61d6cbb commit b15385b
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/routes/ddnet/p/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@
let explaination = $state(false);
const hoursToColor = (value: number) => {
const weight = (24 - value) / 24;
const h = Math.floor(weight * 240);
const s = Math.floor(70 + (1.0 - weight) * 30);
const l = Math.floor(40 + (1.0 - weight) * 10);
return `hsl(${h}deg, ${s}%, ${l}%)`;
const weight = value / 24;
const h = Math.round((1.0 - weight) * 200);
const s = Math.round(70 + weight * 30);
const l = Math.round(40 + weight * 10);
const a = Math.min(weight / 0.2, 1);
return `hsl(${h}deg, ${s}%, ${l}%, ${a})`;
};
afterNavigate(() => {
Expand Down

0 comments on commit b15385b

Please sign in to comment.