diff options
author | Bruno Boaventura Scholl <brunobbs> | 2019-06-06 19:00:56 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-06-06 19:06:33 +0300 |
commit | 8db514f81dc1309d30e6741f85d99a9ca4ffccff (patch) | |
tree | 5c2ef0c0cafa6732062c87396d2f8126999fd650 /source | |
parent | 2be3a75efd9b60cac64980bb83003a7370c3bd08 (diff) |
Fix T60441, T60619: incorrect values for color values > 1.0
Modulo makes no sense here at all, is from an old bugfix to prevent a crash
that is no longer an issue.
Differential Revision: https://developer.blender.org/D4727
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/interface/interface_region_color_picker.c | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/source/blender/editors/interface/interface_region_color_picker.c b/source/blender/editors/interface/interface_region_color_picker.c index 723222d56d1..5c231f5e51a 100644 --- a/source/blender/editors/interface/interface_region_color_picker.c +++ b/source/blender/editors/interface/interface_region_color_picker.c @@ -194,7 +194,6 @@ static void ui_update_color_picker_buts_rgb(uiBut *from_but, else if (STREQ(bt->str, "Hex: ")) { float rgb_hex[3]; uchar rgb_hex_uchar[3]; - double intpart; char col[16]; /* Hex code is assumed to be in sRGB space @@ -204,16 +203,6 @@ static void ui_update_color_picker_buts_rgb(uiBut *from_but, IMB_colormanagement_scene_linear_to_srgb_v3(rgb_hex); } - if (rgb_hex[0] > 1.0f) { - rgb_hex[0] = modf(rgb_hex[0], &intpart); - } - if (rgb_hex[1] > 1.0f) { - rgb_hex[1] = modf(rgb_hex[1], &intpart); - } - if (rgb_hex[2] > 1.0f) { - rgb_hex[2] = modf(rgb_hex[2], &intpart); - } - rgb_float_to_uchar(rgb_hex_uchar, rgb_hex); BLI_snprintf(col, sizeof(col), "%02X%02X%02X", UNPACK3_EX((uint), rgb_hex_uchar, )); |