Skip to content

Commit

Permalink
chore: clean up
Browse files Browse the repository at this point in the history
Signed-off-by: cezar-r <[email protected]>
  • Loading branch information
cezar-r committed Oct 5, 2024
1 parent 01272da commit 9e8222a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ var (

CoinbaseCandleMax uint32 = 300

StreamRefreshRateMS int = 255
StreamRefreshRateMS int = 501

CryptoList []string = crypto.GetCryptoList()
StockList []string = []string{}
Expand Down
1 change: 1 addition & 0 deletions pkg/chart/chart.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ type InputData struct {
}

func DrawChart(ticker, interval string, isStill bool) error {
// chartConfig := createChartConfig(ticker, interval)
intervalIdx := utils.IndexOf(c.Intervals, interval)

if isStill {
Expand Down
2 changes: 1 addition & 1 deletion pkg/utils/build_chart/fill_latest_price.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func fillLatestPriceLine(chartView *[][]string, candles []types.Candle, max floa
color = c.DownColorBold
bgColor = c.DownColorBg
}
if color == c.ColorToAnsi["bold_white"] {
if utils.IsBrightColor(bgColor) {
textColor = c.ColorToAnsi["bold_black"]
} else {
textColor = c.ColorToAnsi["bold_white"]
Expand Down
10 changes: 10 additions & 0 deletions pkg/utils/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,3 +163,13 @@ func WriteConfig(config types.Config) error {

return nil
}

func IsBrightColor(color string) bool {
brightColors := []string{"\033[107m", "\033[102m", "\033[103m", "\033[106m"}
for _, brightColor := range brightColors {
if color == brightColor {
return true
}
}
return false
}

0 comments on commit 9e8222a

Please sign in to comment.