Color with the graphics object
mcstar
Posts: 144
I'm looking for some help with getting color to work well on the Graphics object using the TV output.· I've been grappling with trying to get correct colors in the correct place.· Right now I've got some simple sprites defined using a syntax like
wall··················· word
······················· byte··· 1,8,0,17
······················· word··· %%00003300
······················· word··· %%33303330
······················· word··· %%33003300······
······················· word··· %%33303330
······················· word··· %%30003303
······················· word··· %%33303333
······················· word··· %%33003030
······················· word··· %%30000030
This is being displayed with a call to gr.pix(...., @wall)
This is just an adaption of the "dog" from the default graphics demo.· Right now the '0' displays as a black pixel and the 3 displays as a white one.·· A 1 and a 2 display·shades of ·grey pixels.·· If I set gr.color() to a value like $9C then I get colors like blue-green, white and grey.· My question is, how would I display the colors I want for this sprite?· For instance, I'd like the 0's to be maroon and the 3's to be tan, is there a way to do this?·
It appears that 0 is a tranparent pixel, is this correct?
·
wall··················· word
······················· byte··· 1,8,0,17
······················· word··· %%00003300
······················· word··· %%33303330
······················· word··· %%33003300······
······················· word··· %%33303330
······················· word··· %%30003303
······················· word··· %%33303333
······················· word··· %%33003030
······················· word··· %%30000030
This is being displayed with a call to gr.pix(...., @wall)
This is just an adaption of the "dog" from the default graphics demo.· Right now the '0' displays as a black pixel and the 3 displays as a white one.·· A 1 and a 2 display·shades of ·grey pixels.·· If I set gr.color() to a value like $9C then I get colors like blue-green, white and grey.· My question is, how would I display the colors I want for this sprite?· For instance, I'd like the 0's to be maroon and the 3's to be tan, is there a way to do this?·
It appears that 0 is a tranparent pixel, is this correct?
·
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chip Gracey
Parallax, Inc.
It sounds like I need to define my own colors for the tiles. How do the longs map to specific colors? Can I just "And" the color values from the graphics pallete demo? In other words, how do I change the %01 value?
BTW Chip, thanks for all the hard work in make the Propeller a reality. I enjoy programming it more than C#!
I'm not sure I understand your question about ANDing. When the graphics.spin object affects pixels, it writes both·bits in a pixel at the same time to affect its color. It doesn't do any masking within a pixel, although it does mask 2-bit pixel pairs as it performs read-modify-write operations on your pixel data.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chip Gracey
Parallax, Inc.