Home > Articles

This chapter is from the book

Creating Custom Colors and Gradients

Conveniently, Macromedia has incorporated the Web-safe color palette into the swatches in Flash. Often, however, you may need to use a color located on a different swatch, or you may want to create gradients using your own color choices.

Therefore, we'll take a look at a couple of panels in Flash. The first is the Color Swatches panel; the second is the Color Mixer panel. Each can be used to select different colors; however, the Mixer panel gives you precise control over certain color properties.

Color Swatches

In the Color Swatches panel, shown in Figure 3.25, you can sort colors, load different swatch sets, and even load bitmap graphics. To import different swatch sets, click in the top-right corner of the Color Swatches panel to access the drop-down menu. Choose Add Colors, find a Flash color set file (typically located in your Flash MX program folder), and select it. This will add any additional swatch sets to the panel. However, if you choose Replace Swatches, all existing swatches will be replaced with the new loaded set.

If you've added and arranged this panel in a way that feels comfortable to you, consider making it the default. In the submenu, choose Save as Default so that every time you open Flash, these color swatches will be loaded in the panel.

However, if you feel that the swatch set you've customized is good only for certain occasions, you can simply save that swatch set as a swatch. In the submenu, choose Save Colors, which will launch the Export Color Swatch window. Name the color set and save it in an easily accessible location, such as in the Flash program folder under \en\First Run\Color Sets.

Figure 3.25Figure 3.25 The Color Swatches panel.

Color Mixer

The Color Mixer panel is a bit more robust in comparison to the Color Swatches panel. Notice how much the Color Mixer panel offers in Figure 3.26.

Figure 3.26Figure 3.26 The Color Mixer panel.

The Color Swatches panel is best for accessing stored colors. The Color Mixer panel, on the other hand, is used in customizing colors and gradients. After you've created these custom colors, you can store them in the Color Swatches panel. Therefore, these two panels work well together.

At first glance, you'll see that the Color Mixer panel has a nice color ramp from which you can choose colors. As you take a closer look, you should also notice the many different ways to come up with certain colors.

By default, you can type in numbers for the red, green, and blue (RGB) values. This can be useful, especially if you're working with a graphics application such as Fireworks or Photoshop to create artwork. If you need to match a certain color element in that graphic, you can get an RGB or HSB readout in the other program and type those values into this swatch. You can easily change the RGB values to display hue, saturation, and brightness by choosing the appropriate option in the Color Mixer's submenu.

Accessing Custom Colors Using the Color Picker

Here are the steps to follow to access custom colors using the Color Picker:

  1. Open the fill swatch and choose the color wheel in the top-right corner of the palette. This will open the Color Picker dialog box. In Windows, the Color Picker dialog box looks like an overgrown Color Mixer panel. You have the color ramp, where you can select a custom color and even add that custom color to a custom swatch within the dialog box. The Mac, however, is quite different. (Notice that on the Mac, if you move the dropper away from the color swatches, you can sample any color on your computer screen.) You can see the Mac RGB Color Picker in Figure 3.27.

  2. Figure 3.27Figure 3.27 The RGB Color Picker on the Macintosh.

  3. By default, the RGB Color Picker will appear. In this dialog box, you can choose a color by moving the percentage sliders from left to right. Moving them to the right will increase the amounts of the corresponding colors to higher percentages.

  4. Move the Red slider to 100%.

  5. Move the Green slider to 0%.

  6. Move the Blue slider to 0%. Notice the color difference between the original color and the new color. The end result is a pure red. Often you'll need to refer to some numbers generated during content development so that you can match certain pieces or areas of artwork.

  7. Figure 3.28 shows the Name Color Picker window on the Macintosh.

    Figure 3.28Figure 3.28 The Name Color Picker on the Macintosh.

  8. Move the slider next to the color ramp to reveal a selection of colors.

  9. Choose the desired color. Notice that all these colors have a corresponding hexadecimal value. These hexadecimal values are Web-safe colors. A Web-safe color is a color commonly shared between a Macintosh and a Windows machine if you drop them down to their lowest 256, 8-bit color display. There are only 216 Web-safe colors.

  10. Figure 3.29 shows the HSV Color Picker window on the Macintosh.

    Figure 3.29Figure 3.29 The Hue, Saturation, and Value (HSV) Color Picker on the Macintosh.

  11. Choose a color by clicking anywhere on the color wheel.

  12. Use the slider on the right to adjust the brightness.

