File size: 440 Bytes
40e38d3 |
1 2 3 4 5 6 7 8 9 10 11 12 |
def set_alpha(color: str, alpha: float) -> str:
if color.startswith('#'):
r, g, b = int(color[1:3], 16), int(color[3:5], 16), int(color[5:7], 16)
else:
r, g, b = 0, 0, 0
return f"rgba({r}, {g}, {b}, {alpha})"
def get_desc(data):
res = {name: list(dt.to_dict().keys()) for name, dt in data.items()}
return "\n".join([
f"**{name}**: min={min(dt)}, max={max(dt)}" for name, dt in res.items()
]) |