为什么我们总是将 RGB 值除以 255? [英] Why do we always divide RGB values by 255?

查看:79
本文介绍了为什么我们总是将 RGB 值除以 255?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么我们总是将 RGB 值除以 255?我知道范围是从 [0-1].但是为什么只潜水 255 呢?谁能解释一下RGB值的概念?

Why do we always divide our RGB values by 255? I know that the range is from [0-1]. But why dive only by 255? Can anyone please explain me the concepts of RGB values?

推荐答案

RGB(红、绿、蓝)各为 8 位.
每种颜色的范围是 0-255(因为 2^8 = 256 种可能性).
组合范围为256*256*256.

RGB (Red, Green, Blue) are 8 bit each.
The range for each individual colour is 0-255 (as 2^8 = 256 possibilities).
The combination range is 256*256*256.

通过除以 255,0-255 的范围可以用 0.0-1.0 的范围来描述,其中 0.0 表示 0 (0x00),1.0 表示 255 (0xFF).

By dividing by 255, the 0-255 range can be described with a 0.0-1.0 range where 0.0 means 0 (0x00) and 1.0 means 255 (0xFF).

这篇关于为什么我们总是将 RGB 值除以 255?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