Yet Another Selection Colours Question?
-
Howdy.
I believe I have a new issue with this. 'Been up all night trying to figure this out, as I don’t remember it being this way at all. Here’s my situation:
Updated to v8.7 and going through the transition I find that the dreaded Selected Text Colour is acting very strange. The background color is opaque and has become the foreground,; covering the selected text completely. Can’t see what I’m selecting. v7.8.2 didn’t do this.
I’ve tried:
- NppExec codes
- Python codes
- Lua codes
- enableSelectFgColor.xml 0-byte file
- All of them at once
- Even tried sticking fgColor= code into the styles.xml file
Nothing makes a difference.
All I can do is see that the text to be selected has gone behind the selection block and then copy/paste/whatever. If there are other strings in the file that happen to match what I’m selecting Smart Highlighting makes that easier, but that isn’t exactly the way to go.
Any ideas? I’m shot.
Thanks for looking at this. -
If you look in Settings > Style Configurator > Language:
Global Styles
, can you find all of Style =Selected text colour
,Multi-selected text colour
,Caret colour
, andMulti-edit carets colour
? If not, yourstylers.xml
orthemes\____.xml
for your active theme is out of date. (My post here may be relevant to you.) If your stylers.xml/theme.xml is out of date, the User Manual now has a section on keeping themes up to date; and I have a script for the PythonScript plugin that I shared in “Config Files Need Updating, Too” which will help automate updating your stylers/themes.Also, there are known issues with the plugins CSV Lint and Compare Plus – and others may have a similar problem as well – as was discussed in the full “No text on selected line” discussion: in the screenshots in the first post there, you can see that the selection actually caused the text to be hidden, even though the Style Configurator had values for a normal selection. If you share your ? > Debug Info, we could see if you are using one of the known-problematic plugins. If you don’t have “CSV Lint” or “Compare Plus” plugins, you might want to follow the steps in this FAQ to narrow down which plugin might be the culprit (assuming that there is a plugin interfering).
-
Thanks, Peter. I’ll check those out.
I do see all of the Language: Global Styles, Style = choices asked about.
I am using ComparePlus. Quite a lot, actually, so not exactly happy about either/or.
-
@PenskeGuy said in Yet Another Selection Colours Question?:
I am using ComparePlus
I use ComparePlus as well, and it doesn’t cause me a problem; as that other thread has said, ComparePlus has solved their issue, but you might not have the most recent version 1.2.0 – so if you are using ComparePlus, check to make sure you have the most recent copy.
-
ComparePlus is v1.2.0
-
It might still be some other plugin, so still follow the which-plugin-is-culprit line of thought.
Also, you might want to grab a portable copy of Notepad++ from the official download page, and unzip into a folder on your desktop or somewhere else you can find, and see if you still have the problem in that portable copy – if you don’t, then the problem is probably in one of the config files – possibly still a difference in stylers.xml or whichever theme you are using.
Or maybe you’ve just set an incompatible color on one of those styles (maybe your selected-text-background color matches your foreground color on something; and if it’s just set that way, the fix is for you to set it differently.)
If none of these help you, you’ll probably need to come back with screenshots of what exactly you mean by “background color is opaque”
-
Portable is what I usually default to in any application if available, so already on that here.
Theme is default. Most of the themes would be fine if the font brightness could be better adjusted. Usually they’re too dim for easy coding, so I just stick with a light theme with some tweaks.
Here’s a screen grab.
Set the “background” color to a nifty shade of red for clarity.
The color is correct as set, but it either isn’t in the background or it isn’t able to be seen through to reveal the type. You can see that this is really not an efficient way to work.Interesting thing is that after all of the attempts to enable the foreground color option it did become active and I could set colors in it. But they had no import in the editor.
-
Found It!
Your mention of plugins was a good call. During the research I had remembered seeing a post regarding ExtSettings:
https://community.notepad-plus-plus.org/topic/23852/text-selection-color-is-gone-since-a-few-updatesFirst I disabled the plugin completely and got this:
Exactly the result another poster had been looking for. Reversed-out text.
WoooHo0o!Then I nuked the ExtSettings.ini file, like it said in the post, and re-enabled the plugin. Initially it looked like the ini file was the culprit. Nothing changed when Notepad++ re-opened. So I went in to reset my preferred settings. But when the settings dialog is open the field acts differently than when it is closed. Nothing was changing because the plugin hadn’t written its inifile yet. When the dialog closed, it all went back as before - completely covered again.
But with some tweaking of the plugin selection settings I got this:
Not as legible by far. The alpha setting controls the entire field together; foreground and background So there is no contrast adjustment when trying to get reversed-out type. The whole field gets more or less transparent together. Go more dense and the type begins to disappear in the green; heading right back to completely swallowing the type. Go less dense and the type gets whiter but the green gets thinner, too. Not a good solution if you’re going to be coding for any length of time.Then I went over to the dark side. With some further tweaking I got this:
Pretty much as was intended originally. Trouble is, I really like the reversed-out font. For me, it is easier to focus on the white type on a dense saturated background. Somehow commands my attention better. So, I can either have that and no ExtSettings or have the settings that I need and black type. Choices. Choices… Perhaps there may come along a plugin update that accommodates this reversed-out option better.Even more curious, as regards the odd dialog behavior, when the font color is set to black, as in the above image, and you open the settings dialog the selection reverts to that shown in image number 2! Pale white type. Huh? Close the dialog and the selection goes back to black again.
Ahhh. I see what’s happening. NPP is running while I’m posting this so I can certify what is going on. When NPP has lost focus while I’m composing this post in the browser, the selection goes to white type. When the dialog is open the editor has lost focus. This doesn’t happen when ExtSettings is disabled and my strong reversed-out white type comes back all by itself. Open any dialog box and/or work in another application and the display stays just as it is.
Guess I know which option I’m choosing.
This was all done with some of the original font color solutions still in play. I’m almost afraid to disable them now. Maybe after I get some sleep. . .
At least I can work now.But . . . (there’s always a “But”) this puzzles me. If you select a string or a complete line, you get the fields as shown above. If you select more than one line it does this:
The alpha drops about 75% from where you set it. Huh again? -
Hello, @penskeguy, @peterjones and All,
Five years ago, I wrote the post, below, to @dinkumoil, where I asked him about some hints, advices and possible improvements. May be, you’ll be interested by some parts of my post :-)
https://community.notepad-plus-plus.org/topic/18214/new-plugin-extsettings/32
At this time, the Selection text color setting did not exist ( BTW, I confirm your findings about this specific setting, whether the
ExtSettings
dialog is opened or not : it does trigger the text color to the chosen one, only when you click on theClose
button or hit theESC
key ! )
From this post, I also extracted the part regarding the
Selection Alpha
setting, that I reproduced and completed which should be of some interest for you !If we consider, in
RGB
mode :-
The default current text foreground color
(0,0,0)
-
The default current text background
(255,255,255)
-
The default selection color
(192,192,192)
-
The default current line background color
(232,232,255)
Then, the alpha option allows you to change, BOTH, the color of background and foreground ( text ) of the resulting selection, according to the two general formulas :
• RESULTING Selection Background = α × SELECTION Background + ( 1 - α ) × CURRENT Background with α in range [0,1] • RESULTING Selection Foreground = α × SELECTION Foreground + ( 1 - α ) × CURRENT Foreground with α in range [0,1]
In other words, with an
α
transparency, transposed in range[0-255]
, we get :Resulting Bg Red = ( α × 192 + ( 255 - α ) × 255 ) / 255 for part of selection NOT in CURRENT line ¯¯¯ Resulting Bg Green = ( α × 192 + ( 255 - α ) × 255 ) / 255 for part of selection NOT in CURRENT line ¯¯¯ Resulting Bg Blue = ( α × 192 + ( 255 - α ) × 255 ) / 255 for part of selection NOT in CURRENT line ¯¯¯ Resulting Bg Red = ( α × 192 + ( 255 - α ) × 232 ) / 255 for part of selection within CURRENT line ¯¯¯¯¯¯ Resulting Bg Green = ( α × 192 + ( 255 - α ) × 232 ) / 255 for part of selection within CURRENT line ¯¯¯¯¯¯ Resulting Bg Blue = ( α × 192 + ( 255 - α ) × 255 ) / 255 for part of selection within CURRENT line ¯¯¯¯¯¯ And : Resulting Fg Red = ( α × 192 + ( 255 - α ) × 0 ) / 255 = α × 192 / 255 WHATEVER the location of the SELECTION ¯¯¯¯¯¯¯¯ Resulting Fg Green = ( α × 192 + ( 255 - α ) × 0 ) / 255 = α × 192 / 255 WHATEVER the location of the SELECTION ¯¯¯¯¯¯¯¯ Resulting Fg Blue = ( α × 192 + ( 255 - α ) × 0 ) / 255 = α × 192 / 255 WHATEVER the location of the SELECTION ¯¯¯¯¯¯¯¯
-
As
α
value increases towards255
, the gray colors of selected text and the background converge, reducing contrast between them and, whenα
=255
, color of Fg = color of Bg =(192,192,192)
, leading to an invisible selected text !! -
On the contrary, as
α
value decreases towards0
, the selection background becomes more and more transparent and, whenα
=0
, color of Fg =(0,0,0)
and color of Bg =(255,255,255)
, except for the part within current line where color of Bg =(232,232,255)
-
When the
α
value has the median value128
:-
The RGB values of the background part of selection NOT in current line are
223,223,223
≈ ( 128 × 192 + 127 × 255 ) / 255 -
The RGB values of the background part of selection WITHIN the current line are
212,212,223
≈ ( 128 × 192 + 127 × ( 232 | 232 | 255) ) / 255 -
the RGB values of the foreground ( text ) of the selection are
96,96,96
≈ 128 × 127 / 255
-
-
So, in the end, the values between
120
and140
and, of course,256
seem only interesting. And value128
, in the middle, is the good compromise ! -
In the specific case of
α
=256
, the transparency on BOTH foreground and background colors is desactiveted. However, we can consider that the resulting selection is a blend of a foreground and background opaque selection with an existing default black text on a default white background. Thus, using the above formulas and256
asα
value, we get : -
Resulting Selection Background = ( 256 × 192 + ( 255 - 256 ) × 255 ) / 255 ≈ 191,75… => Background selection color =
192,192,192
-
Resulting Selection Foreground = ( 256 × 0 + ( 255 - 256 ) × 0 ) / 255 = 0 => Foreground selection color =
0,0,0
Best Regards,
guy038
-