Change colour of selected text


#1

Is there a way to change the colour of the text on selection in the editor? Strangely all the other threads about changing the colour of selected text aren’t actually about that.


#2

Something very similar has been discussed here:


#3

That’s about changing the background colour, I want to change the text colour. Like I said, the other threads strangely don’t seem to be about changing the text colour despite their titles.


#4

Hello again.

Unfortunately what you are asking is not possible.
An expanded explanation is given here:
https://github.com/atom/atom/issues/2886

It boils down to the fact that the developers chose to use a layer below the text (decoration) to show selections. Only background and frames would be possible.

Greetings.


#5

I see, that’s a great shame. I asked because it’s clearly possible on Sublime text. I wanted to try using a dark theme on Atom like the ones so popular on Sublime, but when selecting text the text then can’t be seen. I noticed that on Sublime the background colour was different with the dark themes but also the text changed to white upon selection so everything was clear.


#6

Yes, they mentioned something similar here:


Might there be a workaround with the has-selection class, to be used let’s say in a package?


#7

I agree with you.

Fortunately we can customize the background colour by customization script (stylesheet.less). You can also include in there to detect if you use dark or light background and have the style adapt to it.

In other words… if you do not agree with a theme given to you, you can add some lines in your customization to override this. Look at: http://flight-manual.atom.io/behind-atom/sections/scoped-settings-scopes-and-scope-descriptors/ http://flight-manual.atom.io/using-atom/sections/basic-customization/#style-tweaks

The type of customization possible without installing an add-on package is fantastic.


#8

Not sure what either of you are suggesting. So I can do what to change the colour of the text on selection?


#9

(we are posting at the same time so my notes was late - sorry)

Start by reading a little from here:
http://flight-manual.atom.io/using-atom/sections/basic-customization/#style-tweaks

@b3by: would you be so kind as to walk through with @hasen where to find the stylesheet and how to use it for his purpose. Thank you.


#10

Well yes I’ve been tweaking the main stylesheet to change the background colour of the selected text. Adding a text colour property doesn’t seem to work though.


#11

Please show us what you have and perhaps explain per picture what you want to do.

Be warned… the original question you ask is not possible - only the background can be changed.


#12

Haha well obviously I can’t do it then. All I wanted to do was what’s stated in the title of the thread. Thanks for your help anyway.


#13

Yeah, sorry, I was just dropping suggestions on the table with no real explanation.
What @hasen is trying to do is not possible anyway.
I expressed the idea a package might be implemented for that, but I’m not sure.


#14

Ah ah. How can you say is not possible when I do have colours inside my files?
screen capture tool

I copied a text from a text editor to geany and from geany to atom.
Unless things changed since January it is technically possible to write in text and to change the colour of the text.
Was there any change since last time?
I would like that feature which is currently working in two of my files XD but I only got red and green.