cherry pick from previously broken and abandoned branch

colorize buttons and ratio bar

Resolves #218
Using user options (#387)

edit color schemes

logistics for the added options

handles storage, change, initialize
This commit is contained in:
Yvon Cui committed 2022-01-18 09:54:17 -05:00
1 parent 510c083c77
commit b476c60fe0
7 files changed
+210 -8

No files matched your search

+32
View File
@@ -1,3 +1,7 @@
import {
extConfig,
} from "./state";
function roundDown(num) {
if (num < 1000) return num;
const int = Math.floor(Math.log10(num) - 2);
@@ -67,4 +71,32 @@ function cLog(message, writer) {
}
}
function getColorFromTheme(voteIsLike) {
let colorString;
switch(extConfig.colorTheme) {
case 'accessible':
if (voteIsLike === true) {
colorString = 'dodgerblue';
} else {
colorString = 'gold';
}
break;
case 'neon':
if (voteIsLike === true) {
colorString = 'aqua';
} else {
colorString = 'magenta';
}
break;
case 'classic':
default:
if (voteIsLike === true) {
colorString = 'lime';
} else {
colorString = 'red';
}
}
return colorString;
}
export { numberFormat, getBrowser, getVideoId, isVideoLoaded, cLog }