Forum Moderators: open

Message Too Old, No Replies

html colours by: Hue Saturation & Luminence ?

         

kapow

10:47 am on Jul 31, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Is there html to show colours by: Hue Saturation & Luminence ?

Background: I am looking for a method of showing the same colour at a range of tints or tones so that my clients can pick the colour they want. It seems to me that altering the Luminence of a colour from 0-240 would do this.
(this is for situations outside of the standard web-safe colours).

DaveN

11:40 am on Jul 31, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



kapow,

Don't know if this helps but we are doing some work for a art company picking the painting then framing it... then hang it on your wall(pick you own colour)

we used 2*2 pixels ffffff.gif fffffc.gif etc etc, set them out in a table and used javascript to change the background of the wall.

DaveN

if you want the url sticky me it works ok

rewboss

1:38 pm on Jul 31, 2002 (gmt 0)

10+ Year Member



It doesn't look as if CSS does that, although you'd think it would. The rationale might be that only RGB colours are sensible on screen, but of course CSS isn't supposed to be a purely screen medium.

There ought to be an algorithm available to convert HSB to RGB, but it probably won't be very accurate.

bird

2:12 pm on Jul 31, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you talk about "relative screen brightness", then you might get some useful results. As rewboss already mentioned, defining luminance values for a web page is absolutely pointless, as it will only mean anything if your visitors have their screens color-calibrated exactly the same as yours. Fiddling the buttons at the bottom of the screen already falsifies those numbers, and the varying phosphors used by different manufacturers will make identical calibration difficult in any case.

But that is probably nitpicking and not very relevant to what you're trying to acheive. Although the RGB color space is NOT standardized (in terms of both chromatizity and luminance), there are conversion functions between RGB and HLS/HSV that everybody seems to use unchanged (I'd prefer HLS, as its "lightness" parameter covers the full range between black and white). Those three color spaces are all defined within virtual minimum-maximum ranges and have little to do with real life colors and luminances, but that's probably exactly what you need here.

If there's no WISIWYG HTML editor that offers you to pick colors in HLS, then you can find the function definitions in any decent graphics programming book. Note that almost all color spaces have different gamuts, so you might want to stay within a relatively small range of colors that are available to all of them.

kapow

2:27 pm on Jul 31, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



> WISIWYG HTML editor that offers you to pick colors in HLS
I'm using DreamWeaver, it does a good job.

RGB, Hex, HSB will all look different on different screens, I can live with that. I want to give a select group of people a way of seeing a particular colour at a range of tints.

It sounds from what you folk have said that it can't be done. If that is the case then I'll go back to RGB and provide it in more detail than the standard web-safe colours. So, before I take that road, am I correct - HSB can't be done in HTML?

bird

2:42 pm on Jul 31, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



HSB can't be done in HTML?

As far as I know, HTML/CSS only accept color specifications in either #rgb or the standardized color names.