How to change color of letters of highlighted text?



  • Hello!

    I want to change color of letters of highlighted text.

    Now letters are black:
    eea6623d-74b7-4748-a204-090bbdcf571c-image.png

    I want letters are white (screenshot from Notepad app):
    af9559c6-f6e6-4d60-bc51-725b903f2cf1-image.png

    I use N++ 7.9 (64 bit, portable). Windws 7 Maximum.

    Please help!



  • @Evgeny-Morozov

    You cannot set the foreground colour of the selection, only the background colour, this is so that any text that has been styled by one of the language lexers is not overridden.
    4ca166e9-43ca-4754-9436-94fc25be059f-image.png



  • @Nick-Brown said in How to change color of letters of highlighted text?:

    @Evgeny-Morozov

    You cannot set the foreground colour of the selection, only the background colour, this is so that any text that has been styled by one of the language lexers is not overridden.
    4ca166e9-43ca-4754-9436-94fc25be059f-image.png

    Trere is no way to change color of letters of highlighted text?
    Have I understood you right?



  • @Evgeny-Morozov said in How to change color of letters of highlighted text?:

    Trere is no way to change color of letters of highlighted text?

    Yes, if the question is about an existing configuration setting, no otherwise.



  • Hello, @evgeny-morozov and All,

    As said before, there is NO setting to change the color of the selected text :-(

    However, if you have the NppExec or Python or Lua plugin installed, refer to this post :

    https://community.notepad-plus-plus.org/post/18727


    In a nutshell :

    - With the PYTHON plugin, use :
    
      - To COLOR the FOREGROUND selection :
    
          editor.setSelFore(1,(Red,Green,Blue)),        with Red, Green, Blue  between   0 and 255
          editor.setSelFore(1,(0xRed,0xGreen,0xBlue)),  with Red, Green, Blue  between  00 and  FF
    
          editor.setSelFore(1,(0,0,0))  ( Default : Black )
    
      - To COLOR the BACKGROUND selection :
    
          editor.setSelBack(1,(Red,Green,Blue)),        with Red, Green, Blue  between   0 and 255
          editor.setSelBack(1,(0xRed,0xGreen,0xBlue)),  with Red, Green, Blue  between  00 and  FF
    
          editor.setSelBack(1,(192,192,192))  ( Default : Grey 192 )
    
    
    - With the NPPEXEC plugin, use :
    
      - To COLOR the FOREGROUND selection :
    
          SCI_SENDMSG 2067 1 Dec_Value  or  SCI_SENDMSG SCI_SETSELFORE 1 Dec_Value,  with Dec_Value   between   0 and 16777215
          SCI_SENDMSG 2067 0xRRGGRR     or  SCI_SENDMSG SCI_SETSELFORE 1 0xRRGGRR,   with RR, GG, BB  between  00 and       FF
    
          SCI_SENDMSG 2067 1 0          or  SCI_SENDMSG SCI_SETSELFORE 1 0  ( Default : Black )
    
      - To COLOR the BACKGROUND selection :
    
          SCI_SENDMSG 2068 1 Dec_Value  or  SCI_SENDMSG SCI_SETSELBACK 1 Dec_Value,  with Dec_Value   between   0 and 16777215
          SCI_SENDMSG 2068 0xRRGGRR,    or  SCI_SENDMSG SCI_SETSELBACK 1 0xRRGGRR,   with RR, GG, BB  between  00 and       FF
    
          SCI_SENDMSG 2068 1 0xC0C0C0   or  SCI_SENDMSG SCI_SETSELBACK 1 0xC0C0C0  ( Default : Grey 192 )
    
    NOTE :  Dec_Value = Blue x 65536 + Green x 256 + Red, with Blue, Green, Red  between 0 and 255
    
    - With the LUA plugin, use :
    
      - To COLOR the BACKGROUND selection :
    
          editor:SetSelFore(1,Dec_Value),  with Dec_Value   between   0 and 16777215
          editor:SetSelFore(1,0xRRGGBB),   with RR, GG, BB  between  00 and       FF
    
          editor:SetSelFore(1,0)  ( Default : Black )
    
      - To COLOR the BACKGROUND selection :
    
          editor:SetSelBack(1,Dec_Value),  with Dec_Value   between   0 and 16777215
          editor:SetSelBack(1,0xRRGGBB),   with RR, GG, BB  between  00 and       FF
    
          editor:SetSelBack(1,0xC0C0C0)  ( Default : Grey 192 )
    
    NOTE :  Dec_Value = Blue x 65536 + Green x 256 + Red, with Blue, Green, Red  between 0 and 255
    

    Best Regards,

    guy038



  • @guy038 said in How to change color of letters of highlighted text?:

    editor.setSelFore(1,(Red,Green,Blue))

    It woooooooooooooooooooooorks!

    Thanks a lot!!!


Log in to reply