From bf5745b95ca0a0edfb0b1129835f0e48c20ef6fa Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Mon, 13 Jul 2015 23:23:53 +0200 Subject: fixed default colors in color.tes and style Q-Register view * the RGB values of the 8 standard colors defined by color.tes were wrong (i.e. did not correspond to the normal 8 color codes defined by Scinterm but only the bright versions). Except for `color.black` which referred to terminal color 0. * now we define the 16 colors defined by Scinterm, allowing color schemes to explicitly use bright color versions without using the bold attribute. On 8 color terminals, the bold attribute might still be the only way to get a bright color. * terminal.tes: Use bright default color instead of relying on bold to get bright color versions. This is especially important for comments which where relied on bold black to be rendered grey. This did not work by default on terminals supporting bold fonts (e.g. OS X Terminal) or GTK+. The scheme now works on more terminals out of the box and on GTK+ and is thus a good default color scheme. * Color schemes will now also define the default style, the line number style and caret foreground/background. `color.calltip` is now also defined for STYLE_CALLTIP and can later be used to style SciTECO's custom popup widget. --- lib/color.tes | 56 ++++++++++++++++++++++++++++++++++++------------- lib/colors/terminal.tes | 40 ++++++++++++++++++++++------------- lib/lexer.tes | 4 +--- 3 files changed, 68 insertions(+), 32 deletions(-) (limited to 'lib') diff --git a/lib/color.tes b/lib/color.tes index 9648b55..633df8c 100644 --- a/lib/color.tes +++ b/lib/color.tes @@ -1,22 +1,50 @@ -! n:M.c -- Get one of the 8 basic colors ! -@.c{ - U.c ((Q.c&1)*255) # ((Q.c/2 & 1)*255*256) # ((Q.c/4 & 1)*255*256*256) +! M[color.rgb] -> Scintilla color ! +@[color.rgb]{ + U.bU.gU.r + (Q.r # Q.g*256 # Q.b*256*256) } -! Save the 8 basic colors, may be referenced by the color schemes ! -0:M.cU[color.black] -1:M.cU[color.red] -2:M.cU[color.green] -3:M.cU[color.yellow] -4:M.cU[color.blue] -5:M.cU[color.magenta] -6:M.cU[color.cyan] -7:M.cU[color.white] +! These 8 colors should be available on every system ! +000,000,000:M[color.rgb]U[color.black] +128,000,000:M[color.rgb]U[color.red] +000,128,000:M[color.rgb]U[color.green] +128,128,000:M[color.rgb]U[color.yellow] +000,000,128:M[color.rgb]U[color.blue] +128,000,128:M[color.rgb]U[color.magenta] +000,128,128:M[color.rgb]U[color.cyan] +192,192,192:M[color.rgb]U[color.white] -! <[[bold,]bg,]fg,style>M[color.set] ! +! Light color variants, might not be available on every terminal ! +064,064,064:M[color.rgb]U[color.lblack] +255,000,000:M[color.rgb]U[color.lred] +000,255,000:M[color.rgb]U[color.lgreen] +255,255,000:M[color.rgb]U[color.lyellow] +000,000,255:M[color.rgb]U[color.lblue] +255,000,255:M[color.rgb]U[color.lmagenta] +000,255,255:M[color.rgb]U[color.lcyan] +255,255,255:M[color.rgb]U[color.lwhite] + +! <[[flags,]bg,]fg,style>M[color.set] ! @[color.set]{ U.s U.f "~0'U.b "~0'U.h Q.f,Q.sESSTYLESETFORE Q.b,Q.sESSTYLESETBACK - Q.h,Q.sESSTYLESETBOLD + Q.h&1,Q.sESSTYLESETBOLD + Q.h&2,Q.sESSTYLESETITALIC +} + +! Reset all styles and setup the standard ones ! +@[color.init]{ + ! Default text colors ! + :M[color.default],32M[color.set] + ESSTYLECLEARALL + :M[color.linenumber],33M[color.set] + Q[color.caretfore]ESSETCARETFORE + Q[color.caretline]ESSETCARETLINEBACK + 1ESSETCARETLINEVISIBLE + ! Calltips and popup windows ! + :M[color.calltip],38M[color.set] + ! Set up brace lightning ! + :M[color.bracelight],34M[color.set] + :M[color.error],35M[color.set] } diff --git a/lib/colors/terminal.tes b/lib/colors/terminal.tes index 6303e27..b78da3f 100644 --- a/lib/colors/terminal.tes +++ b/lib/colors/terminal.tes @@ -1,22 +1,32 @@ ! Default terminal color scheme ! -[color.comment] 1,Q[color.black],Q[color.black]  -[color.number] 0,Q[color.black],Q[color.cyan]  -[color.keyword] 1,Q[color.black],Q[color.white]  -[color.string] 0,Q[color.black],Q[color.green]  -[color.string2] 1,Q[color.black],Q[color.green]  -[color.preproc] 0,Q[color.black],Q[color.magenta]  -[color.preproc2] 1,Q[color.black],Q[color.magenta]  -[color.operator] 0,Q[color.black],Q[color.yellow]  -[color.variable] 1,Q[color.black],Q[color.blue]  -[color.error] 1,Q[color.black],Q[color.red]  +[color.default] 0,Q[color.black],Q[color.white]  +[color.linenumber] 0,Q[color.black],Q[color.white]  +Q[color.black]U[color.caretline] +Q[color.white]U[color.caretfore] + +[color.calltip] 0,Q[color.lblue],Q[color.black]  + +[color.comment] 1,Q[color.black],Q[color.lblack]  +[color.number] 0,Q[color.black],Q[color.cyan]  +[color.keyword] 1,Q[color.black],Q[color.lwhite]  +[color.string] 0,Q[color.black],Q[color.green]  +[color.string2] 1,Q[color.black],Q[color.lgreen]  +[color.preproc] 0,Q[color.black],Q[color.magenta]  +[color.preproc2] 1,Q[color.black],Q[color.lmagenta]  +[color.operator] 0,Q[color.black],Q[color.yellow]  +[color.variable] 1,Q[color.black],Q[color.lblue]  +[color.error] 1,Q[color.black],Q[color.lred]  ! Makes only sense for Makefiles ! -[color.target] 1,Q[color.black],Q[color.yellow]  +[color.target] 1,Q[color.black],Q[color.lyellow]  ! Makes only sense for Patch/Diff files ! -[color.deletion] 0,Q[color.black],Q[color.red]  -[color.addition] 0,Q[color.black],Q[color.green]  -[color.change] 0,Q[color.black],Q[color.yellow]  +[color.deletion] 0,Q[color.black],Q[color.red]  +[color.addition] 0,Q[color.black],Q[color.green]  +[color.change] 0,Q[color.black],Q[color.yellow]  ! For highlighting braces ! -[color.bracelight] 1,Q[color.white],Q[color.black]  +[color.bracelight] 0,Q[color.white],Q[color.black]  + +! Style the Q-Register view ! +[* EQ.b :M[color.init] ]* diff --git a/lib/lexer.tes b/lib/lexer.tes index 535c83c..af89c0e 100644 --- a/lib/lexer.tes +++ b/lib/lexer.tes @@ -8,9 +8,7 @@ } @[lexer.auto]{ - ! Set up brace lightning ! - :M[color.bracelight],34M[color.set] - :M[color.error],35M[color.set] + :M[color.init] [_ :Q*"= Oend ' } -- cgit v1.2.3