diff --git a/mixer/src/DPM.C b/mixer/src/DPM.C index e217d34..0bfd49b 100644 --- a/mixer/src/DPM.C +++ b/mixer/src/DPM.C @@ -53,7 +53,20 @@ DPM::DPM ( int X, int Y, int W, int H, const char *L ) : /* initialize gradients */ if ( DPM::_gradient[ 0 ] == 0 ) - DPM::blend( FL_GREEN, FL_RED ); + { + int breaks[] = {0,60,70,80,90,127}; + + Fl_Color cols[] = { + fl_rgb_color( 45,58,64), + fl_rgb_color( 84,181,195 ), + fl_rgb_color( 122,200,211 ), + fl_rgb_color( 178,213,212 ), + fl_rgb_color( 209,213,179 ), + fl_rgb_color( 250, 40, 30 ) + }; + + DPM::blend( 6, breaks, cols ); + } box( FL_FLAT_BOX ); color( FL_BACKGROUND_COLOR ); @@ -170,7 +183,7 @@ DPM::draw ( void ) for ( int p = lo; p <= hi; p++ ) { Fl_Color c; - + if ( p > v && p != pv ) c = dim_div_color( p ); else if ( p != clipv ) @@ -208,6 +221,7 @@ DPM::draw ( void ) fl_line( X, yy, X + W - 1, yy ); } } + /* } */ /* else */ /* { */ diff --git a/mixer/src/DPM.H b/mixer/src/DPM.H index fa94e0b..6344572 100644 --- a/mixer/src/DPM.H +++ b/mixer/src/DPM.H @@ -88,12 +88,16 @@ public: static void - blend ( Fl_Color min, Fl_Color max ) + blend ( int nbreaks, int* b, Fl_Color *c ) { - for ( int i = 128; i-- ; ) - _gradient[ i ] = fl_color_average( max, min, i / (float)128 ); + for ( int i = 0; i < nbreaks - 1; i++ ) + { + int k = 0; + for ( int j = b[i]; j <= b[i+1]; j++, k++ ) + _gradient[ j ] = fl_color_average( c[i+1], c[i], ( k ) / (float)(b[i+1] - b[i] )); + } - for ( int i = 128; i-- ; ) + for ( int i = 0; i < 127; i++ ) _dim_gradient[ i ] = fl_color_average( FL_BLACK, _gradient[ i ], _dim ); } };