Everyone has their own ideas about themes, for text editor I find this theme quite
relaxing even when using flux (which dims and extracts greens and blues after sundown)
Mine looks like this
I guess one might want to save this a json and also write a simple importer.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import bpy | |
from mathutils import Color, Vector | |
current_theme = bpy.context.user_preferences.themes.items()[0][0] | |
texed = bpy.context.user_preferences.themes[current_theme].text_editor | |
theme_options = { | |
'space.text', | |
'space.back', | |
'cursor', | |
'syntax_builtin', # import, return, for, in.. | |
'syntax_comment', | |
'syntax_numbers', | |
'syntax_special', # def, class.. | |
'syntax_string', | |
'syntax_symbols', # = ()[] . , > < == etc. | |
'syntax_reserved', | |
'syntax_preprocessor', | |
'line_numbers_background', | |
'selected_text' | |
} | |
theme_dict = {} | |
for opt in theme_options: | |
if '.' in opt: | |
# assume only one dot. | |
prime, subprime = opt.split('.') | |
val = getattr(getattr(texed, prime), subprime) | |
else: | |
val = getattr(texed, opt) | |
# cant round a colour, convert to vector first. | |
regular_vec = Vector(val[:]) | |
# rounds the value after 7th decimal | |
theme_dict[opt] = regular_vec.to_tuple(7) | |
m = json.dumps(theme_dict, sort_keys=True, indent=2) | |
print(m) | |
Mine looks like this
I guess one might want to save this a json and also write a simple importer.