123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|724|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> Art and Sound -> mapping an 8bit palette?

Mon, 06 Aug 2007, 06:23
spinal
heres something thats been bothering me for all of two hours now, For my current DS project I want to use a single 8bit palette, so I decided on the standard 'web safe' 216 colour.

now I'm stuck on how to use it. I have the colours mapped to a single array,
pal[0]=black
pal[215]=white
pal[5]=red
pal[30]=green
pal[180=blue
etc.
like this -


I want to access it something like-
Colour = Red + (Green * something) + (Blue * something)

I'm sure this is possible, but I can't quite get my head around it...

Can anyone help?

|edit| I realize this drops my colour accuracy down to 6:6:6, but I get a better range of colours.

-=-=-
Check out my excellent homepage!
Mon, 06 Aug 2007, 06:55
Jayenkai


Tada!

You should be able to tweak this for 8-bit/DS/C usage.

-=-=-
''Load, Next List!''
Tue, 07 Aug 2007, 04:53
spinal
HeHe it popped into my head while I was at work.

I need to drop mey R,G,B values from 0-31 down to 0-5, dividing by5 will do this.

then

index= R+(G*6)+(B*30)

I was only after the 3rd-last line

-=-=-
Check out my excellent homepage!