white color table rows

Former-commit-id: 938d2ddad12f02008d6989d92f2206e6462f883d [formerly 938d2ddad12f02008d6989d92f2206e6462f883d [formerly 9f9db63ce7ca811fb781c348862e6ccd1de92f2e [formerly 8dd89487d0]]]
Former-commit-id: 12dc62f0981c56e4f6f072ed01c6f09f0bb33f71
Former-commit-id: a2b2d4170d3a59802b10a029b2a7e6e9e79a0ce2 [formerly a56be211a748419117dbc369e615089266de1483]
Former-commit-id: e699eee40c33090c7f775029fa75a580dd33040c
pull/15/head
Miguel Mota 6 years ago
parent bfcefcab13
commit 73b0418bd4

@ -6,6 +6,7 @@ import (
"time"
"github.com/gizak/termui"
"github.com/miguelmota/cointop/pkg/color"
)
func (ct *Cointop) updateChart() error {
@ -20,7 +21,7 @@ func (ct *Cointop) updateChart() error {
p := ct.chartpoints[i][j]
s = fmt.Sprintf("%s%c", s, p.Ch)
}
fmt.Fprintln(ct.chartview, s)
fmt.Fprintln(ct.chartview, color.White(s))
}
return nil
}

@ -17,7 +17,7 @@ func (ct *Cointop) updateMarketbar() error {
timeframe := "7 Day"
ct.Update(func() {
ct.marketview.Clear()
fmt.Fprintln(ct.marketview, pad.Right(fmt.Sprintf("%s Chart: %s • Total Market Cap: %s • 24H Volume: %s • BTC Dominance: %.2f%% • Active Currencies: %s • Active Markets: %s", color.Cyan("cointop"), timeframe, color.WhiteBold(humanize.Commaf(market.TotalMarketCapUSD)), humanize.Commaf(market.Total24HVolumeUSD), market.BitcoinPercentageOfMarketCap, humanize.Commaf(float64(market.ActiveCurrencies)), humanize.Commaf(float64(market.ActiveMarkets))), maxX, " "))
fmt.Fprintln(ct.marketview, color.White(pad.Right(fmt.Sprintf("%s Chart: %s • Total Market Cap: %s • 24H Volume: %s • BTC Dominance: %.2f%% • Active Currencies: %s • Active Markets: %s", color.Cyan("cointop"), timeframe, humanize.Commaf(market.TotalMarketCapUSD), humanize.Commaf(market.Total24HVolumeUSD), market.BitcoinPercentageOfMarketCap, humanize.Commaf(float64(market.ActiveCurrencies)), humanize.Commaf(float64(market.ActiveMarkets))), maxX, " ")))
})
return nil
}

@ -60,18 +60,18 @@ func (ct *Cointop) refreshTable() error {
name = fmt.Sprintf("%s...", name[0:18])
}
ct.table.AddRow(
fmt.Sprintf("%7v ", coin.Rank),
fmt.Sprintf("%.22s", name),
fmt.Sprintf("%.6s", coin.Symbol),
color.White(fmt.Sprintf("%7v ", coin.Rank)),
color.White(fmt.Sprintf("%.22s", name)),
color.White(fmt.Sprintf("%.6s", coin.Symbol)),
colorprice(fmt.Sprintf("%12s", humanize.Commaf(coin.PriceUSD))),
fmt.Sprintf("%17s", humanize.Commaf(coin.MarketCapUSD)),
fmt.Sprintf("%15s", humanize.Commaf(coin.USD24HVolume)),
color.White(fmt.Sprintf("%17s", humanize.Commaf(coin.MarketCapUSD))),
color.White(fmt.Sprintf("%15s", humanize.Commaf(coin.USD24HVolume))),
color1h(fmt.Sprintf("%8.2f%%", coin.PercentChange1H)),
color24h(fmt.Sprintf("%8.2f%%", coin.PercentChange24H)),
color7d(fmt.Sprintf("%8.2f%%", coin.PercentChange7D)),
fmt.Sprintf("%21s", humanize.Commaf(coin.TotalSupply)),
fmt.Sprintf("%18s", humanize.Commaf(coin.AvailableSupply)),
fmt.Sprintf("%18s", lastUpdated),
color.White(fmt.Sprintf("%21s", humanize.Commaf(coin.TotalSupply))),
color.White(fmt.Sprintf("%18s", humanize.Commaf(coin.AvailableSupply))),
color.White(fmt.Sprintf("%18s", lastUpdated)),
// add %percent of cap
)
}

Loading…
Cancel
Save