# how to calculate hex values from hue , sat and lum?

#### Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

•  Subject
• Author
• Posted on
hello,

colors consist of hue, sat and lum.
every combination of hue, sat and lum has an hex color witch one can use in
an page.

my question is:
- when i know the hue, sat and lum numbers of a color, how do i get then the
hex values?
- and also the other way round: when i got the hex value of a color, who do
i then get the hue, sat and lum values?

thanks,

fjodor

## Re: how to calculate hex values from hue , sat and lum?

If you have Photoshop try the color picker. It displays the values in every
important color system.

chris---

in
the
do

## Re: how to calculate hex values from hue , sat and lum?

every
yes i know but i need to know how to do for  an application i am making.

fjodor

## Re: how to calculate hex values from hue , sat and lum?

Fjodor Klondyke said:

about half way down the page you'll find the formula:
http://premshree.resource-locator.com/articles/fun_colors /

i would recommend a bit of software. theres gazillions of cute little
free ones.

--
brucie

## Re: how to calculate hex values from hue , sat and lum?

that is what i am looking for,

thanks,

fjodor

## Re: how to calculate hex values from hue , sat and lum?

That's one possible colour space; there are others.

That's not automatically a given. Not all colours exist in all colour
spaces. I know that some colours exist in CMYK but not in RGB. Not
having worked with HSL much I can't say for sure whether the same is
true of HSL and RGB.

Certainly PhotoShop 7 will only let me enter integer values for Hue
Stauration and Brightness (as it calls it). This means that the
PhotoShop HSL colour space has only 360 x 100 x 100 = 3,600,000
colours in it whilst the RGB colour space has 256 x 256 x 256 =
16,77,216 colours in it, That's four half times as many.

The value used in HTML colours is just the RGB value of a colour

Use a program that will display both values at once. Any decent
graphics package should be display both HSL and RGB values for a given
colour and most modern graphics packages will additionally display the
RGB value a hex triplet.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie."  - The Doctor

## Re: how to calculate hex values from hue , sat and lum?

Steve Pugh wrote:

Well, I believe all colours that exist in CMYK do exist in RGB (and vice
versa) -- it's just that you need infinitely granular units of each
component colour.

In fact, in PhotoShop's world (which is a fairly standard way of doing
HSL) the HSL colour space is even more limited than that.

Consider the following colours in HSL:

(1,0,0)
(2,0,0)
...
(360,0,0)
...
(1,1,0)
...
(360,1,0)
.....
(1,100,0)
...
(360,100,0)

All are pure black -- there are just 36000 ways of specifying it! Whereas
with an RGB colour space, each of the 16777216 colours is unique.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me - http://www.goddamn.co.uk/tobyink/?page=132

## Re: how to calculate hex values from hue , sat and lum?

On Tue, 13 Jan 2004 18:50:58 +0000, Toby A Inkster wrote:

Interesting point.  Is there a programmatic way to compare colours for
equality in HSL space?

--
Some say the Wired doesn't have political borders like the real world,
but there are far too many nonsense-spouting anarchists or idiots who
think that pranks are a revolution.

## Re: how to calculate hex values from hue , sat and lum?

Owen Jacobson wrote:

The simplest way is to convert to RGB and compare there, although I'm sure
there is some way to do it in the HSL space directly.

Conversion algorithm is here:
http://130.113.54.154/~monger/hsl-rgb.html

--
Toby A Inkster BSc (Hons) ARCS
Contact Me - http://www.goddamn.co.uk/tobyink/?page=132

in
the
do