-
-
Notifications
You must be signed in to change notification settings - Fork 78
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
Fixes to respect bright colors in palette #126
Conversation
Now that the code respects the explicit definitions of the upper 8 colors, it was necessary to remove the " |
@ssbarnea Can you run the CI checks on this? It failed linting before but I didn't check the log before the log expired, so I'm not sure what's wrong. |
Sure, just ping me when needed. |
@ssbarnea Hi, so, it appears that because this PR effectively changes the color palette that is generated, the unit tests are going to fail unless they are also changed accordingly. Would you or someone else like to proofread what I've done here before I try to change the tests themselves? Thanks. |
Looks good to me. |
Nice, thanks. I thought perhaps I should generate before/after images to demonstrate that it's working, but I haven't found the time to do that yet. |
I am going to close this because I did not find any attempts to bring it to ready for review state. If things change I am more than happy to reopen it. Others are also welcomed to attempt to get the incomplete code and fix it. |
The code isn't incomplete. It's the old unit tests that need fixing as they are based on the old (broken) code. I don't have time to manually create the fixed tests right now but I am hoping that with the branch closed, it will not be overlooked or deleted in the future before someone finishes merging it. |
Is failing most CI jobs, which counts as... not complete. You want to create a feature branch directly inside the project? I will reopen it, hoping someone takes over and fixes the tests for it. |
What needs editing is |
Note: This is the raw values from |
@echuber2 okay nice, let's drop it then and bring it back in an explicit saner version when (and if) we get bug reports about people missing the weird current behavior after the next release. |
for more information, see https://pre-commit.ci
@echuber2 I extracted "Basic" from that^^ screenshot to be: {
"osx" ( # macOS theme "Basic"
'#000000',
'#800000',
'#008000',
'#808000',
'#000080',
'#800080',
'#008080',
'#808080',
'#666666',
'#e60000',
'#00d900',
'#e6e600',
'#0000ff',
'#e600e6',
'#00e6e6',
'#e6e6e6',
)
} Interestingly, our code on @echuber2 I am currently considering to keep the spirit of the current osx palette unchanged but to put the previous effective light values in like this:
What do you think? |
I don't mind having more palettes available. In my most recent commit I had overwritten the osx one with the Basic palette from Jeff's screenshot and also added osx-brighter based on the "solid colors" palette. (Notably, the Basic palette seems to be very dark, and probably is meant for use on a white background.) Perhaps your |
@echuber2 that sounds great, and |
This reverts commit 78e3b5f. Reformatting the string literals as lowercase just requires more tests to be fixed, so it's a pain. In the future it would be nice to make that consistent though.
I think it's okay now but I'm not sure if something needs to be done about the codecov. |
Coverage looks ok to me. Sometimes we need to use common-sense and disregard what it reports. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @echuber2 .
I reviewed all but osx-solid-colors
color values now. In general, I think the PR is in a great state now, very well done, thank you! 👍
My potentially final question here on details would be:
- Do you want me to double-check
osx-solid-colors
? - Do we want to add function
darken_bright_colors
despite no tests and no users? I don't think it's a big problem, but I also find that the code is easy enough to re-do in 1 minute later if needed, and maybe just not adding that function is "even better"? - There are "26 commits" in here according to GitHub. I would strongly advise against rebase-merging due to that. If everyone is expecting this to be squash-merged, then it's a non-issue. (Personally and elsewhere I would always ask to get PRs clean of merge commits and to rebase against latest
master
.)
Thanks for your work on this matter! 👍
If that is ok remove your requested changes status so I can squash-merge it without using admin rights. Or you can to the squash merge yourself. In general I do only squash merged but sometimes I make mistakes (same reasons as you). |
@echuber2 thank you! 🙏 |
Fixes #133
It seems there are two errors in the existing logic in style.py:
intensify
.In other words, the code was overwriting some of the explicitly defined colors, but also failing to provide automatically brightened colors when it could have :-)
Note that with this fix in place, the existing test suite doesn't "pass" because the output colors will be different. For some users, this may be an unexpected change in behavior. In that case, maybe the old behavior should be preserved as a default while the new behavior is toggled optionally.
The code could be optimized to not make so many redundant calls to
intensify
, but I haven't bothered to make that change here.