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

Simple Icons logo color #5752

Open
1 of 3 tasks
adamalston opened this issue Oct 20, 2020 · 1 comment
Open
1 of 3 tasks

Simple Icons logo color #5752

adamalston opened this issue Oct 20, 2020 · 1 comment
Labels
question Support questions, usage questions, unconfirmed bugs, discussions, ideas

Comments

@adamalston
Copy link

adamalston commented Oct 20, 2020

Are you experiencing an issue with...

Description

The color for Simple Icons seems to be inconsistent in its application. For some badges, I need to specify the logoColor and for other I dont.

Working examples

  1. simpleicons.org/swift


    https://img.shields.io/badge/-Swift-fff?&logo=Swift

    The color of the Swift logo is FA7343 and it seems to be applied correctly without needing to specify the logoColor.

  2. simpleicons.org/docker

    Docker
    https://img.shields.io/badge/-Docker-fff?&logo=Docker

    Again, I didn’t have to specify the logoColor for the logo to show up correctly.

Non-working examples

  1. simpleicons.org/java


    https://img.shields.io/badge/-Java-fff?&logo=Java

    The color of the Java logo is 007396. The logo on this badge is white instead of its intended color. We can see this by changing the badge’s color:

    https://img.shields.io/badge/-Java-000?&logo=Java

    So to get the Java logo to show up correctly i have to specify the logoColor:

    https://img.shields.io/badge/-Java-fff?&logo=Java&logoColor=007396

  2. simpleicons.org/typescript

    Logo without logoColor:

    https://img.shields.io/badge/-TypeScript-fff?&logo=TypeScript

    Logo with logoColor:

    https://img.shields.io/badge/-TypeScript-fff?&logo=TypeScript&logoColor=007ACC

I’m unsure if this is a bug or if it is by design. Why do I have to specify the logoColor for some logos, and for others I do not?

@adamalston adamalston added the question Support questions, usage questions, unconfirmed bugs, discussions, ideas label Oct 20, 2020
@chris48s
Copy link
Member

chris48s commented Oct 20, 2020

It is by design, but I agree the behaviour is not ideal in this situation.

The default behaviour is that we try to select a logo colour that will work with the default backgrounds. If we think the suggested colour from simpleicons will work, we use that otherwise we re-colour it so that we don't end up showing a dark logo on a dark background or light logo on a light background. This is useful for the common case.

For the main badge styles (flat, flat-square, for-the-badge, plastic) we're assuming the background is going to be darkgrey and for the social badge we're assuming it is whitesmoke. If you've customised the background colour, then we don't adapt. Unfortunately in this case, because you've customised the background of the default badge style to a light colour, this means the logic is basically doing the exact opposite of what you want.

#2833 is the PR where we introduced this. The logic might have moved on a bit since then, but if you read the discussion there, that's how we arrived at the current tradeoff..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Support questions, usage questions, unconfirmed bugs, discussions, ideas
Projects
None yet
Development

No branches or pull requests

2 participants