anuraghazra / github-readme-stats

:zap: Dynamically generated stats for your github readmes
https://github-readme-stats.vercel.app
MIT License
68.51k stars 22.49k forks source link

A confusing point about colors #1583

Open ghost opened 2 years ago

ghost commented 2 years ago

Hello, there is a confusing point about colors. I set the title_color=0969da, which is the same color as GitHub displaying the repository title in. However the color will not render in the card correctly, it will be another close color like 0a6a80. Such problem will also happen when setting text_color.

I try to use the exactly same colors as GitHub to keep the profile page more harmony. This problem is just so confusing.

anuraghazra commented 2 years ago

Not sure what do you mean by

I set the title_color=0969da, which is the same color as GitHub displaying the repository title in. However the color will not render in the card correctly,

If i set the color red for example, it WILL show as red. https://github-readme-stats.vercel.app/api?username=anuraghazra&title_color=ff0000

ghost commented 2 years ago

Sorry. My poor English. I mean it will show as 0a6a80 when I set the color 0969da. It happens on other values too. I picked the 0969da because it is the color of the GitHub repository title, and I found this problem when I tried to make the stats card title in that same color.

I probably have known why. This will only happen on my Windows devices. It will show correct color on my Mac. So it may be the fault of Windows or my browser. Forget it.

anuraghazra commented 2 years ago

mean it will show as 0a6a80 when I set the color 0969da

I don't know how that's even possible. There's no way it will show a different color if you specifically set a color. I also checked via devtools it's correct. I see no problems. 🤔 https://github-readme-stats.vercel.app/api?username=anuraghazra&title_color=0969da

I probably have known why. This will only happen on my Windows devices. It will show correct color on my Mac. So it may be the fault of Windows or my browser. Forget it.

I'm using windows, chrome.

ghost commented 2 years ago

Yes, it sounds impossible. I tried Edge, Chrome and even the markdown preview of Visual Studio Code. They all show as wrong color.

I also visited a color website to see if it says wrong color. However, it is the correct color.

So confusing.

anuraghazra commented 2 years ago

Okay yeah got it! I see now. Good observation. This is really wierd, and after some testing seems like something is wrong on our side. I'll investigate.

anuraghazra commented 2 years ago

Okay this is really wierd, found whats causing this. This is mindblowing.

So turns out using CSS animation's fill forward keyword makes it so the color is being rendered wrongly with opacity. https://codesandbox.io/s/css-anim-forwards-color-bug-n857b3?file=/index.html

ghost commented 2 years ago

Great. 🥳