Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coloring note heads in chords #1614

Open
taat opened this issue Mar 25, 2024 · 1 comment
Open

Coloring note heads in chords #1614

taat opened this issue Mar 25, 2024 · 1 comment

Comments

@taat
Copy link

taat commented Mar 25, 2024

I can't find a way to change the fill color or add any attributes to a single note within a chord (each note head with of a different
color). Is this possible with VexFlow?

I'm rendering a chord like this:

let notes = score.notes('(F4 G#4 C#5)/4', { clef: clef } );

I can even add some custom attributes for a whole group of notes:

let notes = score.notes('(F4 G#4 C#5)/4[id="foobar"]', { clef: clef } );

But how do I change a color or attribute of a just single note (eg. G#4 should be red).

@taat
Copy link
Author

taat commented Mar 26, 2024

False alarm, found it:

                        notes[0].setKeyStyle(1, {fillStyle: "red"});

sorry for the noise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant