Adding custom colors to your PowerBuilder palette

Have you ever noticed the sixteen “Custom” selections in the dropdownlist for any of the color properties?

In this list, you can select one of twenty “base” colors (Black, White, Sky, Cream, etc.), or you can select a color that’s linked to the current Windows theme (Button Face, Menu Text, Inactive Title Bar, etc.)   The dynamic selections will automatically change in your app whenever the user changes their Windows appearance in the Control Panel.  Figure 1 shows the selection list and the (mostly) empty custom color choices.

Color property selections

Color property selections

As you can see, most of the custom selections are blank!  How do you assign a custom color to those entries?

The answer is the menu selection Design > Custom Colors…, as shown in figure 2 below.

Windows custom color selection dialog

Windows custom color selection dialog

There’s a lot going on in this dialog.  You can select one of the predefined colors in the grid, or you can create your own by dragging the “bullseye” pointer inside the color pallette, and then using the contrast slider.  If you know the RGB/HSL values, you can enter them directly in the boxes.

The process of adding a custom color to the pallette is the following:

  • Click on one of the empty white boxes in the “custom colors” grid;
  • Design the color you want with the sliders or the edit boxes;  
  • Click the “Add to Custom Colors” button.

The new color is then assigned to the empty box, and it’s supposed to be added to the dropdown list in PowerBuilder.  However, PowerBuilder doesn’t see the new color in the selection list until you exit and restart the IDE.   The color list is kept in the PB.INI file, and we all know that changes to the PB.INI file are not immediately reflected in the IDE.


About Paul Horan

Software Technology - lots of experience with Sybase and IBM mobility/cloud offerings.
This entry was posted in PowerBuilder, Software and tagged , , . Bookmark the permalink.