Sublime Forum

Theme rule text_line_control and color_scheme_tint

#1

Hi all,

I have my personal sublime theme and I can’t make the background of Find / Find in Files / Replace / Console different from color scheme background.

Here is my text_line_control:

        {
        "class": "text_line_control",
        "layer0.tint": [
            "background",
            0,
            0,
            0,
            0.5
        ],
        "layer1.inner_margin": [
            4, 
            0, 
            4, 
            0
        ],
        "layer1.opacity": 1.0
        "layer1.tint": [
            "background",
            0,
            0,
            0,
            0.6
        ],
        "color_scheme_tint": "color(white alpha(7.5%))", // "color(black blend(var(bg-color) 50%))"
    },
    {
        "class": "text_line_control",
         "parents": [
            {
                "class": "window", 
                "attributes": [
                    "file_light"
                ]
            }
        ],
        "layer0.tint": [
            "background",
            0,
            0,
            0,
            0.1
        ],
        "layer1.tint": [
            "background",
            0,
            0,
            0,
            0.1
        ],
        "color_scheme_tint": "color(black alpha(7.5%))", // "color(black blend(var(bg-color) 10%))"
    },

When I open find first time

If I save the theme file, it is like I want.

But it doesn’t stay right, if I close sublime when I open it started like first time, and Find in Files / Replace / Console all the same issue. Save file, it fix but do not stay.

I tried to change panel_control: find_panel, find_in_files_panel, replace_panel, console_panel but I could not fix.

Can anyone help me get the background correct like I want?

Thank you

1 Like

#2
  1. Your example is missing a comma after the first "layer1.opacity": 1.0, which causes a parse error and therefore might cause the rules after it to be ignored - which includes color_scheme_tint.
  2. Why do you assign 2 layers?
  3. Why is layer0 not assigned an opacity value
  4. Why differ layer.tint and color_scheme_tint?

Just tried and modified your snippet in using Theme - DAneo as a base

    {
        "class": "text_line_control",
        "color_scheme_tint": ["background", 0, 0, 0, 0.5],
        "layer0.tint": ["background", 0, 0, 0, 0.5],
        "layer0.opacity": 1.0,
    },
    {
        "class": "text_line_control",
         "parents": [
            { "class": "window", "attributes": ["file_light"] }
        ],
        "layer0.tint": ["background", 0, 0, 0, 0.2 ],
        "color_scheme_tint": ["background", 0, 0, 0, 0.2 ]
    },

grafik

grafik

Works immediatly after startup. But I must confess, ST sometimes has some trouble with updating edit control’s tints after switching themes/color schemes.

1 Like

#3

Hi deathaxe,

Thanks for your reply.

  1. Sorry, the missing commas is because I cut some lines to show only relevant parts.
  2. I use one for round corners (layer0 - /textures/inputs/input-bg-round.png) and the other for line border (layer1 - /textures/inputs/input-bg-round-border.png).
  3. It has an opacity value, I cut some lines to not be soo long
  4. I missed it… It is because I started changing text_line_control first. The color_scheme_tint comes after read a post here searching for a solution. I made the same now but still same issue yet.

I put theme files under this folder /Users/mbp/Library/Application Support/Sublime Text 3/Packages/my-theme/

Is it right?

Thank you

1 Like

#4

If you could somehow share your theme, maybe could have a closer look at it and find out the reason for it not to work.

1 Like

#5

Need to see the whole theme file? I am asking because I need to do some cleaning, it is a slow wip.

They (themes and color schemes) will be open when I reach a minimal color/visual setup.

The rules I am following are from this link https://www.sublimetext.com/docs/3/themes.html

I tried to comment my textures to see if they are problem, but the issue persist.

Thanks

1 Like

#6

Updating issue.

I test my theme only with text_line_control rule to know if the issue is on my theme. Then I also test my color-schemes to find if they are wrong.

Since the issue persist. I went to test D Aneo theme with light color schemes other than mine. Dark color schemes do not show the issue maybe because dark color hide it.

D Aneo elegant theme with Eiffl, Celest, Breakers all light themes. And issue also exist.

I

0 Likes

#7

I can reproduce your issue with ST3210 on Windows.

As overlay’s text inputs look ok, I’d call it a ST core bug. Fortunatelly I don’t see this issue in ST 4084 anymore so it has been addressed already.

It looks like the parent attribute causes color_scheme_tint not to be applied to the edit control upon startup. If I remove it, edit controls are displayd correctly. That’s why it works for dark color schemes. They do not have a parent selector.

I managed to fix it by directly using the file_light attribute of the text_line_control.

The modified example from above would look like:

    {
        "class": "text_line_control",
        "color_scheme_tint": ["background", 0, 0, 0, 0.5],
        "layer0.tint": ["background", 0, 0, 0, 0.5],
        "layer0.opacity": 1.0,
    },
    {
        "class": "text_line_control",
        "attributes": ["file_light"], // <-- the text line attribute
        // "parents": [
        //     { "class": "window", "attributes": ["file_light"] }
        // ],
        "layer0.tint": ["background", 0, 0, 0, 0.2 ],
        "color_scheme_tint": ["background", 0, 0, 0, 0.2 ]
    },

Good luck.

0 Likes

#8

Thank you for your reply and solution.

Here I use ST3211 Mac OS.

0 Likes