diff options
-rw-r--r-- | source/blender/editors/include/UI_resources.h | 1 | ||||
-rw-r--r-- | source/blender/editors/interface/resources.c | 10 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_knife.c | 12 |
3 files changed, 17 insertions, 6 deletions
diff --git a/source/blender/editors/include/UI_resources.h b/source/blender/editors/include/UI_resources.h index 277aae923d6..0be8f91cca6 100644 --- a/source/blender/editors/include/UI_resources.h +++ b/source/blender/editors/include/UI_resources.h @@ -369,6 +369,7 @@ void UI_GetThemeColor3ubv(int colorid, unsigned char col[3]); void UI_GetThemeColor4ubv(int colorid, unsigned char col[4]); // get a theme color from specified space type +void UI_GetThemeColorType3ubv(int colorid, int spacetype, char col[3]); void UI_GetThemeColorType4ubv(int colorid, int spacetype, char col[4]); // get theme color for coloring monochrome icons diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index 09b8933206e..a30dde38852 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -1118,6 +1118,16 @@ void UI_GetThemeColor4ubv(int colorid, unsigned char col[4]) col[3] = cp[3]; } +void UI_GetThemeColorType3ubv(int colorid, int spacetype, char col[3]) +{ + const unsigned char *cp; + + cp = UI_ThemeGetColorPtr(theme_active, spacetype, colorid); + col[0] = cp[0]; + col[1] = cp[1]; + col[2] = cp[2]; +} + void UI_GetThemeColorType4ubv(int colorid, int spacetype, char col[4]) { const unsigned char *cp; diff --git a/source/blender/editors/mesh/editmesh_knife.c b/source/blender/editors/mesh/editmesh_knife.c index b89a7dd91a1..b85627dc146 100644 --- a/source/blender/editors/mesh/editmesh_knife.c +++ b/source/blender/editors/mesh/editmesh_knife.c @@ -1027,13 +1027,13 @@ static void knife_init_colors(KnifeColors *colors) /* possible BMESH_TODO: add explicit themes or calculate these by * figuring out contrasting colors with grid / edges / verts * a la UI_make_axis_color */ - UI_GetThemeColor3ubv(TH_NURB_VLINE, colors->line); - UI_GetThemeColor3ubv(TH_NURB_ULINE, colors->edge); - UI_GetThemeColor3ubv(TH_HANDLE_SEL_VECT, colors->curpoint); - UI_GetThemeColor3ubv(TH_HANDLE_SEL_VECT, colors->curpoint_a); + UI_GetThemeColorType3ubv(TH_NURB_VLINE, SPACE_VIEW3D, colors->line); + UI_GetThemeColorType3ubv(TH_NURB_ULINE, SPACE_VIEW3D, colors->edge); + UI_GetThemeColorType3ubv(TH_HANDLE_SEL_VECT, SPACE_VIEW3D, colors->curpoint); + UI_GetThemeColorType3ubv(TH_HANDLE_SEL_VECT, SPACE_VIEW3D, colors->curpoint_a); colors->curpoint_a[3] = 102; - UI_GetThemeColor3ubv(TH_ACTIVE_SPLINE, colors->point); - UI_GetThemeColor3ubv(TH_ACTIVE_SPLINE, colors->point_a); + UI_GetThemeColorType3ubv(TH_ACTIVE_SPLINE, SPACE_VIEW3D, colors->point); + UI_GetThemeColorType3ubv(TH_ACTIVE_SPLINE, SPACE_VIEW3D, colors->point_a); colors->point_a[3] = 102; } |