Sequential colors

here is a script that allows a random color to be displayed, how do I alter the script to make it not random but, sequential from white through all the colors to black. Here is the script:

onEnterFrame = function () {
myCol = Math.round(Math.random()*Math.pow(6, 16));
beginFill(myCol, 50);
moveTo(100, 100);
lineTo(200, 100);
lineTo(200, 200);
lineTo(100, 200);
lineTo(100, 100);



white… through all the colors… to black … you mean grayscale?

sorry, man!

no, I want it to be rgb.


so where do white and black fit in?
Colors exist in a 3D space. Hue, Brightness and Saturation. There is no linear movement that will go through them all. You can go through RGB fine enough but this will be at 100% brightness and 100% saturation - pure color. White is any color with 100 bright and 0 sat, black being any color and any sat @ 0 bright. (there are of course other color models you can use) … but the point is, there will be some variation in your cycling, so you’ll have to be a little more specific in how you want it to cycle :slight_smile:

What if I use the Hexidecibel number… I think that is what it is called… #FFFFFF, #FFFFCC all the way to #000000. Am I able to do that?

I guess I should let you know what I am trying to do. Joshua Davis made this effect on load of image that would reveal colors of am image on load. So I though if I had a mask that would run through the colors, then when a certain color was loaded it would reveal the color that is it mask by switching the alpha from 0 to 100. Here is the site that I saw the effect.

click on the view installation section.



where has senocular gone!!! :puzzle:

masks dont differentiate between color. They just show or hide things based on shape. Theres no way to single out a specific color and just show that.

In terms of hexidecimal numbers, they still represent colors - the same colors I was talking about before. It you just went down the line from FFFFFF to 000000 youd get a lot of random colors with only portions of smooth graduation from one color to the next. You need a path to travel if you are to travel a path.

Davis’s Vibe piece didnt use masks. Nor did it use the color object at all. There, you just have a photo of a car which was traced and made into about a 1000 or so movieclips and then had those movieclips removed and or placed on the screen over a period of time.