Defining colors

defining colors

Colors are defined in the color tabs of the element properties dialogs. For example, in a text element, the Pen tab displays the controls needed to define the inner color of the text element.

Since version 6.19.05.02 colors can be linked to a field of a data source. See below Linking a color to a field for more information

The color definition tabs enable you to define a solid color (a single solid color with no fading) and a fading color (two fading colors supporting opacity).

Note:
The Fading mode will be available only when applicable. For example, in the case of a barcode foreground color it will not be possible to set a fading color. In these cases the Solid/Fading button will not be visible.

The Solid and Fading working modes display the following controls:

Solid: a color selection area is positioned in the top section: by clicking it, you will select the color on which the mouse cursor is positioned.
To the right, the brightness bar enables you to change the color range of the color selection area.
In the lower section, the Red, Green and Blue text boxes enable you to manually enter the RGB values that define the color (valid values range from 0 to 255).
The lower rectangle displays the selected color.

Fading: when in this working mode, the dialog box is split into two identical sections; each of which enables you to define one of the two colors that will be combined into the desired fading effect.
In the upper part of each section, you will find the color selection area, the brightness bar and the opacity bar, that enable you to define an opacity value between 0 and 255 (where 0 is completely transparent and 255 completely opaque).
Each of the two sections displays the RGB text boxes and the opacity text box.
You can copy one color definition to the other by clicking the « and » buttons.
The lower section of the dialog box displays the preview area showing the chosen combination. To its right are found the controls that enable you define the fading angle. Again, you can manually enter a value (between 0 and 359.9 degrees) or use the scroll bar.

Note:
by right-clicking the color preview box, a popup menu is displayed that enables you to copy, paste, and reset the color to its default value.


LINKING A COLOR TO A DATA FIELD

Since version 6.19.05.02 any color of any element can be linked to a data field enabling you to have variable colors on the same element, as it gets replicated in each position of the data set.

For example, you may define in your underlying data that a text will have a specific color only for certain records.

To connect a field to a color, simply select the field name from the combobox found in the color tab of that element or select a field from the sub-menu found in the various ribbon menus.

When the color of an element is associated to a field, Labeljoy will try to read the value found and convert it to a color.

Note:
When Labeljoy is not able to convert the value read from the data source to a valid color, it will use the default color defined in the corresponding menu (or color tab in the editor windows).

Labeljoy can convert to color the following 6 possible types of value:

  • X11 color names: common HTML color names such as Black, White, MediumSlateBlue etc will be properly converted to a solid color. See here for a complete list.
  • CSS colors: RGB color in the typical 6-digit hexadecimal notation preceded by the # sign. For example: #FFFFFF, #80CCBB, etc.
  • Web-safe colors: 3-digit hexadecimal notation, preceded by the # sign. For example: #333, #A53, #F2A, etc. See here for a complete list.
  • Integer value: A numeric integer value in the range between 0 and 16,777,215. Typically used in programming languages, RGB values are multiplied to form a unique value.
  • Labeljoy palette: 40 string values between LJ01 and LJ40 will be converted to the corresponding Labeljoy palette color, as they appear in the "Quick color" section of the menu items found on the ribbon.
  • Labeljoy complex format: it is possible to define fading, alpha-blended colors by using a special Labeljoy notation. It's made up of 9 comma separated values in the format R1,G1,B1,A1,R2,G2,B2,A2,Angle where the *1 values reppresent RGB-Alpha value for color 1, the *2 values represent RGB-Alpha values for color 2 and Angle the angle at which the fading takes place.
    Valid values for RGBA members are 0 to 255 and valid values for the Angle element are 0 to 359.
    For example: a valid entry is 128,255,48,96,80,96,50,220,90 which tells Labeljoy to create color 1 with R=128, G=255, B=48, Alpha 96, color 2 with R=80, G=96, B=50, Alpha=220 and the colors are faded with a 90 degrees angle.
  • Transparent: regardless whether the field data type is numeric or textual, the value -1 (negative one or 0xFFFFFFFF) will be converted to transparent.

Note:
Any numeric, date/time and string field could potentially hold a value that Labeljoy may interpret as a valid color. It is up to the user to properly select the field with the most relevant information.