Link | pk_hextorgb |
Author | Pier Kuipers |
Category | String |
Version | 8.x |
License | Public Domain |
Posted | 10 Jan 2006 |
Updated | 16 Jan 2006 |
More by this author... |
Tag accepts a HTML hexadecimal colour value such as "#f45a49" or "#FFF" and converts it to a space delimited RGB value such as "255 255 255".
[pk_hextorgb:'#fff'] -> 255 255 255
Click the "Download" button below to retrieve a copy of this tag, including the complete documentation and sample usage shown on this page. Place the downloaded ".inc" file in your LassoStartup folder, restart Lasso, and you can begin using this tag immediately.
(uppercase); if: (#myhex -> size == 3); local:'temphex'=string; loop: 3; #temphex += (#myhex -> get:(loop_count)); #temphex += (#myhex -> get:(loop_count)); /loop; #myhex = #temphex; else: (#myhex -> size > 6) || (#myhex -> size < 6); #myhex = 'ffffff'; /if; loop: 6; if:!(#hexvalues -> contains:(#myhex -> get:(loop_count))); #myhex = 'ffffff'; /if; /loop; local:'rgbstring'=string; local:'looparray'= (: 1, 3, 5); iterate: #looparray, local:'tmp'; local:'mydecimal'=(#hexvalues -> find:(#myhex -> get:(#tmp))); local:'tens'=((integer:(#mydecimal - 1)) * 16); local:'ones'=(integer:(#hexvalues -> find:(#myhex -> get:(#tmp + 1)))); #rgbstring += (string:(#tens + (#ones - 1))) + ' '; /iterate; #rgbstring -> trim; return:#rgbstring; /define_tag; /if; ?>
No comments
©LassoSoft Inc 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft