Sublime Forum

Option to modify theme contrast

#1

It is hard to find a theme that works for me. There are those with nice colours but insufficient or too much contrast, and there are those with good contrast but colours that I don’t like.

What about adding a slider to adjust the contrast of the selected theme? A simple slider that would adjust the difference between the foreground and the background colours.

It sounds like a killer feature, but I am sure it would be fairly hard to create.

0 Likes

#2

This requires addition a lot of new stuff to ST theme engine. I don’t think that this will be available in the near future, because ST have had a lot of UI improvements recently, but there are other areas to improve.

Optionally you can try DA UI theme, it allows you to tweak almost any color, this is not what you ask, but you can achieve needed contrast manually.

0 Likes

#3

You can use ThemeTweaker to adjust a color scheme.

  1. Install plugin (restart after to ensure all dependencies are loaded proper).

  2. I add this to my Default.sublime-keymap file:

    [
        //////////////////////////////////
        // Theme Tweaker
        //////////////////////////////////
        {"keys": ["up"], "command": "theme_tweaker_brightness", "context": [{"key": "theme_tweaker"}], "args": {"direction": "+"}},
        {"keys": ["down"], "command": "theme_tweaker_brightness", "context": [{"key": "theme_tweaker"}], "args": {"direction": "-"}},
        {"keys": ["shift+up"], "command": "theme_tweaker_saturation", "context": [{"key": "theme_tweaker"}], "args": {"direction": "+"}},
        {"keys": ["shift+down"], "command": "theme_tweaker_saturation", "context": [{"key": "theme_tweaker"}], "args": {"direction": "-"}},
        {"keys": ["shift+left"], "command": "theme_tweaker_hue", "context": [{"key": "theme_tweaker"}], "args": {"direction": "-"}},
        {"keys": ["shift+right"], "command": "theme_tweaker_hue", "context": [{"key": "theme_tweaker"}], "args": {"direction": "+"}},
        {"keys": ["ctrl+1"], "command": "theme_tweaker_invert", "context": [{"key": "theme_tweaker"}]},
        {"keys": ["ctrl+2"], "command": "theme_tweaker_colorize", "context": [{"key": "theme_tweaker"}]},
        {"keys": ["ctrl+3"], "command": "theme_tweaker_sepia", "context": [{"key": "theme_tweaker"}]},
        {"keys": ["ctrl+4"], "command": "theme_tweaker_grayscale", "context": [{"key": "theme_tweaker"}]},
        {"keys": ["ctrl+5"], "command": "theme_tweaker_glow", "context": [{"key": "theme_tweaker"}]},
        {"keys": ["ctrl+z"], "command": "theme_tweaker_undo", "context": [{"key": "theme_tweaker"}]},
        {"keys": ["ctrl+shift+z"], "command": "theme_tweaker_redo", "context": [{"key": "theme_tweaker"}]},
        {"keys": ["escape"], "command": "theme_tweaker_clear", "context": [{"key": "theme_tweaker"}]}
    ]
    
  3. Enable Tweak Mode from the command palette: ThemeTweaker: Toggle Tweak Mode.

  4. Use the shortcuts to tweak saturation, brightness, apply filters, reset back to the original etc.

  5. Disable tweak mode by rerunning the toggle command.

Tweaked theme will be found in User/ThemeTweaker. It does not modify popup CSS currently.

I just released an update 1.3.1. Don’t install until the Package Control version shows 1.3.1. There was a bug with global settings that were not colors.

4 Likes

Creating a custom color scheme?
#4

Theme​Tweaker is amazing! I don’t even know how could I missed it :wink:

0 Likes

#5

I have a number of low profile plugins, some good, some meh. Some like ThemeTweaker I thought would be more popular than they are. But ¯\_(ツ)_/¯.

I guess in retrospect, the majority of people aren’t tweaking everything, they just look for for color schemes that look how they want them to out of the box. But for those like me, there is ThemeTweaker :slight_smile:.

1 Like

#6

FYI, PC is now showing the latest version, so it’s safe to install and encouraged to upgrade.

0 Likes

#7

I just realized that ThemeTweaker doesn’t explicitly have a contrast modifier, but that I can probably add one pretty easy within the week I think.

0 Likes

#8

Okay, actual contrast command has been added in 1.4.0. I guess I may in the future add a simple UI to access this stuff without having to define shortcuts, but another day.

//////////////////////////////////
    // Theme Tweaker
    //////////////////////////////////
    {"keys": ["up"], "command": "theme_tweaker_brightness", "context": [{"key": "theme_tweaker"}], "args": {"direction": "+"}},
    {"keys": ["down"], "command": "theme_tweaker_brightness", "context": [{"key": "theme_tweaker"}], "args": {"direction": "-"}},
    {"keys": ["left"], "command": "theme_tweaker_contrast", "context": [{"key": "theme_tweaker"}], "args": {"direction": "-"}},
    {"keys": ["right"], "command": "theme_tweaker_contrast", "context": [{"key": "theme_tweaker"}], "args": {"direction": "+"}},
    {"keys": ["shift+up"], "command": "theme_tweaker_saturation", "context": [{"key": "theme_tweaker"}], "args": {"direction": "+"}},
    {"keys": ["shift+down"], "command": "theme_tweaker_saturation", "context": [{"key": "theme_tweaker"}], "args": {"direction": "-"}},
    {"keys": ["shift+left"], "command": "theme_tweaker_hue", "context": [{"key": "theme_tweaker"}], "args": {"direction": "-"}},
    {"keys": ["shift+right"], "command": "theme_tweaker_hue", "context": [{"key": "theme_tweaker"}], "args": {"direction": "+"}},
    {"keys": ["ctrl+1"], "command": "theme_tweaker_invert", "context": [{"key": "theme_tweaker"}]},
    {"keys": ["ctrl+2"], "command": "theme_tweaker_colorize", "context": [{"key": "theme_tweaker"}]},
    {"keys": ["ctrl+3"], "command": "theme_tweaker_sepia", "context": [{"key": "theme_tweaker"}]},
    {"keys": ["ctrl+4"], "command": "theme_tweaker_grayscale", "context": [{"key": "theme_tweaker"}]},
    {"keys": ["ctrl+5"], "command": "theme_tweaker_glow", "context": [{"key": "theme_tweaker"}]},
    {"keys": ["ctrl+z"], "command": "theme_tweaker_undo", "context": [{"key": "theme_tweaker"}]},
    {"keys": ["ctrl+shift+z"], "command": "theme_tweaker_redo", "context": [{"key": "theme_tweaker"}]},
    {"keys": ["escape"], "command": "theme_tweaker_clear", "context": [{"key": "theme_tweaker"}]}
1 Like