[Laszlo-dev] [Platform-team] lz.colors question

Max Carlson max at openlaszlo.org
Thu Nov 13 18:16:02 PST 2008


You should be able to just set it to bgcolor="lz.colors.iceblue4" - 
constraints shouldn't be required.  Also note that colors aren't in 
global[] anymore - use lz.colors[''] instead.

J Crowley wrote:
> So, I'm working on fixing one of the color dguide examples.  The 
> description on the doc page (docs/developers/color.html) reads:
> 
> -----
> 
> To specify any color but the 16 which are usable by name, use 0xFFFFFF 
> hex codes. Alternatively, the non-standard colors named in 
> |lps/components/base/colors.lzx| were added to OpenLaszlo's global 
> namespace. Those colors can also be employed by name, but note the 
> ${constraint} syntax around the bgcolor specification. There are two 
> ways to make the constraint: |bgcolor="${global['iceblue1']}"| is the 
> same as |bgcolor="${iceblue1}"|.
> 
> -----
> 
> The example this describes is:
> 
> -----
> 
> <canvas debug="true">
> <simplelayout axis="x" spacing="10"/>
> 
> <class name="box1" width="100" height="100" bgcolor="${global['gold4']}" />
> 
> <class name="box2" width="100" height="100" bgcolor="${iceblue1}" />
> 
> <box1 id="sun">
>    <text text="Sun"/>
> </box1>
> 
> <box2 id="mystic">
>    <text fgcolor="0xFFFFFF" text="Mystic"/>
> </box2>
>   </canvas>
> 
> -----
> 
> Thing is, the only way to get the example to work is to change 
> bgcolor="${iceblue1}" to bgcolor="${lz.colors.iceblue1}", and trying to 
> use the global['gold4'] syntax doesn't actually work.  So my question 
> is:  Is the description in the documentation wrong?  Because doing it 
> the way the description states results in a Debugger error.  (Keep in 
> mind I'm using the docs on openlaszlo.org, since I can't build locally, 
> so if the description has already been changed, let me know and I won't 
> file the bug, but I do need to fix the example.  What I need to know 
> then is, what is the new way of doing this?)
> 
> Thanks!
> Josh
> 

-- 
Regards,
Max Carlson
OpenLaszlo.org


More information about the Laszlo-dev mailing list