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

Make semver color output more readable #74

Merged
merged 3 commits into from
Oct 12, 2021
Merged

Make semver color output more readable #74

merged 3 commits into from
Oct 12, 2021

Conversation

mikemand
Copy link
Contributor

As per @pyrech here: #73 (comment)

I went with magenta for major, blue for minor, and cyan for patch. I don't know what other colors we have available. Most terminals should be at least 16 colors these days, but I figure sticking with the typical 8 colors would be safer.

The blue might be a bit too dark. Let me know what other colors you would like me to try.

Here's what my terminal looks like, followed by a typical light theme and a typical dark theme:

Screen Shot 2021-10-12 at 3 04 33 PM

Screen Shot 2021-10-12 at 3 03 56 PM

Screen Shot 2021-10-12 at 3 05 52 PM

Signed-off-by: Micheal Mand <micheal@kmdwebdesigns.com>
@mikemand
Copy link
Contributor Author

I just had a thought, maybe I should leave major as red, and do magenta for minor.

Signed-off-by: Micheal Mand <micheal@kmdwebdesigns.com>
Signed-off-by: Micheal Mand <micheal@kmdwebdesigns.com>
@pyrech
Copy link
Owner

pyrech commented Oct 12, 2021

Thanks for the PR 🎉 . Just a small question though: as the label is only colored now (I mean without background), what about separating it from the phrase before with a dash (ie foo/bar updated from 1.0.0 to 2.0.0 - major?

Could you post a screen with your latest changes in colors to see what it looks like? 🙏

@mikemand
Copy link
Contributor Author

mikemand commented Oct 12, 2021

I can add a dash if you want me to, however, I don't think it is necessarily required. It might just clutter up the output. That's just my opinion, though. I will change whatever you want me to change. 👍

Sure, no problem. Here's what they look like now - again my theme on top:

Screen Shot 2021-10-12 at 3 41 31 PM

Screen Shot 2021-10-12 at 3 42 50 PM

Screen Shot 2021-10-12 at 3 42 08 PM

Edit: By the way, all these screenshots are coming from flopping between composer update and composer update --prefer-lowest on this project. 🤣

@mikemand
Copy link
Contributor Author

By the way, I don't know if it matters to you or not but these colors have just enough difference to still be useful for someone with some kind of color blindness. I use a Chrome extension to check my websites regularly, so it's kind of a habit that I check this too.

@pyrech
Copy link
Owner

pyrech commented Oct 12, 2021

That's perfect if you also checked this accessibility issue 🙌

@pyrech
Copy link
Owner

pyrech commented Oct 12, 2021

Let's merge and release it! Thanks @mikemand 🎉

@pyrech pyrech merged commit 7fe7bc6 into pyrech:main Oct 12, 2021
@mikemand
Copy link
Contributor Author

Woohoo! Thanks @pyrech! 🚀

@mikemand mikemand deleted the fix-semver-color-output branch October 12, 2021 22:17
@noniagriconomie
Copy link
Contributor

Hi @mikemand @pyrech

just a small question: why not keeping the same idea of colors?
I mean red/yellow|orange/green talk to anyone imho
instead violet and blue I think not

I understand the need of change related to your issue and my original code, but the color swap seems reducing the primary idea of change :)

thx

@mikemand
Copy link
Contributor Author

mikemand commented Oct 15, 2021

Hi @noniagriconomie,

I tried the yellow text on a white background but it was just as bad as white text on a yellow background. The green text was alright on the white background, but as you can see from my screenshot of a light theme (the default light theme that comes with macOS and probably iTerm and PuTTY as well) it gets kind of washed out. It is still legible, but it is a little bit hard to read. As a programmer, the last thing you need is anything that makes your eyes work harder since you are reading text all day long.

If @pyrech wants the colors changed back, one of us can PR the change. Or maybe we could make it configurable somehow? I'm pretty sure a Composer plugin should have access to composer.json or maybe config.json, and we can allow users to configure their own colors. Something like:

// user's ~/.composer/composer.json

{
    ...
    "extra": {
        "composer-changelogs": {
            "colors": {
                "major": "red",
                "minor": "yellow",
                "patch": "green"
            }
        }
    }
    ...
}

I don't know if this would even work or not, but it might be something to look into if the colors are a problem?

@pyrech
Copy link
Owner

pyrech commented Oct 15, 2021

For the record this plugin already proposes a system to handle configuration in composer.json (local or global). See https://github.com/pyrech/composer-changelogs/blob/main/doc/configuration.md

About the colors I must admit that I don't really know what the best choice here. It's mainly about standard colors VS readability. If we can't agree here, maybe the configuration option is the way to go?

@noniagriconomie
Copy link
Contributor

I've required v1.8.0 on my projetcs, fg/bg colors suits me well :)
If someone does the config one day I'll be using it of course!

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants