A few days ago, I wrote about how to access the named colors in OpenLaszlo 4.2.0. (Where Have All the Colors Gone?) I even wrote a little example showcasing the colors in the lz.colors array. Then Tucker helpfully directed me to a very complete example in the documentation that showed not only the location of the colors, but also a better way of setting colors.
The W3C provides a list of standard CSS colors, and OpenLaszlo now allows you to use those color names as strings when setting colors.
So in addition to being able to say:
… and of course:
… what’s new is that you can also say:
Notice that the color name is a string, not a variable. Finally, you can also use the pound (#) notation when setting colors in script:
Note that when using pound notation, the color value must be a string.