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

Colors #13

Open
scls19fr opened this issue Feb 21, 2019 · 1 comment
Open

Colors #13

scls19fr opened this issue Feb 21, 2019 · 1 comment

Comments

@scls19fr
Copy link
Member

scls19fr commented Feb 21, 2019

Using a library to manage 2 bytes (16 bits) colors might be considered

Here is a schema for such colors representation (aka RGB565)

1        |1          |        0
5 4 3 2 1|0 9 8 7 6 5|4 3 2 1 0 
---------|-----------|---------
R R R R R|G G G G G G|B B B B B
  • 5 bits for red channel - 32 values

  • 6 bis for green channel - 64 values (green gets an extra bit because it's the main element of luminance)

  • 5 bits for blue channel - 32 values

Name R G B value
BLACK 0 0 0 0
WHITE 31 63 31 65535
RED 31 0 0 63488
GREEN 0 63 0 2016
BLUE 0 0 31 31
GRAY 16 33 16 33840
BROWN 23 34 0 48192
YELLOW 31 63 0 65504
@scls19fr
Copy link
Member Author

Currently we are using a custom class
https://github.com/py3-nextion/pynextion/blob/master/pynextion/color.py

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

No branches or pull requests

1 participant