Browse Source

Sequencer: Use a 3 break gradient for velocity colors.

tags/non-daw-v1.3.0
Jonathan Moore Liles 2 years ago
parent
commit
368492f1c0
1 changed files with 14 additions and 7 deletions
  1. +14
    -7
      sequencer/src/gui/ui.fl

+ 14
- 7
sequencer/src/gui/ui.fl View File

@@ -98,14 +98,21 @@ Function {init_colors()} {open private C return_type {static void}
} {
code {unsigned int i;
/* velocity colors */

Fl_Color c[] = { FL_BLUE, FL_GREEN, FL_RED };
int b[] = {0, 64, 127 };
int nbreaks = 3;
for ( int i = 0; i < nbreaks - 1; i++ )
{
int k = 0;
for ( int j = b[i]; j <= b[i+1]; j++, k++ )
velocity_colors[ j ] = fl_color_average( c[i+1], c[i], ( k ) / (float)(b[i+1] - b[i] ));
}

Fl_Color lo = fl_color_average( FL_CYAN, FL_BLACK, 0.10 );
Fl_Color hi = fl_color_average( FL_CYAN, FL_WHITE, 0.80 );

for ( i = 128; i--; )
{
velocity_colors[i] = fl_color_average( hi, lo, 1.0 * ((float)i / 128) );
}} {}
} {}
}

widget_class Visual_Metronome {open


Loading…
Cancel
Save