RGB range for cold and warm colors?

前端 未结 5 714
臣服心动
臣服心动 2020-12-23 19:30

What are ranges of cold and warm colors (http://www.diy-bathroom-remodel.com/images/color_wheel.gif) in RGB?

相关标签:
5条回答
  • 2020-12-23 20:12

    already answered but need to add this:

    If you are interested in physical temperature and color dependencies then this is the scale you are looking for:

    Black body Temperature color

    It is the color of light emitting from blackbody of given temperature. In astronomy is this used for star color classification (like BV color index).

    It also can be used for indirect temperature measurements.

    0 讨论(0)
  • 2020-12-23 20:28

    Taking the image you linked to as a reference of what is "warm" and "cold", we get the following.

    Colour wheel

    • The hottest colour is completely red (R=255, G=0, B=0).
    • The coldest colour is completely blue (R=0, G=0, B=255).

    So the more R you have, the warmer the colour, and the more B you have, the cooler the colour. The G takes you through shades of turquoise, green, and yellow, each being increasingly warmer. When G is zero, you move in the lower left diagonal of the circle when R and B change. As G approaches 255, you cross over the upper right diagonal when R and B change.

    However, the adjacent warm and cool colours have a different amount of green in them. The red immediately below the diagonal line has less green than the red immediately above it. The blue immediately below the diagonal line has less green than the blue immediately above it. This colour wheel looks like it doesn't represent the RGB space all that well especially in the blue end of the spectrum.

    Ultimately, what you perceive as warm and cold depends on your monitor settings and light conditions. A lot of it is also your perception and cognition – what you think is warm or cold. In an image, the colour contrasts will affect your judgement. An "in-between" colour next to a clearly cool colour will look warm, but if the same colour is next to a clearly warm colour, it will look cool. Take a look at this colour wheel:

    colourwheel

    Here, every single 24-bit colour is shown (8 bits for each of R, G, and B), and the RGB values for the top, right, bottom, and left colours are shown. To my eye, there are more "cool" colours than "warm". Hope this helps you decide what the RGB values are for what you perceive as cool and warm colours.

    Bonus: In the image above, you can also see the colours expressed in the hue, saturation, and value (HSV) colour model. Hue basically encodes the colour. Saturation encodes how "full" the colour is – less saturation makes it more "bleak", ie. white. Value encodes how dark it is – less value makes it more black, and also makes the white of the saturation more grey. Hue goes from 0 to 360 and corresponds to the angle of a circle, with 0 being totally red, 90 being a sort of neon green, 180 being bright blue, 270 being bluish purple, and 360 going back to red again. S and V go from 0 to 100 and will influence the exact shade – these examples are with S=V=100.

    To my eye, H values in the ranges 0-80 and 330-360 are warm while H>80 and H<330 are cold (approximately).

    You may want to open the colour selector in your favourite paint program. They can usually show HSV and RGB side by side and let you play with a colour wheel and see the effects on the HSV and RGB numbers. If you don't already have one, I would suggest GIMP. It has the colour wheel I've been using to get the numbers for this answer.

    Bonus 2: All of the above assumes a subjective assessment of what is warm and what is cool. I think the only way to make an objective measurement of colour temperature is to measure it and express it on a temperature scale. Often Kelvin seems to be used. This measure takes into account not only shade of the colour, but its brightness (or how much light it emits) too. If you have a modern monitor, it probably has a temperature setting with some Kelvin values to choose from. It is possible to calculate the temperature of each RGB colour on your display, as long as you know the temperature of your white (the white balance). However, this calculation is very complex and I don't know how to do it. You may find Bruce Lindbloom a good source for further information, or any book on colour science. But I guess this is more than you bargained for with your question... ;-)

    0 讨论(0)
  • 2020-12-23 20:28

    Simple and accurate:

        def is_hot(a):
            return (a[..., 'RED'] > 128)
    

    where 'RED' stands for the index of the red channel in the array a.

    This works -- you can see for yourself by: (a) looking at the second wheel by Fabian Fagerholm and/or (b) go to the following link and move the bar up and down towards the two warm ends.

    https://www.colorspire.com/rgb-color-wheel/

    0 讨论(0)
  • 2020-12-23 20:30

    Looks to me like

    if (B>R) { 
        color=cool
    } else { 
        color=warm
    }
    

    is a pretty good approximation. You can check this out on your color wheel using: http://www.colorzilla.com/firefox/

    0 讨论(0)
  • 2020-12-23 20:30

    Warm colors have more red, and cool colors have more blue.

    In RGB:

    red = 0
    blue = 0
    
    if (red > blue) {
      isWarmColor = true
      isCoolColor = false
    }
    else if (red < blue) {
      isWarmColor = false
      isCoolColor = true
    }
    else {
      isWarmColor = false
      isCoolColor = false
    }
    

    In HSL:

    hueAngle = 0
    
    if (hueAngle < 0 || hueAngle > 360 || hueAngle == 90 || hueAngle == 270) {
      isWarmColor = false
      isCoolColor = false
    }
    else if (hueAngle > 90 && hueAngle < 270) {
      isWarmColor = false
      isCoolColor = true
    }
    else if (hueAngle < 90 && hueAngle > 270) {
      isWarmColor = true
      isCoolColor = false
    }
    
    0 讨论(0)
提交回复
热议问题