Color all notes per key

57 views
Skip to first unread message

Omar Guzman

unread,
Dec 29, 2017, 10:22:18 PM12/29/17
to vexflow
Is there away to color all the staff notes a color?  For example
All C's would be green.  All G's would be orange etc

Tomáš Hudziec

unread,
Jan 6, 2018, 1:12:05 PM1/6/18
to vexflow
I would iterate over all notes and conditionally set style for them.
something like this: (pseudo code)
for(i = 0 ; i < stave_notes.length() ; i++) {
  if(stave_notes[i].getKey() == 'C')
    stave_notes[i].setStyle({ fillStyle: 'green', strokeStyle: 'green' });
  ...
}

Dne sobota 30. prosince 2017 4:22:18 UTC+1 Omar Guzman napsal(a):
Reply all
Reply to author
Forward
0 new messages