Lesson Details

Author: Trevor DeVore
Last Updated: 18 Jan 17:04

Tags

Revolution
1 comment for this lesson

Creating a Color Picker Swatch

Learn how to make a color picker swatch.

Create a Graphic

Media_1200684504386_display

Select the Graphic tool (1) and draw a square graphic on a stack.

Edit the Script

Media_1200692397838_display

Open the script editor for the graphic and enter the script shown below.

The script uses the answer color dialog to display the system color picker (1). The backgroundcolor of the graphic is passed in as the default color to display in the color picker (2). The color the user selects is then assigned to the background color of the graphic (3).

The Script in Action

Media_1200692569392_display

Clicking on the graphic will now display the color picker.

Media_1200692221395_display

Choose a new color and click OK.

Media_1200692225720_display

The graphic is now assigned the new color.

Comments (1)

Arthur Pinkerton June 08, 2008 12:52

Awesome, tanks Trevor. I always wondered how you guys were having a select color picker in the app.

Thanks again. I am going to live in these tutorials for awhile as a newbie to rev.

Add your comment

Are you human?