Q:

How to acess and change solid OpenGL lights settings via python?

I have interested in create an addon to help on viewing models.
the idea is the properties for solid OpenGL Ligths be found in tools panel so we can easily tweak the colors and light direction for better viewing.

But I need acess the properties in user preferences change it and save the props in the .blend and of couse automaticaly load it when a file is open.

A:

If you hover the color boxes with the mouse cursor you will find that the responsible python struct is UserSolidLight with the following properties

base class — bpy_struct
class bpy.types.UserSolidLight(bpy_struct) Light used for OpenGL
  lighting in solid draw mode
diffuse_color Diffuse color of the OpenGL light
Type: float array of 3 items in [0, inf], default (0.0, 0.0, 0.0)
direction Direction that the OpenGL light is shining
Type: float array of 3 items in [-inf, inf], default (0.0, 1.0, 0.0)
specular_color Color of the light’s specular highlight
Type: float array of 3 items in [0, inf], default (0.0, 0.0, 0.0)
use
  Enable this OpenGL light in solid draw mode
Type: boolean, default False

According to the Python API Documentation

