troubleshooting Question

Excel formula to convert HSL color values to RGB color values

Avatar of WeThotUWasAToad
WeThotUWasAToad asked on
Microsoft OfficeWeb Graphics SoftwareMicrosoft Excel
6 Comments1 Solution205 ViewsLast Modified:
Hello,

I'm trying to:
(1) improve the Hue/Sat/Lum formulas in the attached spreadsheet and
(2) determine what Excel formula(s) will convert numeric HSL color values into numeric values for other color formats.



Explanation of the attached Excel file:

The following screenshot is taken from the attached Color Conversion Chart* which I created some time ago.

2020-04-12b_Color-Conversion-Chart.PNG
As shown in the image, inserting values for a given color into the yellow cells of a row enables you to see that color (in the Display Color column) and obtain the conversion values for other numeric color formats.

For example, suppose you want to view the appearance and obtain conversion values of a color for which you have 3-digit 000-255 (MS Office) values. In this case, you would enter your values in the three yellow cells in conversion row [1].

Alternatively, if you have three hex values for a certain color, you could enter them in the yellow cells in conversion row [2] to display the color and obtain the conversion values in other formats.

Issues:

#1 Hue/Sat/Lum formulas need tweaking:
Although the Hue/Sat/Lum columns work fairly well in most cases, I sometimes get errors or even negative values — which obviously cannot be right. For example, entering MS Office values of [255][153][255] results in HSL values of [-43][255][204] and, as shown in the screenshot, entering values of [025][025][025] gives HSL results of [#DIV/0!][0][25].

#2 Need formulas to convert from HSL parameters to other formats:
The chart converts from other formats to HSL fairly well but I could use some help finding the formulas to convert from HSL to other formats.

By the way, The Color Conversion Chart is in the first tab of the attached file, but there are several other sheet tabs which I was initially going to delete before uploading the file. However, although they contain quite a bit of junk, much of the math and formula breakdowns are in those additional tabs so they may or may not be helpful/of interest.

Thanks

*There are many websites which will display a particular color and conversion values. However, the value of this color conversion chart is that you can copy & paste one of the conversion rows into multiple rows below and simultaneously see and compare as many different colors as you want.

Attached file: Color-Conversion-Chart-2020-04-12_u.xlsm
ASKER CERTIFIED SOLUTION
Paul Sauvé
Retired

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros