{"id":210,"date":"2009-03-16T17:23:36","date_gmt":"2009-03-17T01:23:36","guid":{"rendered":"http:\/\/www.antunkarlovac.com\/blog\/?p=210"},"modified":"2009-03-16T17:23:36","modified_gmt":"2009-03-17T01:23:36","slug":"why-i-should-rtfm","status":"publish","type":"post","link":"https:\/\/www.antunkarlovac.com\/blog\/2009\/03\/16\/why-i-should-rtfm\/","title":{"rendered":"Why I should RTFM"},"content":{"rendered":"<p>A few days ago, I wrote about how to access the named colors in OpenLaszlo 4.2.0. (<a href=\"\/blog\/2009\/03\/12\/colors-in-42\/\">Where Have All the Colors Gone?<\/a>) I even wrote a little example showcasing the colors in the lz.colors array. Then <a href=\"http:\/\/pt.withy.org\/ptalk\/\" target=\"_self\">Tucker<\/a> helpfully directed me to a <a href=\"http:\/\/labs.openlaszlo.org\/trunk-nightly\/docs\/developers\/color.html#csscolors\">very complete example in the documentation<\/a> that showed not only the location of the colors, but also a better way of setting colors.<\/p>\n<p>The W3C provides a <a href=\"http:\/\/www.w3.org\/TR\/css3-color\/#svg-color\">list of standard CSS colors<\/a>, and OpenLaszlo now allows you to use those color names <em>as strings<\/em> when setting colors.<\/p>\n<p>So in addition to being able to say:<\/p>\n<pre>myView.setAttribute(\"bgcolor\", lz.colors.cornflowerblue);<\/pre>\n<p>&#8230; and of course:<\/p>\n<pre>myView.setAttribute(\"bgcolor\", 0x6495ed);<\/pre>\n<p>&#8230; what&#8217;s new is that you can also say:<\/p>\n<pre>myView.setAttribute(\"bgcolor\", \"cornflowerblue\");<\/pre>\n<p>Notice that the color name is a string, not a variable. Finally, you can also use the pound (#) notation when setting colors in script:<\/p>\n<pre>myView.setAttribute(\"bgcolor\", \"#6495ed\");<\/pre>\n<p>Note that when using pound notation, the color value must be a string.<\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>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 &hellip; <a href=\"https:\/\/www.antunkarlovac.com\/blog\/2009\/03\/16\/why-i-should-rtfm\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Why I should RTFM<\/span><\/a><!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2,3],"tags":[],"_links":{"self":[{"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/posts\/210"}],"collection":[{"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/comments?post=210"}],"version-history":[{"count":2,"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/posts\/210\/revisions"}],"predecessor-version":[{"id":212,"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/posts\/210\/revisions\/212"}],"wp:attachment":[{"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/media?parent=210"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/categories?post=210"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/tags?post=210"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}