Gradient fill (or shading) example
A gradient fill has two endpoints, and the color changes gradually and evenly as you move from one endpoint to the other. Here is a simple example showing a gradient fill of a rectangle:
Gradient fill button operation
In the Quick Editor > Shading tab are a number of buttons. They have two positions -- on or off. In the "On" state they become darker to show they are selected. "Off" -- they are lighter. This makes more sense if you think of the "On" button as depressed and so in more shadow than an unselected one. (But is the reverse of some other buttons you may have seen.)
Color endpoint buttons
The first two buttons are labeled 1 and 2, for color 1 and color 2, the colors of the two endpoints. The color 1 button will become active when the shading supports 2 colors -- anything other than a flat color.
If they are labelled Cnt (Contrast) and Brt (Brightness), it may be because you may have an image selected -- they don't allow gradient fills. Try making a title like our "Shaded Title" just above.
To set the endpoint colors, select a button, either 1 or 2, then adjust the sliders for the color to associate with that endpoint.
Fill-type buttons -- Flat, Lin Cyl and Rad
Below the color endpoint buttons, are four more buttons. You can select only one at a time:
- Flat flat: A single color as shown in the Quick Editor examples above and below (Color 1 button is inactive)
- Lin linear: The color changes from one end to the other
- Cyl cylindrical: The color changes from the middle outwards, along the horizontal axis.
- Rad radial: The color changes from the center outwards
Create a title like the Shaded Title above and try these buttons, while adjusting the color sliders. These are also called RGB sliders, short for for Red, Green, Blue.
The bottom slider, Trans, is used to adjust transparency. Use it to adjust the transparency of either or both colors 1 and 2.
For color adjustment, use the left/right keyboard arrows to nudge the slider, type the values into the adjacent edit box or use the eyedropper.
For linear and cylindrical shading, adding 90.00 or 270.00 degrees of rotation to the object via the Quick Editor > Object tab will change the direction of the graduation -- shown in the examples above.
Other options are 180.00 degrees of rotation to provide a complete reversal of the graduation. This has a similar end result to using the Flip button in the Quick Editor > Shading tab.
Transparency for images
Transparency for shapes
Color picker eyedropper
The eyedropper that shows in the Quick Editor > Shading tab (and is often grayed out) is a feature that is shared by the Text editors. To use the color picker eyedropper:
- Click on the eyedropper button and drag it to a color anywhere on your screen that you want to copy
- While you drag, the background to the eyedropper button will change to the color under the eyedropper
- When you drop, the object selected, or any text you type will take on the new color.
Multiple custom colors
The color dialog (e.g. Quick Editor > Shading tab > Pick) is a Windows standard, used in many other programs. It acts the same there too. It is fairly easy to use, but it is not clear how to select more than one custom color.
To set custom colors:
The trap is that if the triangular slider is set "no luminance" (slider at its lowest) you can click anywhere in the large color window and nothing seems to happen. Any hue at zero luminance is black!
- Click the button Define Custom Colors
- Click the custom color box you want to change -- it should have a little rectangle around it
- In the large color window on the right, click the hue you want
- This changes the vertical color band at the far right showing the luminances of that hue
- Move the triangular slider to the luminance you want or click in the vertical color band
- The box marked Color|Solid should change as you do these steps
- Click Add To Custom Colors
You can set a sequence of custom colors by looping through the steps 2 to 7. Each Add To click will fill out the next custom color in sequence -- continuing on from the color box selected in Step 2.
More examples of gradient fills
The first two examples also show rotation.
In the Gradient fill section, we discussed using the controls in the Quick Editor > Shading tab. Create a polygon like the arrow polygon on the left; then:
- Select the Linear Shading button on the Quick Editor > Shading tab
- Set Color 1 to Red=155, Green=210, Blue=155
- Set Color 2 to Red=155, Green=200, Blue=240
Select the Quick Editor > Outline tab. Adjust the Line Width and color:
- Set the Width slider to give an outline width of 2
- Set the RGB sliders to R=145, G=180, B=150
Adding transparency makes an object look transparent by letting some of the background show through:
- Create a black title like the Flat Shaded Title above
- Select the Quick Editor > Shading tab
- The title has a color already assigned to it: black
- Adjust the Transparency between 0 and 100 to see the effect
- Select Linear shading and adjust the color 1 and color 2 transparency settings
- Move the title so that it is on top of a blue rectangle like that on the right.
Adding transparency to an image
When you have an object that is running diagonally across your screen, you may see jagged edges. This is called aliasing -- if you have a sharp transition between two colors, your computer has to choose one or the other. It is possible to smooth out the transition by adding some extra pixels of intermediate colors around the transition. This is called anti-aliasing, and we're about to do it right now:
Rendering is the act of drawing objects on your screen. Re-rendering is the act of modifying an object in some way, then drawing it again. In practice, this means that the re-rendered object will require an image file in order to be displayed.
One common application of re-rendering is to make a permanent group of two or more related images, then place re-render on for the group. This produces one larger image file instead of two or more smaller files -- often more economical. The shadowed title at the top of this page has this treatment.
For more complicated shapes as we have been using here, re-rendering on or off makes no difference to the resulting image file -- one is always produced.
However, for straight flat-color rectangles, if you put Anti-Alias and Re-Render off, no new image file is produced.
If Include Background is on, (Options > Project Options) anything in the background will be drawn into the picture to simulate transparency. In two cases you can't turn Include Background on:
If Include Background is off, the background will be not be drawn into the picture. One of two things will happen instead:
- For GIF the background, one color, will be truly transparent.
- For PNG 32, the background colors will always show through the transparent sections of the image. So there is no need to simulate transparency.
- If the format is one that supports transparency (PNG or GIF) then the background will be truly transparent
- If the format does not support transparency (JPG or BMP) then the background will be filled with whatever color is set for the Page Background.
Image format and transparency
PNG 8 and GIF are the only formats that can use transparency that will work on all browsers. Regular PNG (PNG 24) does support transparency but since not all browsers respect it, we do not use it that way. PNG 32 supports 256 levels of tranparency.
PNG 8 and GIF are 8 bits-per-pixel formats. That means they can only have a maximum of 256 colors so you may see some loss of color on larger images.
If you import a full color image and then change it to GIF or PNG-8, WebDwarf will choose the best 256 colors. That will minimize the loss of color.
For GIF and PNG 8, true transparency won't show until you preview or publish. Preview and look at the images against the bricks and see how they differ from their workpage appearance. In each case, the image immediately below is an exact clone -- an identical image using the same image file.
Notice the improvement with PNG 32 on the right.
PNG 8 and GIF show an issue with anti-alias too. The bottom images are anti-aliased against a white background, so pick up a halo of white around the logo part of the image. This is not a problem when the same image is used against a pale background. However, when placed against a much darker background, the bricks in this case, the anti-alias shows. If this is a problem, one solution is to use another anti-aliased image, this one anti-aliased against the colored background.
Another solution is to use the PNG 32 format.
- Create a rotated title like one of those on the left
- Open the Quick Editor > Object tab
- Make sure the Anti-Alias box is checked. You can see the effect of anti-aliasing in the workpage by checking and un-checking the High Render box
- When High Render is selected, the workpage may appear sluggish on slower machines. It is OK to work with high render off. It affects only your workpage -- it has no effect when you publish or preview
- Turn High Render off and rotate the rotated title observing the aliasing jaggies. Turn High Render on to see the effect of anti-aliasing.
The downside of anti-aliasing is that it can make smaller objects look fuzzy. If in doubt, try it both on and off -- pick the one that give the best results.
Also, you are anti-aliasing against a particular background, often white -- you may have problems if you then use the same image against a colored background. Example.