diff options
| author | Matthias Melcher <fltk@matthiasm.com> | 2005-11-02 11:04:26 +0000 |
|---|---|---|
| committer | Matthias Melcher <fltk@matthiasm.com> | 2005-11-02 11:04:26 +0000 |
| commit | 04f1ab054ba42f596f122d7095d9397d2db8703d (patch) | |
| tree | 4a0721c61b22a08efff46af1ee3a00e3a1152012 | |
| parent | 965f74c3784c3142153ba82b8cc62ed63739c182 (diff) | |
STR #1052: reworked coloring of clocks
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4620 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
| -rw-r--r-- | src/Fl_Clock.cxx | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/Fl_Clock.cxx b/src/Fl_Clock.cxx index 8204a5a6a..0cc8e2dbf 100644 --- a/src/Fl_Clock.cxx +++ b/src/Fl_Clock.cxx @@ -71,24 +71,26 @@ static void rect(double x, double y, double w, double h) { } void Fl_Clock_Output::draw(int X, int Y, int W, int H) { - draw_box(box(), X, Y, W, H, type()==FL_ROUND_CLOCK ? FL_GRAY : color()); + Fl_Color box_color = type()==FL_ROUND_CLOCK ? FL_GRAY : color(); + Fl_Color shadow_color = fl_color_average(box_color, FL_BLACK, 0.5); + draw_box(box(), X, Y, W, H, box_color); fl_push_matrix(); fl_translate(X+W/2.0-.5, Y+H/2.0-.5); fl_scale((W-1)/28.0, (H-1)/28.0); if (type() == FL_ROUND_CLOCK) { fl_color(color()); fl_begin_polygon(); fl_circle(0,0,14); fl_end_polygon(); - fl_color(FL_BLACK); + fl_color(FL_FOREGROUND_COLOR); fl_begin_loop(); fl_circle(0,0,14); fl_end_loop(); } // draw the shadows: fl_push_matrix(); fl_translate(0.60, 0.60); - drawhands(FL_DARK3, FL_DARK3); + drawhands(shadow_color, shadow_color); fl_pop_matrix(); // draw the tick marks: fl_push_matrix(); - fl_color(FL_BLACK); // color was 52 + fl_color(FL_FOREGROUND_COLOR); // color was 52 for (int i=0; i<12; i++) { if (i==6) rect(-0.5, 9, 1, 2); else if (i==3 || i==0 || i== 9) rect(-0.5, 9.5, 1, 1); @@ -97,7 +99,7 @@ void Fl_Clock_Output::draw(int X, int Y, int W, int H) { } fl_pop_matrix(); // draw the hands: - drawhands(selection_color(), FL_GRAY0); // color was 54 + drawhands(selection_color(), FL_FOREGROUND_COLOR); // color was 54 fl_pop_matrix(); } |
