When opening Edit > Preferences > Themes > Text Editor and hovering over Line Numbers color picker, Python Tooltip shows:
ThemeTextEditor.line_numbers
How can I read the value? Python reports:
AttributeError: type object 'ThemeTextEditor' has no attribute 'line_numbers'
Some more info. I am trying to create an addon that can change the Text Editor highlight settings, and then save them. I can save them, but, I can't get the theme colors into my function.
def execute( self, context ):
bpy.ops.wm.save_userpref()
return {'FINISHED'} #from an operator function
def CreateColorPicker( name, size, prop ) -> FloatVectorProperty:
return FloatVectorProperty(
name = name,
subtype = "COLOR",
size = size, #RGB = 3, RGBA = 4
min = 0.0,
max = 1.0,
#default = [1.0, 1.0, 1.0]
default = prop
)
Scene.LineNumbersColor = CreateColorPicker( "Line Numbers", RGB, theme.text_editor.line_numbers )
And yes Mr McKenzie your code does work.