Questions tagged [hsl]

HSV is cylindrical color model that determines colors by hue (0°-360°), saturation (color intensity) and lightness (from black over the color to white).

The HSL model describes colors in terms of hue, saturation, and lightness (also called luminance). (Note: the definition of saturation in HSL is substantially different from HSV) The model has two prominent properties:

  • The transition from black to a hue to white is symmetric and is controlled solely by increasing lightness

    • Shading and tinting are controlled by a single value, lightness
  • Decreasing saturation transitions to a shade of gray dependent on the lightness, thus keeping the overall intensity relatively constant

    • Tones are controlled by a single value, saturation

The properties mentioned above have led to the wide use of HSL, in particular, in the CSS3 color model. As in HSV, hue corresponds directly to the concept of hue in the Color Basics section. The advantages of using hue are

  • The relationship between tones around the color circle is easily identified
  • Shades, tints, and tones can be generated easily without affecting the hue

http://xahlee.info/js/i/HSL_color_model.png

Lightness combines the concepts of shading and tinting from the Color Basics section. Assuming full saturation, lightness is neutral at the midpoint value, for example 50%, and the hue displays unaltered. As lightness decreases below the midpoint, it has the effect of shading. Zero lightness produces black. As lightness increases above 50%, it has the effect of tinting, and full lightness produces white.

At zero saturation, lightness controls the resulting shade of gray. A value of zero still produces black, and full lightness still produces white. The midpoint value results in the "middle" shade of gray, with an RGB value of (128,128,128).

As saturation decreases, it produces tones of the reference hue that converge on a shade of gray that is determined by the lightness. This keeps the total intensity relatively constant.


Note that the physical nature of additive color prevents the scheme from working exactly except for hues halfway between the primary and secondary hues. However, the total intensity of the tones resulting from decreasing saturation are much closer than tinting alone, as in HSV.

265 questions
0
votes
1 answer

skrollr plugin to convert colors

I'm trying to write a plugin for skrollr to allow transitions between different kinds of colors annotations. This is the code at the moment: http://jsfiddle.net/nL75k/ It should run before skrollr and convert every color annotation to HSLA. I…
Fez Vrasta
  • 14,110
  • 21
  • 98
  • 160
0
votes
1 answer

Determining the correct RGB for an html heat map

I want to be able to apply a color map that blends smoothly from red to green to blue. It is clear to me, I will need to use HSL to make such a heat map, and then convert each HSL value to an RGB value to achieve this result. However I do not know…
olliepower
  • 1,269
  • 2
  • 11
  • 17
0
votes
1 answer

Best practice, to detect if a Mat is black and White in Opencv

I would like to know if the image I read is a Black and white or colored image. I use Opencv for all my process. In order to detect it, I currently read my image, convert it from BGR2GRAY and I compare Histogram of the original(read as BGR) to the…
Poko
  • 792
  • 2
  • 8
  • 24
0
votes
5 answers

how generate only darken random colors in javascript?

I've been reading the questions here about how to generate random colors in JS/JQuery. But I want to generate only darken colors avoiding the black, yellow and gray range colors, in order to be able to draw areas in google maps with different…
Juan Jardim
  • 2,232
  • 6
  • 28
  • 46
0
votes
2 answers

Can I change a single parameter of a colour in CSS?

When I design things in Adobe Illustrator, I like to pick a colour and then play with its brightness or saturation to make myself a similar colour of the "same family". In CSS, you can define colours with such kinds of values: RGB, RGBA, HSL...…
Ariane
  • 393
  • 4
  • 14
0
votes
0 answers

Compute HSL main color values (red, yellow, green, magenta, blue and purple)

How do I mathematically compute the values for HSL main colors? I can hardcode them in the program, of course, but I remain interested how can I determine if the color is main or combined. There must be an inscribed hexagon in the HSL color circle,…
Tomáš Zato
  • 50,171
  • 52
  • 268
  • 778
0
votes
1 answer

Color.GetSaturation() not working?

I use HSL (HSL = HSB as Heu saturation brightness) color filters. To convert a color to HSL i do : Color myColor = Color.FromArgb(pixel[blue], pixel[green], pixel[red]); int HSLhue = (int)myColor.GetHue(); // note normally its a float but i need…
user613326
  • 2,140
  • 9
  • 34
  • 63
0
votes
1 answer

How to change color lightness in jquery

I have created a color swatches and a slider for controlling the darkness & lightness of color. I want to change the color lightness according to the slider value. What i tried : $("#darklight").slider({ range: "min", value: 0, …
Gaurav
  • 8,367
  • 14
  • 55
  • 90
0
votes
2 answers

Sass: Using HSLa Fallback Technique

Does anyone know a workaround for enabling HSLa color declarations in SASS-compiled stylesheets? I'd like to use HSLa for the reasons discussed in this article by Chris Coyier. The fallback technique recommended in the Modernizr Docs is to declare a…
cantera
  • 24,479
  • 25
  • 95
  • 138
0
votes
0 answers

Convert RGB value to HSV/HSL

Possible Duplicate: RGB to HSV in PHP Please help,I googled many script but all not work .. Can somebody tell me how to write a function to do the conversion?
0
votes
1 answer

ImageMagick's composite on HSL (not HSB nor HSV)

Just I want to do is to replace Photoshop's HSL-based blend modes (color/hue/saturation/luminosity) by writing a CUI tool. Better if I can do it via RMagick. ImageMagick can manage HSL colorspace, but ImageMagick's composite operators…
ippei
  • 36
  • 4
0
votes
2 answers

convert hsl to hsb

what is the formula to convert HSL to HSB? I could only find code that I could easily port for RGB to HSL. According to this stack overflow answer I can conver hsb to hsl using this formula: (b - s) / 2 but I want to go the other way, and (b+s) * 2…
alphablender
  • 2,168
  • 5
  • 27
  • 42
0
votes
2 answers

Farbtastic convert HSL back to RGB or Hex

Edit: Posting Solution I wanted to create color swatches based on the color chosen in Farbtastic. I did my calculations on the HSL value, because it's easier and produces better results. After getting the HSL value from Farbtastic, I added…
Jen
  • 1,663
  • 1
  • 17
  • 34
0
votes
1 answer

Coloring in php using HSL

I want to be able to color some letters (bases) in a sequence. I can make a function to say 'color this' but I can not say what the color is. I have made some hsl divs using an internal stylesheet but this doesn't seem to work. case 1:…
user1338194
  • 267
  • 1
  • 4
  • 17
0
votes
1 answer

php HSL color scheme : Making a legend

ok So I have created a color scheme, to highlight certain parts of input data(text). However i need to make a Legend , to tell the user what each color means. This is what i Have so far : ` /input/
user1338194
  • 267
  • 1
  • 4
  • 17
1 2 3
17
18