DCUL7, Color handling

  • The DCUL7 is capable of showing 256 colors at the same time, selectable from a larger range of 4096 colors. The set of 256 shown colors is called a color table, or palette. The palette can be set in the CONFIG: element, where you also define the display resolution and some other parameters. Here in entry "ColorTable:", you can give a file name with the color palette to use (extension .PAL).


    In the default configuration, the palette is set as given in the file COLORL5L7.pal. This is the same file as COLOR256.pal, but the name shows better the fact, that this is the same color table on the DCUL7 as on our DCUL5, which had a fixed, non-modifiable set of colors. These 256 colors are built from using 8 levels of red and green and 4 levels of blue. By looking at the color number, the color intensities can directly be seen:


    7 6 5 4 3 2 1 0 Bit of color number
    B B G G G R R R Color


    For example Color 192 (=0xC0) is full blue, Color 56 (=0x38) is full green and Color 7 (=0x07) is full red. To make life with the color numbers a little bit easier, we have provided some files defining names for the most common colors. Therefore if you add a line


    #include "COLOR256.DSF"


    somewhere at the beginning of your script file, then you can use the name "RED" instead of 7, "GREEN" instead of 56, "BLUE" instead of 192, and so on. So these DSF-files don't define the color palette, they are only for convenience.


    However the full color capability of the DCUL7 is 16 intensity levels of each Red, Green, and Blue, building a set of 4096 colors. You can chose any subset of 256 colors you like. Suppose you want to show your company logo and the logo needs many shades of blue. Then you can create your own palette that contains more blue combinations and less other colors than in the default palette.


    You have to follow these steps:


    1. Create a PAL-File with your new palette. This is done by copying an existing .PAL file and then editing the entries of the new file with the BMP converter program BMPCNV.EXE/BMPCNV2.EXE.


    2. Use this new file in the ColorTable: entry in CONFIG:


    3. (Optional) Define the colors you need most with some #define statements near the beginning of your script. For example build your own COLORxxx.DSF file and include it.


    We recommend using defined names instead of color numbers to make future changes easier. For example if you need two different background colors, one standard and one for warning purposes, you could add these two entries:


    #define BGnormal 0xFF // white
    #define BGalert 0xA7 // bright red


    Now when you use BGnormal and BGalert in really all cases where background is involved, you can exchange the color of your whole application by simply modifying these two lines.


    Some last hints for Terminalmode:


    In Terminalmode, you can't use names. You have to give the color number to the commands <ESC>7 and <ESC>8. However you can modify color table entries at runtime with the command <ESC>9<n>,<r>,<g>,<b>,. For example


    <ESC>97,0,255,0,


    will set color number 7 to green. I.e. in the default color table, color 7 will not show red anymore, but green instead. This will have immediate impact on all currently visible pixels of color 7. For example if you had a rectangle in color 7 on your display, it will immediatley change its color from red to green after this command. This might be interesting for some color effects as the color unfortunately can not be given as a variable.


    Regards
    F&S Support Team

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.