Skip to content

Commit

Permalink
spectrum widget
Browse files Browse the repository at this point in the history
  • Loading branch information
felixroos committed Dec 16, 2024
1 parent 648fbf9 commit 8a33c17
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/codemirror/widget.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,10 @@ registerWidget('_pitchwheel', (id, options = {}, pat) => {
const ctx = getCanvasWidget(id, options).getContext('2d');
return pat.pitchwheel({ ...options, ctx, id });
});

registerWidget('_spectrum', (id, options = {}, pat) => {
let _size = options.size || 200;
options = { width: _size, height: _size, ...options, size: _size / 5 };
const ctx = getCanvasWidget(id, options).getContext('2d');
return pat.spectrum({ ...options, ctx, id });
});

0 comments on commit 8a33c17

Please sign in to comment.