Add getThemes() method

This commit is contained in:
2023-12-16 14:36:43 +02:00
parent c140c1d3e1
commit b5f9bf05f3
2 changed files with 14 additions and 9 deletions

View File

@ -2279,8 +2279,13 @@ export class UserAPI {
} }
public randomTheme = (): void => { public randomTheme = (): void => {
let theme_names = Object.keys(colorschemes); let theme_names = this.getThemes();
let selected_theme = theme_names[Math.floor(Math.random() * theme_names.length)]; let selected_theme = theme_names[Math.floor(Math.random() * theme_names.length)];
this.app.readTheme(selected_theme); this.app.readTheme(selected_theme);
} }
public getThemes = (): string[] => {
return Object.keys(colorschemes);
}
} }

View File

@ -12,14 +12,14 @@ Ziffers patterns can be synced to any event by using **cue**, **sync**, **wait**
The <ic>cue(name: string)</ic> methods can be used to send cue messages for ziffers patterns. The <ic>wait(name: string)</ic> method is used to wait for the cue message to be received before starting the next cycle. The <ic>cue(name: string)</ic> methods can be used to send cue messages for ziffers patterns. The <ic>wait(name: string)</ic> method is used to wait for the cue message to be received before starting the next cycle.
${makeExample( ${makeExample(
"Sending cue from event and wait", "Sending cue from event and wait",
` `
beat(4.0) :: sound("bd").cue("foo").out(); beat(4.0) :: sound("bd").cue("foo").out()
z1("e 0 3 2 1 2 1").wait("foo").sound("sine").out(); z1("e 0 3 2 1 2 1").wait("foo").sound("sine").out()
`, `,
true, true,
)} )}
The <ic>sync(name: string)</ic> method is used to sync the ziffers pattern to the cue message. The <ic>sync(name: string)</ic> method is used to sync the ziffers pattern to the cue message.