forked from lvgl-micropython/lvgl_micropython
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lcd_utils.pyi
27 lines (22 loc) · 883 Bytes
/
lcd_utils.pyi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from typing import Union
def remap(
value: Union[float, int],
old_min: Union[float, int],
old_max: Union[float, int],
new_min: Union[float, int],
new_max: Union[float, int]
) -> Union[float, int]:
"""
Remaps a value from one one range to another range
NOTE: If any of the parameters is a `float` than the return value is `float`.
If all of the parameters are `int` than the return value is `int`.
:param value: Value to remap
:param old_min: minimum of the range that value is mapped to
:param old_max: maximum of the range that value is mapped to
:param new_min: minimum of the range to map value to
:param new_max: maximum of the range to map value to
:return: value that has been mapped to new_min and new_max
"""
...
def int_float_converter(value: Union[float, int], /) -> Union[float, int]:
...