New Face! → ← Screensaver-ish
Color Manipulation
Seems easy, just get one color of paint and mix it with another! BINGO!
Unless, of course... you want to generate a random palate of shades of a single color. And then, complimentary colors of that color. Now there's an interesting challenge for someone who isn't a mathematician. Understand Hexidecimal? What about RGB values converted 8 bit integers? I don't. But lucky for me there are hundreds of people who do.
This article by Ammon Lauritzen gave me a bit of insight on how the RGB values relate to Hex. There is also an article on Brendan's page that I thought was useful. I then added methods to move the colors lighter or darker and it is surprisingly easy. And finally, to get a complimentary color, this is the best place to do it. They give you generalized code to put into whatever language you want! I had to tweak it obviously, to get it to work with AS. But, not very much.
Here is an example of the class in use. Using a color palate of the same tones with 10 colors from a random Hex color each time a new cross is spawned. The faces then get colored faces that make it seem as if there is light. I know the performance is garbage, I need to add a more robust object pooling system.
Another Example of this class at work. This one uses 4 layers as you can see.
- Color Palate generated from one color
- The Complimentary colors of the palate on the color wheel
- harmony colors, at least according to the algorithm.
- and.. inverse colors
Click on the page to re-generate the colors from a new random color.
If you play around with this class, you can come up with some pretty amazing color schemes that are completely generated. Have fun!
PS.. Feel free to add to my class or make it faster with bitwise opperations, but please tell why and what you've done so I can learn as well.
- Chris
02:26 PM | 1 CommentComments
- DY33Odry on December 29, 2009, at 04:23 PM











