diff --git a/src/apps/icon-o-matic/generic/gui/panel/color_picker/ColorField.cpp b/src/apps/icon-o-matic/generic/gui/panel/color_picker/ColorField.cpp index 93aae006c5..7ddbde7de5 100644 --- a/src/apps/icon-o-matic/generic/gui/panel/color_picker/ColorField.cpp +++ b/src/apps/icon-o-matic/generic/gui/panel/color_picker/ColorField.cpp @@ -315,7 +315,8 @@ ColorField::SetModeAndValue(selected_color_mode mode, float fixed_value) R *= 255.0; G *= 255.0; B *= 255.0; } - rgb_color color = { round(R), round(G), round(B), 255 }; + rgb_color color = { (uint8)round(R), (uint8)round(G), (uint8)round(B), + 255 }; fBgBitmap[0]->Unlock(); diff --git a/src/apps/icon-o-matic/generic/gui/panel/color_picker/ColorPickerView.cpp b/src/apps/icon-o-matic/generic/gui/panel/color_picker/ColorPickerView.cpp index 4633d2e36c..d4c7b4558b 100644 --- a/src/apps/icon-o-matic/generic/gui/panel/color_picker/ColorPickerView.cpp +++ b/src/apps/icon-o-matic/generic/gui/panel/color_picker/ColorPickerView.cpp @@ -82,7 +82,8 @@ ColorPickerView::layout(BRect frame) void ColorPickerView::AttachedToWindow() { - rgb_color color = { (int)(r * 255), (int)(g * 255), (int)(b * 255), 255 }; + rgb_color color = { (uint8)(r * 255), (uint8)(g * 255), (uint8)(b * 255), + 255 }; BView::AttachedToWindow(); @@ -266,7 +267,8 @@ ColorPickerView::MessageReceived(BMessage *message) HSV_to_RGB(h, s, v, r, g, b); } - rgb_color color = { round(r*255), round(g*255), round(b*255), 255 }; + rgb_color color = { (uint8)round(r * 255), (uint8)round(g * 255), + (uint8)round(b * 255), 255 }; SetColor(color); @@ -275,7 +277,8 @@ ColorPickerView::MessageReceived(BMessage *message) case MSG_HEXTEXTCONTROL: { if (fHexTextControl->TextView()->TextLength()==6) { const char *string = fHexTextControl->TextView()->Text(); - rgb_color color = { hexdec(string, 0), hexdec(string, 2), hexdec(string, 4), 255 }; + rgb_color color = { (uint8)hexdec(string, 0), (uint8)hexdec(string, 2), + (uint8)hexdec(string, 4), 255 }; SetColor(color); } } break; @@ -449,7 +452,8 @@ ColorPickerView::_UpdateColor(float value, float value1, float value2) else HSV_to_RGB(h, s, v, r, g, b); - rgb_color color = { (int)(r*255), (int)(g*255), (int)(b*255), 255 }; + rgb_color color = { (uint8)round(r * 255), (uint8)round(g*255), + (uint8)round(b * 255), 255 }; fColorPreview->SetColor(color); }