KristofferC / OhMyREPL.jl

Syntax highlighting and other enhancements for the Julia REPL
https://kristofferc.github.io/OhMyREPL.jl/latest/
Other
768 stars 60 forks source link

Changing colors of Rainbow Brackets #61

Open DNF2 opened 7 years ago

DNF2 commented 7 years ago

Is there some way to change the colours used for Rainbow Brackets? The current selection seems optimized for dark themes, but is suboptimal (too bright) for light themes:

screen shot 2017-03-24 at 09 59 00

KristofferC commented 7 years ago

I was a bit lazy and did not include such an option when I implemented it. The colors used are defined at https://github.com/KristofferC/OhMyREPL.jl/blob/9996301fdfc43fb1029e18162d7e9b5bb55d0f2b/src/passes/RainbowBrackets.jl#L50 so you can easily change them there. Of course, a nice interface is needed but I don't think I will be able to get to that in a while.

MarcMush commented 4 years ago

Similar problem, I wanted to have superfluous brackets in red but no rainbow brackets, this is my solution :

using OhMyREPL

let OPR = OhMyREPL.Passes.RainbowBrackets
    OhMyREPL.enable_pass!("RainbowBrackets", false) # disable rainbow brackets

    # enable error color brackets without rainbow brackets
    ERROR_RAINBOW_TOKENS = OPR.RainBowTokens([OPR.Crayon()],[OPR.Crayon()],[OPR.Crayon()], 
                                             OPR.Crayon(foreground = 196))
    OPR.add_pass!(OPR.PASS_HANDLER, "ErrorBrackets", 
                  OPR.RainbowBracketsSettings(ERROR_RAINBOW_TOKENS, 
                                              ERROR_RAINBOW_TOKENS, 
                                              ERROR_RAINBOW_TOKENS), 
                  false)
end