Skip to content

Handy Conversion Tool #1

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

Open
DansDesigns opened this issue Nov 18, 2023 · 1 comment
Open

Handy Conversion Tool #1

DansDesigns opened this issue Nov 18, 2023 · 1 comment
Assignees

Comments

@DansDesigns
Copy link

Hey,
Just seen your video on GUI programming with the Serial Monitor.. Brilliant Work!!

I had a look over your GitHub and I'm impressed, I thought I would share a little code that I have found useful for converting the annoying hex colour definitions into the easier to understand RGB values:

// Colour Conversion from RGB to HEX: #define RGB(r, g, b) (((r&0xF8)<<8)|((g&0xFC)<<3)|(b>>3)) // Colour definitions: #define BLACK RGB (0, 0, 0) #define WHITE RGB(255,255,255) #define GREY RGB(127, 127, 127) #define DARKGREY RGB(64, 64, 64) #define TURQUOISE RGB(0, 128, 128) #define PINK RGB(255, 128, 192) #define PINKRED RGB(235, 158, 220) #define OLIVE RGB(128, 128, 0) #define PURPLE RGB(128, 0, 128) #define AZURE RGB(0, 128, 255) #define ORANGE RGB(255,136,0) #define YELLOW RGB(255,255,0) #define GREEN RGB(51,255,51) #define SKYBLUE RGB(135,206,235) #define BLUE RGB(0,0,255) #define BLUEVIOLET RGB(138,43,226) #define AQUAMARINE RGB(127,255,212) #define RED RGB(255,53,0) #define HONEY RGB(255,204,153) #define BUTTER RGB(255,238,204) #define OCTSUNSET RGB(255,68,0) #define WARNING RGB(255,88,20)

*I added some Colours based on the Star Trek LCARS Colour Scheme

@thelastoutpostworkshop thelastoutpostworkshop self-assigned this Dec 5, 2023
@thelastoutpostworkshop
Copy link
Owner

thanks, I will add it to the code

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

2 participants