diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-09-01 07:40:07 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-09-01 08:00:48 +0300 |
commit | a241948ad96be3a9cdf04a0ee53605d3ff4dd82b (patch) | |
tree | 8f8cce66ef3dfa19154f5497dc6c44f383b9137d /source/blender/blenlib | |
parent | d9d0a386cb02eec14fc8d167e9235fdd18a02c18 (diff) |
Fix errors ensuring grease pencil palette
- Direct assignment caused ID user counts to be invalid.
- The first palette would always be used,
even when the named palette searched for was found.
Also pass 'const' string to `hex_to_rgb`, avoid casting to 'non-const'.
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/BLI_math_color.h | 2 | ||||
-rw-r--r-- | source/blender/blenlib/intern/math_color.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/blenlib/BLI_math_color.h b/source/blender/blenlib/BLI_math_color.h index 943f0fc764f..7b48b62b6e7 100644 --- a/source/blender/blenlib/BLI_math_color.h +++ b/source/blender/blenlib/BLI_math_color.h @@ -47,7 +47,7 @@ void hsv_to_rgb(float h, float s, float v, float *r_r, float *r_g, float *r_b); void hsv_to_rgb_v(const float hsv[3], float r_rgb[3]); void hsl_to_rgb(float h, float c, float l, float *r_r, float *r_g, float *r_b); void hsl_to_rgb_v(const float hcl[3], float r_rgb[3]); -void hex_to_rgb(char *hexcol, float *r_r, float *r_g, float *r_b); +void hex_to_rgb(const char *hexcol, float *r_r, float *r_g, float *r_b); void yuv_to_rgb(float y, float u, float v, float *r_r, float *r_g, float *r_b, int colorspace); void ycc_to_rgb(float y, float cb, float cr, float *r_r, float *r_g, float *r_b, int colorspace); void cpack_to_rgb(unsigned int col, float *r_r, float *r_g, float *r_b); diff --git a/source/blender/blenlib/intern/math_color.c b/source/blender/blenlib/intern/math_color.c index 09bb7ea5711..4b62d6b9b5b 100644 --- a/source/blender/blenlib/intern/math_color.c +++ b/source/blender/blenlib/intern/math_color.c @@ -198,7 +198,7 @@ void ycc_to_rgb(float y, float cb, float cr, float *r_r, float *r_g, float *r_b, *r_b = b / 255.0f; } -void hex_to_rgb(char *hexcol, float *r_r, float *r_g, float *r_b) +void hex_to_rgb(const char *hexcol, float *r_r, float *r_g, float *r_b) { unsigned int ri, gi, bi; |