forked from pyrite-dev/milsko
MwStringPrintIntoBuffer
This commit is contained in:
parent
87c870a6c0
commit
35d2b4bb76
21 changed files with 233 additions and 331 deletions
|
|
@ -173,13 +173,13 @@ static void color_picker_click(MwWidget handle, void* user, void* call) {
|
|||
picker->chosen_color.green = picker->color_picker_image_data[i + 1];
|
||||
picker->chosen_color.blue = picker->color_picker_image_data[i + 2];
|
||||
|
||||
sprintf(hexColor, "#%02X%02X%02X", picker->chosen_color.red & 0xff, picker->chosen_color.green & 0xff, picker->chosen_color.blue & 0xff);
|
||||
MwPrintIntoBuffer(hexColor, 8, "#%02X%02X%02X", picker->chosen_color.red & 0xff, picker->chosen_color.green & 0xff, picker->chosen_color.blue & 0xff);
|
||||
|
||||
fr = picker->chosen_color.red > 128 ? 0 : 255;
|
||||
fg = picker->chosen_color.green > 128 ? 0 : 255;
|
||||
fb = picker->chosen_color.blue > 128 ? 0 : 255;
|
||||
|
||||
sprintf(fgColor, "#%02X%02X%02X", fr, fg, fb);
|
||||
MwPrintIntoBuffer(fgColor, 8, "#%02X%02X%02X", fr, fg, fb);
|
||||
MwSetText(picker->color_display_text, MwNforeground, fgColor);
|
||||
|
||||
MwSetText(picker->color_display_text, MwNbackground, hexColor);
|
||||
|
|
@ -247,7 +247,7 @@ static void color_display_text_change(MwWidget handle, void* user,
|
|||
fg = color->common.green > 128 ? 0 : 255;
|
||||
fb = color->common.blue > 128 ? 0 : 255;
|
||||
|
||||
sprintf(fgColor, "#%02X%02X%02X", fr, fg, fb);
|
||||
MwPrintIntoBuffer(fgColor, 9, "#%02X%02X%02X", fr, fg, fb);
|
||||
MwSetText(picker->color_display_text, MwNforeground, fgColor);
|
||||
|
||||
MwSetText(picker->color_display_text, MwNbackground, hexColor);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue