0
$\begingroup$

RGB colors are selected by 3 selectors: Red, Green, and Blue. Each of these can be between $0$ and $255$.

So (and I'm sure this is some kind of permutation but I can't put my finger on the actual math involved) I was wondering exactly how many choices this is, and what is the math that goes along with it.

[0-255],[0-255],[0-255]

EXs:

0,5,2

52,215,65

etc etc

$\endgroup$
2
  • $\begingroup$ Are you asking how many "colors" you can specify using 256 values per color channel? $\endgroup$
    – user251257
    Commented Mar 22, 2016 at 18:46
  • $\begingroup$ There are $256^3$ possible choices, that is, $2^{24}$. $\endgroup$ Commented Mar 22, 2016 at 19:02

1 Answer 1

1
$\begingroup$

The answer is quite simply $$256 \cdot 256 \cdot 256 = 256^3=16777216$$

Edit: $256$, not $255$. Need to include $0$.

$\endgroup$
3
  • 1
    $\begingroup$ Be careful, though. Because the range for each color RGB is $[0,255]$, there are $256$ choices for each. $\endgroup$ Commented Mar 22, 2016 at 18:47
  • $\begingroup$ Yeah, my mistake, I realised as soon as I posted $\endgroup$
    – J. Bush
    Commented Mar 22, 2016 at 18:47
  • $\begingroup$ That's so interesting to me because a lot of color pickers make it so you can click to select, each of those little boxes have 16 million choices, and that's insane. $\endgroup$ Commented Mar 22, 2016 at 18:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .