KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Programmatically changing the color of rectangles
PRODUCT: 4D | VERSION: 13.1 | PLATFORM: Mac & Win
Published On: November 20, 2012

To have the ability to programmatically change the color of a rectangle object the default properties cannot be used; the Fill Color property must be changed. By default, Fill Color is set to None. To be able to change the color programmatically, Fill Color should either be set to a color or to Automatic as shown below.



Once Fill Color is no longer set to None, the color can be change programmatically. Here is an example of how the rectangle object color can be changed to the color chosen from the color picker:

$rgbColor_l:=Select RGB color(0)
OBJECT SET RGB COLORS(*;"Rectangle";$rgbColor_l;$rgbColor_l)


Note: This Technical Tip applies to Round Rectangle and Oval objects as well.