Skip to content

Commit 4c186d6

Browse files
committed
fix linting
1 parent 0e801f9 commit 4c186d6

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

python-verso-routing/visuals.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def generate_color(index: int, total: int) -> str:
2020
hue = (index * golden_ratio) % 1.0
2121

2222
# Convert HSL to RGB
23-
def hsl_to_rgb(h: float, s: float = 0.7, l: float = 0.5) -> str:
23+
def hsl_to_rgb(hue: float, saturation: float = 0.7, lightness: float = 0.5) -> str:
2424
def hue_to_rgb(p: float, q: float, t: float) -> float:
2525
if t < 0:
2626
t += 1
@@ -34,12 +34,12 @@ def hue_to_rgb(p: float, q: float, t: float) -> float:
3434
return p + (q - p) * (2/3 - t) * 6
3535
return p
3636

37-
q = l * (1 + s) if l < 0.5 else l + s - l * s
38-
p = 2 * l - q
37+
q = lightness * (1 + saturation) if lightness < 0.5 else lightness + saturation - lightness * saturation
38+
p = 2 * lightness - q
3939

40-
r = hue_to_rgb(p, q, h + 1/3)
41-
g = hue_to_rgb(p, q, h)
42-
b = hue_to_rgb(p, q, h - 1/3)
40+
r = hue_to_rgb(p, q, hue + 1/3)
41+
g = hue_to_rgb(p, q, hue)
42+
b = hue_to_rgb(p, q, hue - 1/3)
4343

4444
return f"#{int(r * 255):02x}{int(g * 255):02x}{int(b * 255):02x}"
4545

0 commit comments

Comments
 (0)