CAUTION

If you are new to Web development, be aware that even though 216 colors are commonly shared between the Mac and Windows operating systems, a Mac's colors are generally brighter, and the Windows colors are commonly darker. However, using Web-safe colors seems to be less and less an issue with modern-day machines displaying well over a million colors.

The slider underneath the color wheel will adjust the value. Moving the crosshairs around in the color wheel will adjust the hue angle as well as the percentage of the saturation.

The Crayon Color Picker allows you to choose a color with a specific name. These colors are not necessarily Web-safe colors. The Crayon Color Picker offers an assortment of nicely organized, easy-to-find colors as shown in Figure 3.30.

Figure 3.30Figure 3.30 The Crayon Color Picker on the Macintosh.

The CMYK section is a color mixer that uses the common four-color print process of cyan, magenta, yellow, and black. As mentioned earlier, Web-safe colors are becoming less of an issue. However, you could find yourself in a situation in which your company wants a CMYK color to be used throughout its Web site. Commonly, this happens with logos. To keep in line with company standards, you may choose to use the exact colors printed in the logo. Ultimately, this will result in a consistent look throughout the Web site. Refer to Figure 3.31 for the CMYK Color Picker.

Figure 3.31Figure 3.31 The CMYK Color Picker on the Macintosh.

Changing a Color's Alpha

A great feature of Flash is the ability to change the alpha of a color. The Alpha setting controls how opaque or how transparent a color will be. The default is set to 100% but can be lowered all the way down to 0%. This can be useful in animations—perhaps you'd like an object to fade in or out, or you may want an item to cross over another item, in which case you may want to see the item underneath.

To change a color's alpha, choose the desired color in the fill swatch. Next, use the slider to the right of the Alpha field to lower the percentage of the alpha. You may also type in a value in the Alpha field. The lower the alpha percentage, the more transparent the color will become.

After the color has been set, you can use this new transparent color just as you would any other color. In fact, you can even save it in the swatch set.

Saving a Color to a Swatch

It's quite simple to save any custom color you've created or selected. With the custom color in the fill or stroke swatch selected, move your cursor into the Color Swatches panel. When your cursor is in an empty area of the swatch, it turns into a Paint Bucket tool. Click an empty area and notice that the color has been added to fill the empty area with the selected fill color. You can also add a color by choosing a color in the Color Mixer panel, activating the submenu, and choosing Add Swatch.

TIP

With all these options in the Color Mixer, you may find yourself with many custom colors. After you've added these colors to the Color Swatches panel, it may be a good idea to save them as a swatch.

Modifying and Creating Gradients

The Color Mixer panel is an area where you can modify existing gradient colors by changing, adding, or deleting the colors that make up any given gradient. When you have a gradient selected in the fill swatch, notice the new options in the Color Mixer panel.

In Figure 3.32, the drop-down menu contains choices for a radial gradient and a linear gradient. Also, take note of the new color ramp for the gradient. Each triangle marker in the ramp is a color that will be represented in the gradient. If you're working with a simple two-color gradient (for example, from white to black), these two colors will gradually intersect one another.

Figure 3.32Figure 3.32 The Color Mixer panel with a gradient as the active fill.

Modifying a Color Gradient

Here are the steps to follow in order to modify a color gradient:

  1. Draw a circle with no stroke and a radial gradient selected for the fill.

  2. To change the gradient's colors, highlight one of the markers in the gradient ramp located in the Color Mixer panel.

  3. With the triangle selected, open the Ink Well tool above the ramp in the Color Mixer panel and choose a new color. Notice that the gradient is automatically updated.

  4. Select the other marker and change its color as well.

  5. To edit this gradient further, you can add even more color by adding additional markers to the gradient ramp. To create a new midrange color in the gradient, simply click in an empty area just underneath the gradient ramp. Notice the new marker with a midrange color.

  6. Change the new marker's color by using the Color Picker tool in the Color Mixer panel.

  7. You can add as many new markers as necessary to achieve the desired effect. To remove any unnecessary markers, click and drag them down and away from the color ramp.

  8. When the gradient is complete and you feel you might use the new gradient color later down the road, you may want to save it in your Color Swatches panel. Select the submenu in the Color Mixer panel and choose Add Swatch.

NOTE

Be sure to check out the instructional QuickTime movie on how to create custom gradients located on this book's companion Web site, http://www.samspublishing.com.

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020