Make mypy happy
This commit is contained in:
parent
4773ac81b6
commit
877d143c1a
1 changed files with 2 additions and 2 deletions
4
kitty/rgb.py
generated
4
kitty/rgb.py
generated
|
|
@ -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]:
|
||||
|
|
|
|||
Loading…
Reference in a new issue