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
2 answers

How exactly are HSL colours meant to be written?

I'm unclear about how HSL colours are meant to be written. W3 has them like this: color: hsl(120, 100%, 50%); Whereas ThreeJs asks for them like this: h — hue value between 0.0 and 1.0 s — saturation value between 0.0 and 1.0 l — lightness value…
j_d
  • 2,818
  • 9
  • 50
  • 91
0
votes
1 answer

Generate 12 (perceptually) uniformly-spaced colours using d3

This question follows from https://stackoverflow.com/questions/29589186/generating-a-perceptually-accurate-colour-wheel-in-javascript I'm trying to create 12 colours that are roughly uniformly spaced from one another perceptually. d3 provides HSL,…
P i
  • 29,020
  • 36
  • 159
  • 267
0
votes
1 answer

How to generate a HSL or HSI Histogram from a normal Image?

I am working on a scientific work project, where i need to get some image standards. To do this, i need a code that generate 3 Histograms from a normal .JPEG .PNG OR .BMP image. The first histogram its the HUE Histogram, the second is SATURATION…
Marcel James
  • 834
  • 11
  • 20
0
votes
2 answers

How to check if a HSL color's hue is in given range?

I'm using the HSL colour space. The Hue factor is from 0 to 360 degrees, and going from zero to 360 means to go a full circle around on the colour circle. So 0 is close to 360 (or they are the same). This implies that to do some range checking one…
user613326
  • 2,140
  • 9
  • 34
  • 63
0
votes
1 answer

Convert string to number in MediaWiki

I'd like to colorify user names in a MediaWiki page based on hashes of the string containing the username itself. The only thing I'd like to know is how to get from a letter string a number from 0 to 360 so that I can specify the hue using hsl…
0
votes
1 answer

QColor hsl hue precision

In the code presented below the hsl hue component of the color has a diffrent value than expected. For: r:255 g:168 b:177 it gives a hsl hue of 353 but on other web tools it yields 354 QColor rgb(c); QColor hsl = rgb.toHsl(); QColor hsv =…
SiWM
  • 90
  • 1
  • 9
0
votes
0 answers

How to filter out hue errors in images

I've been running a hue difference algorithm on some images. Hue difference generally means difference in color, and only color, regardless of contrast: But, I've noticed a nasty effect with some images: As you can see, cyan and yellow appeared…
Tomáš Zato
  • 50,171
  • 52
  • 268
  • 778
0
votes
0 answers

How can I evaluate a bitmap for HSL values?

I'm reopening a C# project I had given up on. I am trying to parse through a bitmap image to find a specific range of HSL values. If the bits I'm 'looking' at fall within that HSL range, I keep them. If they don't, I would throw them away. I have no…
Sean
  • 95
  • 3
  • 11
0
votes
1 answer

C# RGB to HSL one way conversion algorithm

The following is my RGB to HSL one way color conversion method, written in C#. It is closely based on code from the open source program, "Meazure" (which is the tool I am using for my project, thus I need my HSL color to be formatted the same as it…
user10478
  • 327
  • 1
  • 16
0
votes
2 answers

Colour Name to RGB/Hex/HSL/HSV etc

I have come across this great function/command. Colour to RGB, you can do this: col2rgb("peachpuff") //returns hex It will return one hex value. I want to extend this using Perl, Python or PHP but I want to be able to pass in, for example, "yellow"…
Abs
  • 56,052
  • 101
  • 275
  • 409
0
votes
1 answer

Convert RGB to HSL in MySQL

I'm trying to get a HSL color value from my Database. Currently there is only a RGB value stored. Let's assume I got separate columns for rgb: red green blue with a number value 0-255 in them each. Target result would be hue saturation lightness in…
bardiir
  • 14,556
  • 9
  • 41
  • 66
0
votes
1 answer

Image map based on HSL or HSI values

I am trying to figure out a way to digitally map an image of a stained glass window. Between and around every piece of glass is a line of lead solder. What I'm thinking would be the best way to go about this would be to map the image based on the…
Sean
  • 95
  • 3
  • 11
0
votes
1 answer

Get new HSL Color by lumMod/lumOff

Am I doing this correctly? For example, I have an RGB(165,165,165) and convert it to the HSL(Get (0, 0, 64.7)). Actually I parse xml, and there I have two parameters lumMod = '60 000' and lumOff = '40 000' (As I know it means that I must multiply…
Maxim Banaev
  • 886
  • 1
  • 9
  • 22
0
votes
1 answer

Negative saturation using css

I am cutting a Photoshop web layout. I have the following filter I would like to apply in css (I don't want to use an image in which the filter is already applied). So I used these css properties to generate the following HSL (-64, -67,…
Pier-Alexandre Bouchard
  • 5,135
  • 5
  • 37
  • 72
0
votes
1 answer

How to Set Luminance for HueModifier - Aforge.Net

I'm using Aforge.net HueModifier and SaturationCorrection filters to change image color. My problem is how to set Luminance alongside these filters to get the desired color?
Syma
  • 574
  • 1
  • 4
  • 11