updated theme brightness for light/dark

This commit is contained in:
tim
2024-10-09 17:07:30 -04:00
parent e8a3a85d88
commit 6d19adb130

View File

@@ -12,11 +12,12 @@ export const white = '#FFFFFF';
export const black = '#000000';
// adjust this number upwards to make the TradingView palette brighter and downwards for darker
const middleShadeIndex = 5
const lightMiddleShadeIndex = 7
const darkMiddleShadeIndex = 5
const numShades = 20
function shadesOf(rgb) {
function shadesOf(rgb, middleShadeIndex) {
const c = new Color(rgb)
const lights = []
const darks = []
@@ -34,34 +35,26 @@ function shadesOf(rgb) {
return [...lights.toReversed(), ...darks]
}
export const greens = shadesOf(green);
export const reds = shadesOf(red);
export const yellows = shadesOf(yellow);
export const oranges = shadesOf(orange);
export const blues = shadesOf(blue);
export const grays = shadesOf(gray);
export const purples = shadesOf(purple);
export const tvLightTheme = {
"color1": blues,
"color2": grays,
"color3": reds,
"color4": greens,
"color5": oranges,
"color6": purples,
"color7": yellows,
"color1": shadesOf(blue, lightMiddleShadeIndex),
"color2": shadesOf(gray, lightMiddleShadeIndex),
"color3": shadesOf(red, lightMiddleShadeIndex),
"color4": shadesOf(green, lightMiddleShadeIndex),
"color5": shadesOf(orange, lightMiddleShadeIndex),
"color6": shadesOf(purple, lightMiddleShadeIndex),
"color7": shadesOf(yellow, lightMiddleShadeIndex),
"white": white,
"black": black,
}
export const tvDarkTheme = {
"color1": blues,
"color2": grays,
"color3": reds,
"color4": greens,
"color5": oranges,
"color6": purples,
"color7": yellows,
"color1": shadesOf(blue, darkMiddleShadeIndex),
"color2": shadesOf(gray, darkMiddleShadeIndex),
"color3": shadesOf(red, darkMiddleShadeIndex),
"color4": shadesOf(green, darkMiddleShadeIndex),
"color5": shadesOf(orange, darkMiddleShadeIndex),
"color6": shadesOf(purple, darkMiddleShadeIndex),
"color7": shadesOf(yellow, darkMiddleShadeIndex),
"white": white,
"black": black,
}