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

Configurable font color #504

Closed
diomed opened this issue Aug 8, 2015 · 8 comments
Closed

Configurable font color #504

diomed opened this issue Aug 8, 2015 · 8 comments
Labels
core Server, BaseService, GitHub auth, Shared helpers npm-package Badge generation and badge templates

Comments

@diomed
Copy link

diomed commented Aug 8, 2015

I'd like to be able to pick my own font color as well, instead of just picking badge color.
There are great color schemes that could be done like that.

@espadrine
Copy link
Member

Thanks for the suggestion!

Should we dissociate left / right?
We should probably restrict that to custom badges, as vendor badges can have varying colors.

What should the parameter be named? We currently have colorA and colorB (for left / right) and colorscheme (for colorscheme.json). Maybe fontColorA and fontColorB?

@diomed
Copy link
Author

diomed commented Aug 17, 2015

Dissociation would be good.

and of course, that would go for custom badges only.
Why not colorLeft & colorRight?

Tho I wouldn't mind what name it is as long as it's there.

@paulmelnikow paulmelnikow added core Server, BaseService, GitHub auth, Shared helpers and removed enhancement labels Sep 30, 2017
@paulmelnikow paulmelnikow changed the title please add font color option Configurable font color Nov 6, 2018
@paulmelnikow
Copy link
Member

/cc @MattIPv4

@MattIPv4
Copy link

@paulmelnikow ty, GH didn't bring this up in related.

@paulmelnikow paulmelnikow added npm-package Badge generation and badge templates and removed core Server, BaseService, GitHub auth, Shared helpers labels Jan 8, 2019
@mbarkhau
Copy link
Contributor

To be in line with the new naming, the parameters would now be fontColor and labelFontColor.

@paulmelnikow paulmelnikow added the core Server, BaseService, GitHub auth, Shared helpers label Feb 18, 2019
@hugovk
Copy link

hugovk commented Dec 1, 2019

My use case is using badges to link to GitHub labels, and wanting to use the same colours.

GitHub labels automatically use white or black text colour based on the background colour:

image

https://github.com/NaNoGenMo/2019/labels

But the "admin" and "preview" badges are quite hard to read with white text:

image

https://github.com/NaNoGenMo/2019

One option is to use a similar algorithm to GitHub's to select the foreground black/white colour, but I'd be happy enough to be able to select black for these two.

@PyvesB
Copy link
Member

PyvesB commented Feb 17, 2020

@hugovk what you're suggesting has also been proposed in #4661. I'm personally more in favour of just having black and white automatically switching based on contrasts, rather than allowing full colour customisation as initially suggested by this issue. This keeps our badges more consistent and more readable (coloured text often being harder to read), without any user action needed to override the colour.

@PyvesB
Copy link
Member

PyvesB commented Oct 27, 2020

There have been a number of issues and comments about font colours over the years. The most common reason given by users is to allow better readability when the badge uses a light background (#5317, #4661, #5455, #504 (comment) and probably others).

This has been fixed by #5467 which automatically switches to a dark font when the background is too light.

At this point in time, we don't think that allowing users to fully customise the font colour is a good idea. The reasoning as to why these new options may add complexity and work against Shields' consistency and readability promises can be found in #5467 (comment).

Hopefully the implementation we've come up with will cover a vast majority of uses cases and allow people to happily read badges even with light backgrounds! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Server, BaseService, GitHub auth, Shared helpers npm-package Badge generation and badge templates
Projects
None yet
Development

No branches or pull requests

7 participants