Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML colors support #40

Open
kubinka0505 opened this issue Jan 8, 2022 · 1 comment
Open

HTML colors support #40

kubinka0505 opened this issue Jan 8, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@kubinka0505
Copy link

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)
@feluxe
Copy link
Owner

feluxe commented Jan 15, 2022

This looks interesting!

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

@feluxe feluxe added the enhancement New feature or request label Jan 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants