On Feb 21, 2006, at 1:58 PM, James Howe wrote:
I ran into this recently. I was writing a library (to render serialized GraphViz graphs) that was supposed to work in both OpenLaszlo and DHTML. But the OpenLaszlo <drawview> element only accepts numbers (such as 0xff0000), and the WHATWG 2d context only accepts strings (such as "#ff0000", "#f00", or "red"). I ended up (1) writing a quick-and-dirty CSS parser, and (2) patching <drawview>. You can get them both from http://osteele.com/sources/_javascript_/drawview-patches.js. The CSS parser is cssColorToLong. The rest of the file shows how to patch LzDrawView to accept CSS color strings. You could use a different (simpler) technique to patch LzView: add the line "c = cssColorToLong(c)" to the beginning of the definition of setColor in WEB-INF/lps/lfc/views/LaszloView.as, and similarly for setBGColor. Best, Oliver |
_______________________________________________ Laszlo-user mailing list [email protected] http://www.openlaszlo.org/mailman/listinfo/laszlo-user
