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

Correct color names and hexadecimal codes #9

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

LDmicroGitHub
Copy link

Hello, Peter.
I propose to correct the color names and hex codes according to base colors from
https://en.wikipedia.org/wiki/Web_colors

I think all hardware manufacturers are guided by these hex values.
Also, some used color codes are unsafe if RGB565 or RGB444 converting used.
100=0x64 and 90=0x5A will lose the lowest bits when converting to RGB565 or RGB444.

I am not sure about the synonyms of colors. Probably they are not needed.

I haven't changed yet the else part of color definitions.

This pull request leads to some corrections in documentation and code due to the change in user colors.

Also, I propose to develop several color schemes similar to those used in editors with good contrast and readable.
image

I want to know your opinion on the main.
WIP

@LDmicroGitHub
Copy link
Author

micropython-nano-gui\gui\demos\check_colors.py
P10424-152111

@peterhinch
Copy link
Owner

My initial reaction is not one of enthusiasm. It will break users' applications and my test scripts. It will need to be tested on different displays: some drivers reduce the rgb() values to 8 or 12 bits. Some of my colors were chosen for specific results in my test scripts. There's a lot of work in checking all that...

I do take your point in the code comments about light and dark. I didn't choose my names wisely.

On the other hand I can see merit in standardising colors. Perhaps the best option is to produce a web_colors.py (or whatever name you think best) which can be renamed and swapped for my version. Then users have a choice.

Fill the screen with stripes of all colors.
Frame the screen.
@IhorNehrutsa
Copy link
Contributor

Well.
I understand your initial reaction. Backward compatibility is very important.
Let's see what we can do.

I reverted the colors.py but left comments.

  1. I propose to rename
    LIGHTRED as DARKRED with the accompanying comment
    There aren't LIGHTRED in other places of the repository.

  2. DARKGREEN is present, so LIGHTGREEN rename to the
    SILVER = create_color(9, 0xC0, 0xC0, 0xC0)
    There are LIGHTGREEN in
    micropython-nano-gui\gui\demos\fpt.py
    micropython-nano-gui\FPLOT.md

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.

3 participants