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

Customizable colors for languages in language card #2479

Open
Ishaan2053 opened this issue Jan 28, 2023 · 8 comments
Open

Customizable colors for languages in language card #2479

Ishaan2053 opened this issue Jan 28, 2023 · 8 comments
Labels
enhancement New feature or request.

Comments

@Ishaan2053
Copy link

Is your feature request related to a problem? Please describe.

Although it most likely doesn't happen with everyone, the languages card has a very similar color for HTML and Jupyter Notebook, which hurts distinguishability when viewed together in compact view.

Describe the solution you'd like

It would be great to have the ability to assign color of choice to your languages in the languages card.

Describe alternatives you've considered

The color of one of these two languages can be changed to fix the issue in this specific case.

Additional context

This is what I want addressed: Very similar colors adjacently hurt distinguishability.

image

@Ishaan2053 Ishaan2053 added the enhancement New feature or request. label Jan 28, 2023
@rickstaa
Copy link
Collaborator

rickstaa commented Jan 29, 2023

@Ishaan2053 Thanks for your feature request. We don't set the language colours ourselves but retrieve them from https://raw.githubusercontent.com/github/linguist/master/lib/linguist/languages.yml using the generate-langs-json.js script. Some of the language colours are, however, not up to date. I created #2484 to fix this.

If you want the language colours to be fixed, it is best you open an issue at https://github.com/github/linguist.

@rickstaa rickstaa reopened this Jan 29, 2023
@rickstaa rickstaa closed this as not planned Won't fix, can't repro, duplicate, stale Jan 29, 2023
@Zo-Bro-23
Copy link
Collaborator

@rickstaa I think this might actually be a useful feature (see #2513). I'm colorblind, and some of the language colors used by linguist is a bit confusing. It would be nice if we could have an option for custom language colors. It would take time to implement though, so it's a low priority.

@rickstaa
Copy link
Collaborator

rickstaa commented Feb 13, 2023

@rickstaa I think this might actually be a useful feature (see #2513). I'm colorblind, and some of the language colors used by linguist is a bit confusing. It would be nice if we could have an option for custom language colors. It would take time to implement though, so it's a low priority.

I think most of the colour problems should be discussed at https://github.com/github/linguist (i.e. colours being too similar). I however agree that for some colours that are hard to read for people with colourblindness having the customization ability in our cards could be beneficial. I re-opened this so we can track this feature.

@tranghane
Copy link

In R, there are these built-in color set which is colorblind friendly, but I don't actually know how to import that into js tho, hope it's help :D
image

@rickstaa
Copy link
Collaborator

In R, there are these built-in color set which is colorblind friendly, but I don't actually know how to import that into js tho, hope it's help :D image

Interesting. Thanks a lot! 🙏You could also open an issue at https://github.com/github/linguist to make it more colorblind-friendly. I am afraid the set might have too few colours for the number of languages they support. 😅

@Zo-Bro-23
Copy link
Collaborator

In R, there are these built-in color set which is colorblind friendly, but I don't actually know how to import that into js tho, hope it's help :D image

Interesting. Thanks a lot! prayYou could also open an issue at https://github.com/github/linguist to make it more colorblind-friendly. I am afraid the set might have too few colours for the number of languages they support. sweat_smile

The problem is with the number of languages linguist supports. They don't have enough colors, so some languages will have similar colors. Since our lang card usually only shows around 5 languages, however, making it customizable will mean that users can use widely different colors, even when the linguist colors for those languages are fairly similar. Sometimes the language colors will also conflict with the theme used, in which case being able to customize the colors will be useful. I also don't think there are any downsides to being able to customize the colors. People might get confused if you used blue for HTML, maybe? But the only colors I remember are yellow for Javascript and pink for Python (and orange for HTML), so maybe we should disable customization for popular languages and only allow for less popular ones? WDYT?

@cxong
Copy link
Contributor

cxong commented Jun 6, 2023

Alternately, I think we can use a preset list of high contrast colours, regardless of language. i.e. top language will always be colour 1, 2nd language colour 2, and so on. This would be fine if only showing one card, but may be confusing if multiple cards are shown together, but I'm not sure how common that is.

@rickstaa
Copy link
Collaborator

rickstaa commented Jun 6, 2023

Alternately, I think we can use a preset list of high contrast colours, regardless of language. i.e. top language will always be colour 1, 2nd language colour 2, and so on. This would be fine if only showing one card, but may be confusing if multiple cards are shown together, but I'm not sure how common that is.

I'm okay with adding a color_blind flag if people want to overwrite GitHub's default language colours 👍🏻.

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

5 participants