Discussion:
How to set background color of style to null
m***@gmail.com
2014-04-14 20:35:58 UTC
Permalink
Hi there,

The subject is poorly worded, but here's what I'm looking for. I set STYLE_DEFAULT properties and then call SCI_STYLECLEARALL. I then add back my custom styles as needed. This works well, but my back color for STYLE_BRACELIGHT is showing as the STYLE_DEFAULT back color which I'd expect. However, if I've called SCI_SETCARETLINEVISIBLE(true) I'd like the back color of any brace highlighting on the current line to match what I've set for SCI_SETCARETLINEBACK. I've tried playing with SCI_SETCARETLINEBACKALPHA without success. Is it possible to set a null back color and have whatever back is drawn by other styles (STYLE_DEFAULT, STYLE_BRACELIGHT) to come through?

Thanks,
Michael
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/d/optout.
Neil Hodgson
2014-04-14 23:29:47 UTC
Permalink
Post by m***@gmail.com
The subject is poorly worded, but here's what I'm looking for. I set STYLE_DEFAULT properties and then call SCI_STYLECLEARALL. I then add back my custom styles as needed. This works well, but my back color for STYLE_BRACELIGHT is showing as the STYLE_DEFAULT back color which I'd expect. However, if I've called SCI_SETCARETLINEVISIBLE(true) I'd like the back color of any brace highlighting on the current line to match what I've set for SCI_SETCARETLINEBACK. I've tried playing with SCI_SETCARETLINEBACKALPHA without success. Is it possible to set a null back color and have whatever back is drawn by other styles (STYLE_DEFAULT, STYLE_BRACELIGHT) to come through?
The brace highlight back colour receives precedence as some people use the default foreground colour but a distinctive background colour for brace highlighting so would not be able to see the highlights easily if the caret line colour was dominant.

SCI_SETCARETLINEBACKALPHA overdraws the whole line after the text and backgrounds have been drawn so should be less jarring. Use a strong colour with a low alpha for this - say #008000 with alpha 63 and a light brace highlight style background like #CCCCFF.

If you don't like the alpha approach, use http://www.scintilla.org/ScintillaDoc.html#SCI_BRACEHIGHLIGHTINDICATOR

Neil
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/d/optout.
m***@gmail.com
2014-04-28 18:53:35 UTC
Permalink
If you don’t like the alpha approach, use
http://www.scintilla.org/ScintillaDoc.html#SCI_BRACEHIGHLIGHTINDICATOR<http://www.google.com/url?q=http%3A%2F%2Fwww.scintilla.org%2FScintillaDoc.html%23SCI_BRACEHIGHLIGHTINDICATOR&sa=D&sntz=1&usg=AFQjCNGTN1bc4rbWgYD-6lKQ9k4-lwmtyw>


Excellent, thanks! I find the indicators to be very appealing, visually.
I'll play with this.
Post by m***@gmail.com
The subject is poorly worded, but here's what I'm looking for. I set
STYLE_DEFAULT properties and then call SCI_STYLECLEARALL. I then add back
my custom styles as needed. This works well, but my back color for
STYLE_BRACELIGHT is showing as the STYLE_DEFAULT back color which I'd
expect. However, if I've called SCI_SETCARETLINEVISIBLE(true) I'd like the
back color of any brace highlighting on the current line to match what I've
set for SCI_SETCARETLINEBACK. I've tried playing with
SCI_SETCARETLINEBACKALPHA without success. Is it possible to set a null
back color and have whatever back is drawn by other styles (STYLE_DEFAULT,
STYLE_BRACELIGHT) to come through?
The brace highlight back colour receives precedence as some people use
the default foreground colour but a distinctive background colour for brace
highlighting so would not be able to see the highlights easily if the caret
line colour was dominant.
SCI_SETCARETLINEBACKALPHA overdraws the whole line after the text and
backgrounds have been drawn so should be less jarring. Use a strong colour
with a low alpha for this - say #008000 with alpha 63 and a light brace
highlight style background like #CCCCFF.
If you don’t like the alpha approach, use
http://www.scintilla.org/ScintillaDoc.html#SCI_BRACEHIGHLIGHTINDICATOR
Neil
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/d/optout.
Loading...