static void configure_note_colors(void){ for(int i=0;i<NUM_NOTE_COLOR_CONF;i++){ QColor start_color = get_custom_qcolor(note_color_conf[i][1]); QColor end_color = get_custom_qcolor(note_color_conf[i+1][1]); int start_note = note_color_conf[i][0]; int end_note = note_color_conf[i+1][0]; if(start_note<64) start_color = get_qcolor(TEXT_COLOR_NUM); else end_color = get_qcolor(WAVEFORM_COLOR_NUM); for(int note=start_note;note<end_note;note++){ //printf("setting %d (%d-%d) to %d %d %f\n",note,start_note,end_note,note_color_conf[i][1], note_color_conf[i+1][1], (float)(note-start_note)/(end_note-start_note)); g_note_colors[note] = mix_colors(end_color, start_color, (float)(note-start_note)/(end_note-start_note)); } } }
QColor get_qcolor(enum ColorNums colornum){ return get_custom_qcolor((int)colornum); }