Sublime Forum

Caret color conundrum

#1

I added some customization of my Monokai color schemes and the caret has turned black, which I don’t want. I’ve been over the customization file several times, but I can’t figure out what is making the caret black. FWIW, everything else in that customization scheme seems to be behaving. Can someone tell me what setting in my file is changing that caret, and how I might re-color that little dude? Below is my file:

{
“variables”:
{

    "yellow_main_text": "hsl(53, 78%, 45%)",
    //this is supposedly yellow #2 pencil color
    "yellow_pencil": "hsl(36, 76%, 52%)",
    "red_dark": "hsl(0, 100%, 25%)",
    "black": "hsl(70, 0%, 8%)",
    "blue_nice": "hsl(233, 78%, 45%)",
    "orange": "hsl(24, 100%, 50%)",
    "blue_text": "hsl(170, 100%, 45%)",
    "blue_highlight": "hsl(170, 100%, 15%)",
    
},
"globals":
{
    //main text background and font colors
    "background": "var(black)",
    "foreground": "var(blue_text)",
    
    //gutter_foreground is line-number color in gutter
    "gutter_foreground": "var(yellow_pencil)",
    
    //line_highlight is the block that highlights in the gutter wherever you are in the file.
    "line_highlight": "var(blue_highlight)",
    
    //diff marker stuff
"line_diff_added": "var(yellow_pencil)",
"line_diff_modified": "var(yellow_pencil)",
"line_diff_deleted": "var(blue_nice)",
"line_diff_width": "3",

},
"rules":
[

    //this determines color of my comment highlights in my notes project. It's tied to the syntax definition titled comment.sublime-syntax in my user directory and bound to alt+c in my default.sublime-keymap also in user directory. For more details, see txt file highlighting.txt in my documents/sublime_how-to folder
    {
        "scope": "text.txt note",
        "foreground": "black",
        "background": "var(blue_text)",
    },
]

}

0 Likes

#2

It was hard to tell exactly what you posted as your code wasn’t formatted in the forum post in an easy to read way, so I’ve formatted it properly:

{
    "variables":
    {
        "yellow_main_text": "hsl(53, 78%, 45%)",
        //this is supposedly yellow #2 pencil color
        "yellow_pencil": "hsl(36, 76%, 52%)",
        "red_dark": "hsl(0, 100%, 25%)",
        "black": "hsl(70, 0%, 8%)",
        "blue_nice": "hsl(233, 78%, 45%)",
        "orange": "hsl(24, 100%, 50%)",
        "blue_text": "hsl(170, 100%, 45%)",
        "blue_highlight": "hsl(170, 100%, 15%)",
    },
    "globals":
    {
        //main text background and font colors
        "background": "var(black)",
        "foreground": "var(blue_text)",

        //gutter_foreground is line-number color in gutter
        "gutter_foreground": "var(yellow_pencil)",

        //line_highlight is the block that highlights in the gutter wherever you are in the file.
        "line_highlight": "var(blue_highlight)",

        //diff marker stuff
        "line_diff_added": "var(yellow_pencil)",
        "line_diff_modified": "var(yellow_pencil)",
        "line_diff_deleted": "var(blue_nice)",
        "line_diff_width": "3",
    },
    "rules":
    [
        //this determines color of my comment highlights in my notes project. It's tied to the syntax definition titled comment.sublime-syntax in my user directory and bound to alt+c in my default.sublime-keymap also in user directory. For more details, see txt file highlighting.txt in my documents/sublime_how-to folder
        {
            "scope": "text.txt note",
            "foreground": "black",
            "background": "var(blue_text)",
        },
    ]
}

I then put this into a file called Monokai.sublime-color-scheme in my User folder.

I then set my color scheme to Monokai. This what I got:

The caret looks fine to me:

0 Likes

#3

I should state that I’m on Sublime Text 4, but I don’t think it should differ from Sublime Text 3.

0 Likes

#4

Additionally, the caret is controlled by these global options:

        "caret": "color(var(white2) alpha(0.9))",
        "block_caret": "color(var(white2) alpha(0.2))",
        "block_caret_border": "color(var(white2) alpha(0.8))",

Those are the defaults in the default Sublime Text Monokai Color Scheme.

0 Likes

#5

Thanks for the pointers and for giving this a go. Sorry about the code format; I’ll have to learn how to post it in more readable fashion. I am on ST3, BTW.

The conundrum continued on my end. Here’s a grab–if your eyes are good, you can see the black caret in the middle of line 4.

image

But… I went in and added the caret line you supplied to my custom global options and was able to change it from there. So I’m in business. Thanks much for your help.

0 Likes

#6

There may have been some tweaks between ST4 and ST3, but it sounds like setting the caret color directly fixed your issue, so I’d stick with that :slight_smile:.

0 Likes