This repository has been archived on 2025-09-28. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
YaHueLib/yahuelib/utils.py

14 lines
317 B
Python

# Copyright (c) 2023 Julian Müller (ChaoticByte)
from colorsys import rgb_to_hsv as _rgb_to_hsv
def rgb_to_hsv(r:int, g:int, b:int) -> float:
assert type(r) == int
assert type(g) == int
assert type(b) == int
r_ = r / 255.0
g_ = g / 255.0
b_ = b / 255.0
return _rgb_to_hsv(r_, g_, b_)