Skip to content

Commit

Permalink
Overrideable color list
Browse files Browse the repository at this point in the history
  • Loading branch information
etrusci-org committed Jul 10, 2023
1 parent e126873 commit 1f9d1e1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
21 changes: 12 additions & 9 deletions app/mod/colorfader.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const modConf = {
/**
* fade to next color duration in seconds.
*/
duration: '3',
duration: '30',

/**
* fade timing function to use.
Expand All @@ -24,22 +24,25 @@ export const modConf = {
* whether to use randomized colors or the values from the colors list below.
* true or false.
*/
random: 'false',
random: 'true',

/**
* if random is set to true, colors values from this list will be used.
* if random is set to false, color values from this list will be used.
* any valid css color value should work. e.g. hex, rgb, hsl, etc.
* start each item with |.
* use backticks (`) here so you can span it over multiple lines (better readability).
* you can also put it on one line like so: '|#ff0000|#00ff00|#0000ff'.
* color picker: https://duckduckgo.com/?t=ffab&q=color+picker&ia=answer
*/
list: [
'#ff0000',
'#00ff00',
'#0000ff',
],
list: `
|#ff0000
|#00ff00
|#0000ff
`,

/**
* whether to shuffle the colors list.
* true or false.
*/
shuffle: 'true',
shuffle: 'false',
}
8 changes: 7 additions & 1 deletion app/mod/colorfader.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,13 @@ export class Mod extends ModBase
}
else {
if (this.queue.length == 0) {
this.queue = [...this.conf.list]
for (const item of this.conf.list.split('|')) {
const value = item.trim()
if (value) {
this.queue.push(value)
}
}

if (this.conf.shuffle == 'true') {
this.queue = fyShuffle(this.queue)
}
Expand Down

0 comments on commit 1f9d1e1

Please sign in to comment.