diff options
Diffstat (limited to 'source/blender/editors/interface/resources.c')
-rw-r--r-- | source/blender/editors/interface/resources.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index bf57dda44bf..9d66c9ea2e1 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -1028,7 +1028,7 @@ int UI_GetThemeValue(int colorid) // get the color, range 0.0-1.0 -void UI_GetThemeColor3fv(int colorid, float *col) +void UI_GetThemeColor3fv(int colorid, float col[3]) { const unsigned char *cp; @@ -1039,7 +1039,7 @@ void UI_GetThemeColor3fv(int colorid, float *col) } // get the color, range 0.0-1.0, complete with shading offset -void UI_GetThemeColorShade3fv(int colorid, int offset, float *col) +void UI_GetThemeColorShade3fv(int colorid, int offset, float col[3]) { int r, g, b; const unsigned char *cp; @@ -1058,6 +1058,25 @@ void UI_GetThemeColorShade3fv(int colorid, int offset, float *col) col[2] = ((float)b) / 255.0f; } +void UI_GetThemeColorShade3ubv(int colorid, int offset, unsigned char col[3]) +{ + int r, g, b; + const unsigned char *cp; + + cp = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid); + + r = offset + (int) cp[0]; + CLAMP(r, 0, 255); + g = offset + (int) cp[1]; + CLAMP(g, 0, 255); + b = offset + (int) cp[2]; + CLAMP(b, 0, 255); + + col[0] = r; + col[1] = g; + col[2] = b; +} + // get the color, in char pointer void UI_GetThemeColor3ubv(int colorid, unsigned char col[3]) { |