보통 css를 작성시 color: rgb(number, number, number)에서 number값을 넘겨 색상을 정한다. 여기서 numbers는 0~255까지 넘길수 있는데 왜 0에서 255 까지인지 궁금해 졌다.
The way that computers do this is that they have lots of little switches in their memory which we call bits. Bits can only have one of two values, a one or a zero. Bits are arranged into groups of eight switches called bytes.
0) 컴퓨터 메모리의 가장 작은 유닛을 bit이라 한다.
1) 하나의 bit은 0, 1 값만 있고 이렇게 두가지의 값중 하나만 저장 할수 있다.
2) 1 byte은 8 bits로 구성되어 있다.
2x2x2x2x2x2x2x2 = 256
쉽게 말하면 1byte은 256가지의 다른 값을 가질수 있다는 말이다.
그치만 컴퓨터 프로그래밍에선 숫자는 0부터 시작하니 0-255로 사용 되고 있다.
256x256x256= 16777216
16777216가지 종류의 값을 얻을수 있다.
css에서도 컴퓨터 공학의 기초를(?) 알게되는 좋은 기회 였다.
Source: Goldsmiths University BS.cComputer Science 과정