Community
    • Login

    Theme, Monokai, change color of highlighted line

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    2 Posts 2 Posters 54 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C Offline
      ChotaFallen
      last edited by

      Good morning.
      I have some trouble with themes in notepad++
      I use Monokai dark at the moment, so far colors are ok.
      What I need is a better highlighed line I am working in, its black on dark that has nothing to do with highlight.
      Same problem with most other themes.
      If I try to change it via Style congiruator the line will be solid in the color I choode doesnt matter for fore or background.

      style.png

      Also background is devided in left and right.
      back.png

      changing background
      back1.png

      Absolute strange.

      PeterJonesP 1 Reply Last reply Reply Quote 0
      • PeterJonesP Online
        PeterJones @ChotaFallen
        last edited by

        @ChotaFallen ,

        Under default Monokai, I cannot replicate:

        9491595a-6d67-4abf-8758-f5ed5da6beb3-image.jpeg

        However, if I change the Default Style > Background for Monokai (to a green similar to your second screenshot), I can see it:

        b8f97a3a-d5b4-43cd-b0f3-a1c35e66c366-image.jpeg

        It’s because Monokai (and most themes) hardcodes every background color for every style, rather than using “inherit”. Here’s an example using the default style:

        9ba07e02-fb1d-4d2f-a580-d6cb2d7d5924-image.jpeg

        The theme color choices aren’t always perfect, and not everyone is going to agree with color choices made. As such, you can customize to what you want.

        If you want most of the backgrounds for your theme to inherit from the “default background” rather than being hardcoded, you can go through and right click the background color for any that are the default. (Or, as a footnote, I will also explain a process that you can edit the XML for your customized Monokai, to automatically change anything that has a background that matches the monokai default background to inherit from default background, so that you can do it in a lot less time.)

        What I need is a better highlighed line I am working in, its black on dark that has nothing to do with highlight.
        …
        If I try to change it via Style congiruator the line will be solid in the color I choode doesnt matter for fore or background.

        Which “highlight” do you mean? And I am not sure what you aren’t liking about it when you change it.

        • Current line highlight:
          • default Monokai: db922444-92f4-4df3-91f4-9865727004fd-image.jpeg
          • set it to something else: fca66fe1-82d2-47cd-92cb-8c1ca0e6bc54-image.jpeg
          • it does exactly what I expect: it changes the current line background color 0x3E3D32 to something based on the color I selected.
        • Selected text colour:
          • default: 6cf5b4c1-7b2e-47bc-8b20-47ad2ea1884a-image.jpeg
          • modified: 6318a4e3-6d6a-4583-b949-855a439f304c-image.jpeg
          • again, it does what I expect
        • Smart Highlighting:
          • default: 1107e88c-b40c-4622-b0e9-d2676004c323-image.jpeg
          • changed to cyan: 3ba38b0a-1f92-4d9d-ba94-b36ef4d0c6f3-image.jpeg
          • this one, it’s actually combing the selected color with the normal background color, so it’s not exactly the same color you chose; but again, that’s not unique to Monokai
        • Find Mark Style: used when you use Find > Mark dialog
          • 0e9c9f44-f393-44ae-b29a-386e362939bd-image.jpeg
        • Mark Style #: used when you use Search > Style … Token options:
          • 131aa3df-93bd-4977-9bd9-3143c4a7fbcb-image.jpeg

        There are a few other, less likely, choices that you might mean by highlight. But rather than showing that I think it does what’s expected, it would be better if you were more specific about what you were doing, and what you don’t like, and what you would like.


        Footnote: Make Monokai backgrounds inherit quickly

        I assume you have a copy of Monokai.xml in %AppData%\Notepad++\themes\ .

        1. Exit all copies of Notepad++
        2. Copy Monokai.xml to Monokai_custom.xml
        3. Edit Monokai_custom.xml with Notepad++
        4. Confirm that <WidgetStyle name="Default Style" has bgColor="272822" – if not, manually edit it to use that
        5. Search > Replace, set Search Mode = Regular Expression
          1. FIND = (?-s)bgColor="272822".*\KcolorStyle="(?:(2)|(3))"
            REPLACE = colorStyle="(?{1}0)(?{2}1)"
            REPLACE ALL
          2. FIND = (?-s)(bgColor="272822"(?:(?!colorStyle).))*\h*/>
            REPLACE = colorStyle="${1} colorStyle="1" />
            REPLACE ALL
          3. On the “Default Style” line again, delete colorStyle="1"
          4. Save the file
        6. Exit Notepad++ and re-launch it
        7. Settings > Style Configurator > Select Theme = Monokai_custom

        Now if you change Monokai_custom’s default background color, it should propagate to all the other styles (both normal text and each language), so it really changes the background throughout.

        1 Reply Last reply Reply Quote 1

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        • First post
          Last post
        The Community of users of the Notepad++ text editor.
        Powered by NodeBB | Contributors