replace hex codes with color vars

This commit is contained in:
saml33 2022-09-26 16:13:25 +10:00
parent feaf36e92d
commit 2a348b3f8c
1 changed files with 10 additions and 16 deletions

View File

@ -49,8 +49,8 @@ const TradingViewChart = () => {
fullscreen: false,
autosize: true,
studiesOverrides: {
'volume.volume.color.0': theme === 'Mango' ? '#E54033' : '#CC2929',
'volume.volume.color.1': theme === 'Mango' ? '#AFD803' : '#5EBF4D',
'volume.volume.color.0': COLORS.RED[theme],
'volume.volume.color.1': COLORS.GREEN[theme],
'volume.precision': 4,
},
}),
@ -76,26 +76,20 @@ const TradingViewChart = () => {
'haStyle',
'barStyle',
]
mainSeriesProperties.forEach((prop) => {
chartStyleOverrides = {
...chartStyleOverrides,
[`mainSeriesProperties.${prop}.barColorsOnPrevClose`]: true,
[`mainSeriesProperties.${prop}.drawWick`]: true,
[`mainSeriesProperties.${prop}.drawBorder`]: true,
[`mainSeriesProperties.${prop}.upColor`]:
theme === 'Mango' ? '#AFD803' : '#5EBF4D',
[`mainSeriesProperties.${prop}.downColor`]:
theme === 'Mango' ? '#E54033' : '#CC2929',
[`mainSeriesProperties.${prop}.borderColor`]:
theme === 'Mango' ? '#AFD803' : '#5EBF4D',
[`mainSeriesProperties.${prop}.borderUpColor`]:
theme === 'Mango' ? '#AFD803' : '#5EBF4D',
[`mainSeriesProperties.${prop}.borderDownColor`]:
theme === 'Mango' ? '#E54033' : '#CC2929',
[`mainSeriesProperties.${prop}.wickUpColor`]:
theme === 'Mango' ? '#AFD803' : '#5EBF4D',
[`mainSeriesProperties.${prop}.wickDownColor`]:
theme === 'Mango' ? '#E54033' : '#CC2929',
[`mainSeriesProperties.${prop}.upColor`]: COLORS.GREEN[theme],
[`mainSeriesProperties.${prop}.downColor`]: COLORS.RED[theme],
[`mainSeriesProperties.${prop}.borderColor`]: COLORS.GREEN[theme],
[`mainSeriesProperties.${prop}.borderUpColor`]: COLORS.GREEN[theme],
[`mainSeriesProperties.${prop}.borderDownColor`]: COLORS.RED[theme],
[`mainSeriesProperties.${prop}.wickUpColor`]: COLORS.GREEN[theme],
[`mainSeriesProperties.${prop}.wickDownColor`]: COLORS.RED[theme],
}
})