Hello,
I wrote a plugin to automate some task but I want to add the feature of changing the background colour of sublime text if the opened file is in a specified folder.
Can anyone help me to find out how to do this ?
Thank you
Hello,
I wrote a plugin to automate some task but I want to add the feature of changing the background colour of sublime text if the opened file is in a specified folder.
Can anyone help me to find out how to do this ?
Thank you
Background color is defined in color scheme so your request is to create and change color scheme on-the-fly.
Can you give me some clue of how to do it please ?
Also, it’ll affect only the opened tab or all the window ?
Read current color scheme file.
color_scheme from user settings. (Note there if the user uses auto, use sublime.ui_info() to find whether it’s light or dark now.)sublime.find_resources() to find the file path of the color scheme.sublime.load_resource() to get the file content of the color scheme.sublime.decode_value() to parse the color scheme content into a Python dict, say color_scheme.Modify the color scheme.
color_scheme['globals']['background'] value to your preference.sublime.decode_value(color_scheme) into another file.