Conversion Iteration #2: Color

March 14, 2022
screenshot of converter

For iteration #2: I added Hex color to RGB to the conversion app page converter.

Hex:

This will take the 6-digit hex color only accepting 0-9 and A-F. Then it will convert the Hex to RGB with commas between the 3 color grouping.

RGB:

For the RGB to Hex the user will need to include the commas between the color groupings. This will convert it over to the Hex coding, making the A-F in caps. While it doesn’t matter in the hex code if it’s upper or lowercase I’ve always preferred to have it in uppercase making it a bit quicker to spot in the code. The RGB separated by commas since this is how it’s expected in most programs.

Looking up the formulas for the conversion took some time, found a few different ones but after some trials got one that matched the sample version.

For testing I used: https://en.wikipedia.org/wiki/Web_colors
In my testing I used about 20 colors or more to test the conversions between the two. About 10 for hex to see if the RGB is correct then reversed it for other colors. I used different color types like close to white, reds, blues, a green, and a dark gray.

Related Articles

Python – Birthday List

Python – Birthday List

Birthday List Python Program Worked on a project for a publication to pull the birthdays of their members quickly. To help demonstrate what they were working with; they had two Word files containing tables of birthday months, the dates for the month were not in order...

read more
Microsoft Certified: Azure AI Fundamentals

Microsoft Certified: Azure AI Fundamentals

Passed the Microsoft Certified: Azure AI Fundamentals Certification:https://learn.microsoft.com/api/credentials/share/en-us/LynnAmacher-1690/4DB4563B79AA3C11?sharingId=9196330BBB36EAF4 The graphic was created in Microsoft Image creator with DALL-E where I added the...

read more
AI as your assistant

AI as your assistant

With all the talk of AI will be taking your job and articles like you don’t need to learn coding AI will do it all for you. I’ve been playing around with AI, decided to try to see how much of what AI can be done for me. I use AI generical throughout the post and not...

read more

Pin It on Pinterest

Share This