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

F

Fjodor Klondyke

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
 
C

chris

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

chris---
 
F

Fjodor Klondyke

chris said:
If you have Photoshop try the color picker. It displays the values in every
important color system.
yes i know but i need to know how to do for an application i am making.

fjodor
 
S

Steve Pugh

Fjodor Klondyke said:
colors consist of hue, sat and lum.

That's one possible colour space; there are others.
every combination of hue, sat and lum has an hex color witch one can use in
an page.

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
expressed in hexadecimal - RRGGBB.
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?

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
 
W

West

Fjodor Klondyke said:
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?



Download and use Dot Color from this site :
http://inetis.com/freeware.asp
 
T

Toby A Inkster

Steve said:
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.

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.
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.

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.
 
O

Owen Jacobson

Consider the following colours in HSL:

(1,0,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.

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top