How do I change the color of a single note?

1,038 views
Skip to first unread message

Myles English

unread,
Feb 15, 2015, 3:57:38 PM2/15/15
to vex...@googlegroups.com
I'm building a UI for editing scores for VexFlow and have note selection working, but can't figure out how to change the color of the selected note.  Any ideas?

Gregory Ristow

unread,
Mar 7, 2015, 4:25:04 PM3/7/15
to vex...@googlegroups.com
See the FAQ -- "Can I color notes individually?"

Basically...

To change an entire StaveNote (which may have multiple note heads) call:

     StaveNote.setStyle({fillStyle: "blue", strokeStyle: "blue"});

To change just one note head, call:

    StaveNote.setKeyStyle(index, style)

Where index is the numerical index of that pitch/notehead within the StaveNote, and style is as above.
Reply all
Reply to author
Forward
0 new messages