Color Logic – loading multiple Color schemes

    Appropriate use of color in an application can not only improve its appeal but help in its adoption and understanding. QlikView provides the flexibility to define colors for many elements but in doing so it can be tricky to keep track of what colors have been used, and a lengthy process to change the palette if a new scheme is required.

    Imagine how great it would be to change the palette by simply loading your palette and selecting the required theme from a list box? By defining the colors by labels and defining the values in the load you wont have to look up previously used RGB settings or change every object when you want to change the scheme. This is a really simple method which can be extended once you’re used to it.

    This is how it’s done

     

    Img1.png

    • Create an Excel Sheet with required RGB or ARGB values against each of the Color Labels you want to use. I specify Colors1-18 for the charts and some basics such as Caption Colors, Highlights, BarBackgrounds. I use the HidePrefix ‘_’. I also prefer to define the Theme Names as columns (easier for copy/paste from palette creation websites like IWantHue) and transpose during the Load.
    • Include your ColorTheme load in the script.  Remember to use Transpose to switch column/row if necessary. Set HidePrefix=’_’ so these colors don’t clutter your field listing.

    Img2.png

    • Make your _ThemeName list box available (usually on a hidden sheet) and ensure there’s Always One Selected Value
    • Use your colors in your application as Calculated values with the easy terminology $(=_CaptionColor)
    • I’ve used the Advanced Color Map in the chart to define all the colors as calculated values. Remember to update your default so you can Retrieve it anytime

    Img3.png

    • Don’t forget the ability to double-click on Format Painter to keep it active whilst you update all your other objects to utilize the calculated colors you’ve just setup

     

    That’s it!  It takes less time than you think (certainly no more than typing in RGB values). And once established you can enjoy seeing your apps in a new light at the flick of a selection.

    Img4.png

     

    Extending this to multiple palettes

    Once established you can have a number of palettes loaded and use Set Analysis or setup Alternate States (my preferred method) to help you pick colors from the required scheme

    $(=$(=only({<_ThemeName={'BlueTheme'}>}_Dark)))

     

    $(=$(=only({BlueTheme}_Dark)))

     

    Color…Fast

    Having a range of palettes available without having to redefine them can dramatically improve your productivity as there is no need to constantly lookup required colors.

    You can set different themes for intensity, such as Dark, Medium, Light so that the same colors can be referenced with differing saturation. This is useful when you want to keep colors consistent across dimensions but use the higher intensity for fine point charts or thin bars where they would be difficult to see otherwise, medium intensity for bars or to highlight values, and light when the data is supportive but color still has meaning.

    You can use them to quickly pick out the correct colors for the ColorMix wizard, perhaps to setup TeamA ColorMixed from Dark to Light in the {BlueTheme} but use {RedTheme} for TeamB.

     

    It becomes a simple matter of picking your palette and the reference, rather than searching for the RGB value.