[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/vr/ - Retro Games

Search:


View post   

>> No.2454218 [View]
File: 47 KB, 225x350, 1375883660322.jpg [View same] [iqdb] [saucenao] [google]
2454218

>>2454204
Sorry, I'm not being very clear because I'm trying to do several things at once.

Color is defined as a 16-bit number. The bits are layed out as I wrote:

-BBBBBGGGGGRRRRR

with the far right being the 0th bit and the far right being the 15th bit. So really every RGB color component has only 5-bits of information, or 2^5 = 32 possible choices. With 3 5-bit color components you have 2^15 = 32768 colors choices. The last 15th bit is unused.

If you work in the decimal range 0-100, the conversion the Red component, say, is something like: floor(decimal*32/100);

If you work in the hex range 0-255, then: floor(hex*32/255);

As long as you specify what number system you're working in and give the RGB components, I can map the color palette np.

Navigation
View posts[+24][+48][+96]