summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Fl_Button.cxx2
-rw-r--r--src/fl_color.cxx4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/Fl_Button.cxx b/src/Fl_Button.cxx
index a4e545f42..984ecf0a2 100644
--- a/src/Fl_Button.cxx
+++ b/src/Fl_Button.cxx
@@ -62,7 +62,7 @@ void Fl_Button::draw() {
if (type() == FL_HIDDEN_BUTTON) return;
Fl_Color col = value() ? selection_color() : color();
draw_box(value() ? (down_box()?down_box():fl_down(box())) : box(), col);
- if (labeltype() == FL_NORMAL_LABEL) {
+ if (labeltype() == FL_NORMAL_LABEL && value()) {
Fl_Color c = labelcolor();
labelcolor(fl_contrast(c, col));
draw_label();
diff --git a/src/fl_color.cxx b/src/fl_color.cxx
index d2dcefb1c..999287468 100644
--- a/src/fl_color.cxx
+++ b/src/fl_color.cxx
@@ -378,8 +378,8 @@ Fl_Color fl_contrast(Fl_Color fg, Fl_Color bg) {
l2 = ((c2 >> 24) * 31 + ((c2 >> 16) & 255) * 61 + ((c2 >> 8) & 255) * 8) / 100;
// Compare and return the contrasting color...
- if ((l1 - l2) > 127) return fg;
- else if ((l2 - l1) > 127) return fg;
+ if ((l1 - l2) > 85) return fg;
+ else if ((l2 - l1) > 85) return fg;
else if (l2 > 127) return FL_BLACK;
else return FL_WHITE;
}