-
Game Master
paletteMap color program [f8]
Hi, I've been trying to make a coloring system where users can take bitmaps and change them into the color of there choice. I remembered the paletteMap function which had an example of changing a bitmap square from green to red and from red to green so I figured I could use this.
(doc for paletteMap: http://livedocs.adobe.com/flash/8/ma...=00001962.html)
I have to say though I know nothing about this function or much about colors for that matter. I tried this at first...
PHP Code:
mc.onPress = function() {
var redArray:Array = new Array(256);
var greenArray:Array = new Array(256);
var blueArray:Array = new Array(256);
for(var i = 0; i < 255; i++) {
redArray[i] = color;
greenArray[i] = color;
blueArray[i] = color;
}
myBitmapData.paletteMap(myBitmapData, new Rectangle(0, 0, 100, 40), new Point(0, 0), redArray, greenArray, blueArray, null);
}
The variable color was equal to the hexadecimal value of the color chosen by the user. The function above, however, did not work. It changes the bitmap into weird colors, not the ones that were chosen and I have no idea why.
I've been messing around with it for some time now. Does anyone know what I could do?
Last edited by ConnELITE; 12-04-2007 at 09:40 PM.
BC
-
Game Master
oh yeah, I forgot to mention I'm using flash 8.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|