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
Issue with hex colour in VS Code terminal #1298
Comments
Hi @EmidioStani I tried to reproduce the issue in VS Code (dark mode), but looks like hex color code is working fine. P.S. I cloned this tqdm repository locally and tested it. I hope it is also alright in the default pip tqdm installation as well. |
Thanks for checking this, I wonder what the problem would be |
this should print various colors randomly #!/usr/bin/env python3
import tqdm, time, random, colorsys
def hsv_to_rgb(h, s, v):
r, g, b = colorsys.hsv_to_rgb(h, s, v)
return f"#{hex(int(r*255))[2:].rjust(2,'0')}{hex(int(g*255))[2:].rjust(2,'0')}{hex(int(b*255))[2:].rjust(2,'0')}"
while True:
total = 360
pbar = tqdm.tqdm(total=total)
s, v = random.random(), random.random()
for h in range(total):
pbar.update()
pbar.colour = hsv_to_rgb(h / 360, s, v)
pbar.refresh()
time.sleep(1 / total) my system info;
and info for
but i did have some issues with this skipping lines up and down, and even a runtime error:
|
Hi @joshinils
The bars kept changing colours (not captured by this picture) and i got an output with no errors - Was this the intended output? I cloned this tqdm repository and checked your code. I hope it is the same with the standard pip tqdm installation. |
Aha, I forgot
Yes, I wanted it to loop through as many colours as possible, so each bar goes through all hues with random saturation and value, but I guess that's not necessary to check for colour support.
I am using the standard pip install |
Closing this as it doesn't seem to be reproducible. |
read the [known issues]
environment, where applicable:
4.62.3 3.9.8 (tags/v3.9.8:bb3fdcf, Nov 5 2021, 20:48:33) [MSC v.1929 64 bit (AMD64)] win32
Hello I am running my python script in the terminal of Visual Studio Code (in dark mode), when I use the predefined colours like (RED, YELLOW, etc.) I can see the progress bar in that colour (see yellow in screenshot) but when I try any hex like #ff0000 or whatever combination I put it is always grey (see below in the screenshot)
The text was updated successfully, but these errors were encountered: