冷色和暖色的 RGB 范围?

发布于 2024-10-11 06:59:15 字数 178 浏览 5 评论 0原文

冷色和暖色的范围是多少 (http://www.diy-bathroom- remodel.com/images/color_wheel.gif)在 RGB 中?

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

橘味果▽酱 2024-10-18 06:59:15

以您链接的图像作为“暖”和“冷”的参考,我们得到以下结果。

色轮

  • 最热的颜色是全红色(R=255,G=0,B=0)。
  • 最冷的颜色是完全蓝色(R=0,G=0,B=255)。

因此,R 越多,颜色越暖,B 越多,颜色越冷。 G 带您体验绿松石色、绿色和黄色的色调,每一种色调都变得越来越温暖。当G为零时,当R和B改变时,你在圆的左下对角线中移动。当 G 接近 255 时,当 R 和 B 发生变化时,您就会越过右上对角线。

然而,相邻的暖色和冷色中的绿色含量不同。紧邻对角线下方的红色比紧邻其上方的红色的绿色少。紧邻对角线下方的蓝色比紧邻其上方的蓝色具有更少的绿色。这个色轮看起来并不能很好地代表 RGB 空间,尤其是在光谱的蓝色端。

最终,您感知的冷暖取决于您的显示器设置和光线条件。很大程度上也是你的感知和认知——你认为是温暖还是寒冷。在图像中,颜色对比度会影响您的判断。明显冷色旁边的“中间”颜色会看起来很暖,但如果相同的颜色旁边明显暖色,它会看起来很冷。看一下这个色轮:

colourwheel

这里,显示了每个 24 位颜色(每个 R 为 8 位) 、G 和 B),并显示顶部、右侧、底部和左侧颜色的 RGB 值。在我看来,“冷”色比“暖”色多。希望这可以帮助您确定您认为冷色和暖色的 RGB 值。

奖励:在上图中,您还可以看到以色调、饱和度和明度 (HSV) 颜色模型表示的颜色。色调基本上对颜色进行编码。饱和度编码颜色的“饱满”程度——饱和度越低,颜色越“暗淡”,即。白色的。值对它的暗度进行编码 - 值越小,颜色越黑,并且饱和度的白色也越灰。色调从 0 到 360,对应于圆的角度,0 表示全红色,90 表示霓虹绿,180 表示亮蓝色,270 表示蓝紫色,360 又恢复红色。 S 和 V 从 0 到 100,将影响确切的色调 - 这些示例中 S=V=100。

在我看来,0-80 和 330-360 范围内的 H 值是暖色,而 H>80 和 H<330 是冷色(大约)。

您可能想在您最喜欢的绘画程序中打开颜色选择器。它们通常可以并排显示 HSV 和 RGB,让您使用色轮并查看 HSV 和 RGB 数字的效果。如果您还没有,我建议您使用GIMP。它有我一直用来获取这个答案的数字的色轮。

奖励2:以上所有内容都假设对什么是暖色、什么是冷色进行主观评估。我认为客观测量色温的唯一方法是测量它并用温标表示。开尔文似乎经常被使用。该测量不仅考虑颜色的深浅,还考虑其亮度(或发出的光量)。如果您有一台现代显示器,它可能有一个温度设置,其中有一些开尔文值可供选择。只要您知道白色(白平衡)的温度,就可以计算显示器上每种 RGB 颜色的温度。不过这个计算很复杂,我不知道该怎么做。您可能会发现 Bruce Lindbloom 是获取更多信息或任何有关色彩科学的书籍的良好来源。但我想这超出了你对你的问题的讨价还价......;-)

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

初心未许 2024-10-18 06:59:15

在我看来这

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

是一个非常好的近似值。您可以使用以下方法在色轮上检查这一点:
http://www.colorzilla.com/firefox/

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/

野却迷人 2024-10-18 06:59:15

已经回答但需要添加:

如果您对物理温度和颜色依赖性感兴趣,那么这就是您正在寻找的比例:

黑体温度颜色

这是给定温度的黑体发出的光的颜色。在天文学中,这用于恒星颜色分类(如 BV 颜色索引)。

它还可用于间接温度测量。

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.

原来是傀儡 2024-10-18 06:59:15

我发现这些参数令人满意

对于暖色:

  • R 从 128 到 255
  • G 从 0 到 128
  • B 从 0 到 R

对于冷色:

  • R 从 0 到 B
  • G 从 0 到 255
  • B 从 128 到 255

请注意,高绿色使得颜色更冷(在我看来,但这是有争议的^^),这就是为什么它仅限于暖色而不是冷色。

I've found these parameters satisfactory

For Warm color :

  • R from 128 to 255
  • G from 0 to 128
  • B from 0 to R

For Cold color :

  • R from 0 to B
  • G from 0 to 255
  • B from 128 to 255

Note that high green makes the color more cold (in my view but that's debatable ^^), that's why it's restricted for warm colors but not for cold ones.

故事还在继续 2024-10-18 06:59:15

暖色有更多的红色,
而冷色则有更多的蓝色。

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
}

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
}

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
}
暮年慕年 2024-10-18 06:59:15

简单而准确:

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

其中“RED”代表数组a中红色通道的索引。

这是有效的 - 您可以通过以下方式亲自查看:(a) 查看 Fabian Fagerholm 的第二个轮子和/或 (b) 转到以下链接,并将杆向上和向下移动到两个温暖的末端。

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

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/

虫児飞 2024-10-18 06:59:15

对于我来说,下面的计算包含饱和度,给出了更好的结果。由于完全去饱和的颜色(如黑色、白色和灰色)被视为中性颜色。

        if (hueAngle == 90 || hueAngle == 270 || (hueAngle == 0 && saturation == 0))
        {
            isWarmColor = false;
            isCoolColor = false;
        }
        else if (hueAngle > 90 && hueAngle < 270)
        {
            isWarmColor = false;
            isCoolColor = true;
        }
        else
        {
            isWarmColor = true;
            isCoolColor = false;
        }

For me below calculation, with the inclusion of saturation, gives a better result. Since fully desaturated colors like Black, White and Gray are considered neutral colors.

        if (hueAngle == 90 || hueAngle == 270 || (hueAngle == 0 && saturation == 0))
        {
            isWarmColor = false;
            isCoolColor = false;
        }
        else if (hueAngle > 90 && hueAngle < 270)
        {
            isWarmColor = false;
            isCoolColor = true;
        }
        else
        {
            isWarmColor = true;
            isCoolColor = false;
        }
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文