-
Notifications
You must be signed in to change notification settings - Fork 301
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
Added remaining color types for PNTS #391
Changes from 2 commits
62da88a
7443eb8
46a65d0
27ebf74
b3668e3
68bf1a5
296d31d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
export function rgb565torgb( rgb565 ) { | ||
|
||
let r = ( rgb565 & 0xF800 ) >> 11; | ||
let g = ( rgb565 & 0x07E0 ) >> 5; | ||
let b = rgb565 & 0x001F; | ||
r = ( r << 3 ) | ( r >> 2 ); // Scale up red component | ||
g = ( g << 2 ) | ( g >> 4 ); // Scale up green component | ||
b = ( b << 3 ) | ( b >> 2 ); // Scale up blue component | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These all seem like magic numbers. Does this 565 unpacking implementation come from somewhere? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hey, I updated the 565 unpacking to a much cleaner one I found over here link, the previous one was taken from a arduino forum. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great, thanks! Can we add a comment with a link to that page - then I'll test it and get this merged! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok 👍 |
||
return [ r, g, b ]; | ||
|
||
} |
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.
This should only be set to true if the opacity is < 1.0