Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/resources.c
| Context not available. | |||||
| cp = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid); | cp = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid); | ||||
| glColor4ubv(cp); | glColor4ubv(cp); | ||||
| } | } | ||||
| /* set the color with offset for shades */ | /* set the color with offset for shades */ | ||||
| Context not available. | |||||
| { | { | ||||
| int r, g, b; | int r, g, b; | ||||
| const unsigned char *cp; | const unsigned char *cp; | ||||
| cp = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid); | cp = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid); | ||||
| r = offset + (int) cp[0]; | r = offset + (int) cp[0]; | ||||
| CLAMP(r, 0, 255); | CLAMP(r, 0, 255); | ||||
| Context not available. | |||||
| CLAMP(b, 0, 255); | CLAMP(b, 0, 255); | ||||
| a = alphaoffset + (int) cp[3]; | a = alphaoffset + (int) cp[3]; | ||||
| CLAMP(a, 0, 255); | CLAMP(a, 0, 255); | ||||
| glColor4ub(r, g, b, a); | glColor4ub(r, g, b, a); | ||||
| } | } | ||||
| Context not available. | |||||
| col[2] = b; | col[2] = b; | ||||
| } | } | ||||
| void UI_GetThemeColorShadeAlpha4fv(int colorid, int coloffset, int alphaoffset, float col[4]) | |||||
| { | |||||
| int r, g, b, a; | |||||
| const unsigned char *cp; | |||||
| cp = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid); | |||||
| r = coloffset + (int) cp[0]; | |||||
| CLAMP(r, 0, 255); | |||||
| g = coloffset + (int) cp[1]; | |||||
| CLAMP(g, 0, 255); | |||||
| b = coloffset + (int) cp[2]; | |||||
| CLAMP(b, 0, 255); | |||||
| a = alphaoffset + (int) cp[3]; | |||||
| CLAMP(b, 0, 255); | |||||
| col[0] = ((float)r) / 255.0f; | |||||
| col[1] = ((float)g) / 255.0f; | |||||
| col[2] = ((float)b) / 255.0f; | |||||
| col[3] = ((float)a) / 255.0f; | |||||
| } | |||||
| /* get the color, in char pointer */ | /* get the color, in char pointer */ | ||||
| void UI_GetThemeColor3ubv(int colorid, unsigned char col[3]) | void UI_GetThemeColor3ubv(int colorid, unsigned char col[3]) | ||||
| { | { | ||||
| Context not available. | |||||