Skip to content

Commit 799812b

Browse files
committed
comment utils, remove lighten (unused)
1 parent d377da5 commit 799812b

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

wormhole-connect/src/utils/theme.ts

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// This code was written by Claude <3
22

3+
// Mixes two hsl colors using a ratio
34
export function mixHsl(
45
hsl1: [number, number, number],
56
hsl2: [number, number, number],
@@ -12,6 +13,7 @@ export function mixHsl(
1213
];
1314
}
1415

16+
// Mixes two rgb colors using a ratio
1517
export function mixRgb(
1618
rgb1: [number, number, number],
1719
rgb2: [number, number, number],
@@ -23,6 +25,7 @@ export function mixRgb(
2325
return hslToRgb(hsl[0], hsl[1], hsl[2]);
2426
}
2527

28+
// Mixes two hex colors using a ratio
2629
export function mixHex(color1: string, color2: string, ratio: number): string {
2730
const rgb1 = hexToHsl(color1);
2831
const rgb2 = hexToHsl(color2);
@@ -123,12 +126,7 @@ export function hslToHex(h: number, s: number, l: number): string {
123126
return rgbToHex(r, g, b);
124127
}
125128

126-
export function lighten(color: string, background: string, amount: number) {
127-
const [h, s] = hexToHsl(color);
128-
const [, , l] = hexToHsl(background);
129-
return hslToHex(h, s, l > 0.5 ? l - amount : l + amount);
130-
}
131-
129+
// Changes the opacity of a hex color code, returns rgba() format
132130
export function opacify(color: string, opacity: number) {
133131
const [r, g, b] = hexToRgb(color);
134132
return `rgba(${r},${g},${b},${opacity})`;

0 commit comments

Comments
 (0)