summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Fl_Input_.cxx7
-rw-r--r--src/fl_color.cxx15
2 files changed, 13 insertions, 9 deletions
diff --git a/src/Fl_Input_.cxx b/src/Fl_Input_.cxx
index db50e4e75..c40e76027 100644
--- a/src/Fl_Input_.cxx
+++ b/src/Fl_Input_.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Input_.cxx,v 1.10 1998/12/02 15:39:31 mike Exp $"
+// "$Id: Fl_Input_.cxx,v 1.11 1998/12/29 14:05:12 mike Exp $"
//
// Common input widget routines for the Fast Light Tool Kit (FLTK).
//
@@ -231,7 +231,8 @@ void Fl_Input_::drawtext(int X, int Y, int W, int H) {
}
fl_clip(X, Y, W, H);
- Fl_Color color = active_r() ? textcolor() : inactive(textcolor());
+ Fl_Color color =
+ active_r() ? contrast(textcolor(),this->color()) : inactive(textcolor());
p = value();
// visit each line and draw it:
@@ -727,5 +728,5 @@ Fl_Input_::~Fl_Input_() {
}
//
-// End of "$Id: Fl_Input_.cxx,v 1.10 1998/12/02 15:39:31 mike Exp $".
+// End of "$Id: Fl_Input_.cxx,v 1.11 1998/12/29 14:05:12 mike Exp $".
//
diff --git a/src/fl_color.cxx b/src/fl_color.cxx
index fb8e57fa8..f60d1e16f 100644
--- a/src/fl_color.cxx
+++ b/src/fl_color.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: fl_color.cxx,v 1.4 1998/12/07 13:36:24 mike Exp $"
+// "$Id: fl_color.cxx,v 1.5 1998/12/29 14:05:13 mike Exp $"
//
// Color functions for the Fast Light Tool Kit (FLTK).
//
@@ -272,12 +272,15 @@ void fl_color(Fl_Color i) {
////////////////////////////////////////////////////////////////
// Ways to modify the fltk colormap:
+// bright/dark is decided based on high bits of green:
+#define bright(x) ((x)&0xc00000)
+
Fl_Color contrast(Fl_Color fg, Fl_Color bg) {
- // bright/dark is decided based on high bit of green:
- if (fl_cmap[bg] & 0x800000) {
- if (fl_cmap[fg] & 0x800000) return FL_GRAY_RAMP; // black from gray ramp
+ if (bright(fl_cmap[bg])) {
+ if (bright(fl_cmap[fg]))
+ return FL_GRAY_RAMP; // black from gray ramp
} else {
- if (!(fl_cmap[fg] & 0x800000))
+ if (!bright(fl_cmap[fg]))
return (Fl_Color)(FL_COLOR_CUBE-1); // white from gray ramp
}
return fg; // this color is ok
@@ -331,5 +334,5 @@ void Fl::get_color(Fl_Color i, uchar &red, uchar &green, uchar &blue) {
#endif
//
-// End of "$Id: fl_color.cxx,v 1.4 1998/12/07 13:36:24 mike Exp $".
+// End of "$Id: fl_color.cxx,v 1.5 1998/12/29 14:05:13 mike Exp $".
//