
question from @evyatar2013 : > Correct me if I’m wrong, but I couldn’t find a direct way to play with the font of individual characters - so making the raindbow brackets in drracket would require more clever scripting on my part

Yeah, the easiest way to try it out would be in slideshow or metapict. But in any case I was merely joking—I don’t expect it to be clear to read and won’t even scale to more than 3 or 4 levels anyway.

I think @evyatar2013 is after a way to access the colourer from quickscript but it is not clear to me that is possible without changing the colourer

Oh, I misread a little, I was thinking of the sine brackets :face_with_rolling_eyes:
The colorer is a very different beast, I’m not even sure a full DrRacket plugin can tweak it directly.The closest I could find is (<file:///usr/share/racket-7.7.0.4/doc/framework/Color.html?q=font-color#%28def._%28%28lib._framework%2Fmain..rkt%29._color~3aget-parenthesis-colors-table%29%29\|color:get-parenthesis-colors-table>)

but it’s only for reading, no writing.

Yes the colourer is on my todo list for adding hyperlinks to embedded links but I’m wondering if I can add a hook to it so it can be called by plugins/quickscript ?

@evyatar2013 At least you can highlight portions of the text with a chosen color. For example this script highlight the selection in yellow: #lang racket
(require quickscript)
(define-script highlight
#:label "highlight"
(λ (selection #:editor ed)
(send ed highlight-range
(send ed get-start-position)
(send ed get-end-position)
"yellow")
#f))

There are also a few methods to navigate s-expressions (I can dig them up if you want)

But changing the colors of parenthesis as they are being type would need to change the colorer itself, which I think is not plugin-friendly yet.

Maybe @robby would have a better idea though

@robby has joined the channel

You could have a keyboard shortcut bound to your script that rehighlights all the parenthesis of the previous s-exp for example

You would need to interact with the colorer, yes, and either override methods (which I guess you cannot do with quickscript) or maybe better would just be to add that functionality to DrRacket via a pull request to racket/gui!

There is something like it; you can get the subranges inside in different shades or grey or blue via the preferences dialog.

Which methods would need to be overwritten? I’m planning to add hooks in Quickscript at some point

I’m not sure.

For rainbow parentheses I guess a script isn’t the thing to do first. Probably first is to support rainbow parentheses in the colorer and then add hooks to that a script can do things like change the set of colors

Gonna look this up