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

Fix color inversion for Nano S+ and X devices #80

Merged
merged 2 commits into from
Dec 9, 2024

Conversation

yogh333
Copy link
Contributor

@yogh333 yogh333 commented Dec 9, 2024

No description provided.

Copy link

sonarqubecloud bot commented Dec 9, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
B Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@yogh333 yogh333 merged commit 7cf7832 into master Dec 9, 2024
8 of 9 checks passed
@yogh333 yogh333 deleted the y333_091224/fix_color_inversion branch December 9, 2024 10:54
@@ -59,6 +59,9 @@ def _image_to_buffer_nbgl(im: Image, compress: bool) -> bytes:
if color_index >= nb_colors:
color_index = nb_colors - 1

if bpp == 1 and reverse_1bpp:
color_index = (color_index + 1) & 0x1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, I find using XOR would make the code easier to read/understand:

color_index = color_index ^ 1

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