Document created by cheesus on Feb 27, 2018
Version 1Show Document
  • View in full screen mode

Hi everyone!


As I recognized some users like to play around with the look of their software. In some cases this might even make sense (besides enjoying colorful changes on the screen), for example when you have a multi company solution where you want to make it visibly clear in which of the companies the user is working at the moment. Unfortunately in FMP there is no scriptable way of changing design themes (yet?). So I came up with a simple old-school solution for this: A container field with a colored pixel graphic in it.


My goal was to let the user freely choose, whatever color he wants to use. To achieve this I combined a javascript based color picker (introduced by Matt Petrowski) with a Bitmap encoding technique by Excellisys. My only achievement was to combine these two techniques and wrap it up in a single demo file.


What it does:

With this technique you can easily (let your user) change the background color of a solution. Just click "Setup" and then use the Color Picker to change the color of the theme.


How it works:

A Javascript based Color Picker in a webviewer returns a RGB value of the selected color. This color is being Base64 encoded into a 1x1 pixel bitmap image that is stored in a global container field, which serves as a background image.


How big is the background image?

The 1x1 px image has only 70 Byte! So there's no need to worry about the performance.


How can I implement it into my solution?

1. Copy the 2 custom functions.

2. Create a new table called "GUI".

3. Copy the fields from the GUI table into your solution.

4. Insert the content of the 3 ColorPicker Global Fields (needed for the webviewer).

5. Copy the Script "Change Color" to your solution.

6. Copy the Webviewer to your Solution.


Hopefully it's of use for somebody. Have fun with it. Feel free to copy.