Make mypy happy

This commit is contained in:
Kovid Goyal
2025-12-30 13:32:04 +05:30
parent 4773ac81b6
commit 877d143c1a

4
kitty/rgb.py generated
View File

@@ -78,14 +78,14 @@ def srgb_to_linear(c: float) -> float:
"""Convert sRGB component (0-1) to linear light"""
if c <= 0.04045:
return c / 12.92
return ((c + 0.055) / 1.055) ** 2.4
return math.pow((c + 0.055) / 1.055, 2.4)
def linear_to_srgb(c: float) -> float:
"""Convert linear light component (0-1) to sRGB"""
if c <= 0.0031308:
return c * 12.92
return 1.055 * (c ** (1 / 2.4)) - 0.055
return 1.055 * math.pow(c, (1 / 2.4)) - 0.055
def oklch_to_srgb(l: float, c: float, h: float) -> tuple[float, float, float]: