Using colors with Graphics.spin and TV.spin?
sourcedriver
Posts: 1
Hi, I'm a propeller newbie primarily interested in generating TV signals.
I am able to run the Graphics_Demo and I have begun modifying that code a bit to understand what is happening.
So far I find the drawing graphics primitives to be pretty intuitive but I can't for the life of me understand how to change colors.
I have read whatever I could find in both TV.spin and Graphics.spin but I just don't get it.
I would really appreciate it if anyone is willing to give me a more detailed explanation of the following points:
1. how each color long is composed
2. Why and how they are stored in the _colors array
3. What values I should pass to the gr.color() command to change colors before drawing
Thanks!
I am able to run the Graphics_Demo and I have begun modifying that code a bit to understand what is happening.
So far I find the drawing graphics primitives to be pretty intuitive but I can't for the life of me understand how to change colors.
I have read whatever I could find in both TV.spin and Graphics.spin but I just don't get it.
I would really appreciate it if anyone is willing to give me a more detailed explanation of the following points:
1. how each color long is composed
2. Why and how they are stored in the _colors array
3. What values I should pass to the gr.color() command to change colors before drawing
Thanks!
Comments
The above link is a nice intro to the Parallax reference drivers.
http://propeller.wikispaces.com/Colors
That one contains a table of color values and a screen shot of what they look like, on NTSC television systems.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!
Read through that sample PDF. Essentially, there are 4 colors per tile area. Each tile is pointed to the HUB memory, from the screen array. Each tile color set is defined in the colors array.
So, you need to find which element in the color array is the one that controls your tile, then set the colors accordingly. There is one byte per color, 4 colors per long! Those bytes are in the wiki table I referenced above.
Hope that helps.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!
http://www.rayslogic.com/propeller/Programming/TV_Colors.htm
and here:
http://www.rayslogic.com/propeller/Programming/GraphicsDemo.htm
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!