sty icon indicating copy to clipboard operation
sty copied to clipboard

HTML colors support

Open kubinka0505 opened this issue 4 years ago • 1 comments

I know it can be converted somehow, but please introduce HTML colors conversion support if possible.

from sty import HTMLfg, fg

# CSS "red" 
# HEX "#FF0000"
# RGB (255, 0, 0)
print(HTMLfg(0xFF0000) + "Red")

# CSS —
# HEX "#A0A0A0"
# RGB (160, 160, 160)
print(HTMLfg("#A0A0A0") + "Gray")

# CSS "white" 
# HEX "#FFFFFF"
# RGB (255, 255, 255)
print(HTMLfg("#FFF") + "White")

# CSS "orange"
# HEX "#FFA500"
# RGB (255, 165, 0)
print(HTMLfg("orange") + "Orange")

print(fg.rs)

kubinka0505 avatar Jan 08 '22 19:01 kubinka0505

This looks interesting!

I think I'll add HtmlFg and HtmlBg after v1.0.0 was released.

feluxe avatar Jan 15 '22 14:01 feluxe