newLISP Fan Club

Forum => newLISP newS => Topic started by: cormullion on November 21, 2008, 04:29:25 PM

Title: Rainbow code
Post by: cormullion on November 21, 2008, 04:29:25 PM
I was fascinated by the discussion this week on code colouring - enough to want to try out various schemes for myself... So I've whipped up a quick newLISP-GS app for exploring them via HTML styles. Basically I've quickly merged two projects to produce this one:



//http://unbalanced-parentheses.nfshost.com/downloads/rainbow-code.lsp



It's very much a hack, and prone to crashing, but you may find it fun...



I'd be interested to see it running on your machine...?!



(PS: If you're not using a UTF8 system, you may have to replace the utf8len functions with length...)
Title:
Post by: newdep on November 22, 2008, 01:30:03 AM
Nice work cormullion... ;-)



The code does run here, partly ;-)

...first time i saw the unicode catch, Though I cant update the color

fields...everytime I type a new color it resets to the old value...



if you type this in the input field ->

9870987098709870987098709870987097890870978.....etc..

it moves to -1 in the output field, not a bug probably a format issue...



Ill have a closer look in the code... ;-)
Title:
Post by: cormullion on November 22, 2008, 01:48:21 AM
Oh rats... I was hoping it would run OK on someone else's machine...



Any input in all but the first field (font-size) should be truncated to six chars and prefixed with a #.



It's supposed to look like this:



(//%3C/s%3E%3CURL%20url=%22http://unbalanced-parentheses.nfshost.com/data/images/rainbow.png%22%3E%3CLINK_TEXT%20text=%22http://unbalanced-parentheses.nfshost.c%20...%20ainbow.png%22%3Ehttp://unbalanced-parentheses.nfshost.com/data/images/rainbow.png%3C/LINK_TEXT%3E%3C/URL%3E%3Ce%3E)



Perhaps it's a locale issue?



Sorry!
Title:
Post by: m i c h a e l on November 22, 2008, 12:55:03 PM
Works fine here :-)



(//%3C/s%3E%3CURL%20url=%22http://www.neglook.com/images/rainbow-code.png%22%3Ehttp://www.neglook.com/images/rainbow-code.png%3C/URL%3E%3Ce%3E)



m i c h a e l
Title:
Post by: cormullion on November 22, 2008, 04:00:29 PM
Phew, thanks. I'm not completely mad, then...:)