-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
245 additions
and
232 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package tui | ||
|
||
import "github.com/muesli/termenv" | ||
|
||
var ( | ||
term = termenv.ColorProfile() | ||
) | ||
|
||
// Return a function that will colorize the foreground of a given string. | ||
func makeFgStyle(color string) func(string) string { | ||
return termenv.Style{}.Foreground(term.Color(color)).Bold().Styled | ||
} | ||
|
||
var ( | ||
verylightBlue = makeFgStyle("45") | ||
lightBlue = makeFgStyle("39") | ||
blue = makeFgStyle("27") | ||
darkBlue = makeFgStyle("20") | ||
grey = makeFgStyle("#888888") | ||
) | ||
|
||
// ColorizeWhale the whale base on index | ||
func ColorizeWhale(i int, s string) string { | ||
switch i { | ||
case 0: | ||
return verylightBlue(s) | ||
case 1: | ||
return lightBlue(s) | ||
case 2: | ||
return blue(s) | ||
case 3: | ||
return darkBlue(s) | ||
default: | ||
return grey(s) | ||
} | ||
} | ||
|
||
// ColorizeWater the water base on index | ||
func ColorizeWater(i int, s string) string { | ||
switch i { | ||
case 0: | ||
return darkBlue(s) | ||
case 1: | ||
return blue(s) | ||
case 2: | ||
return lightBlue(s) | ||
case 3: | ||
return verylightBlue(s) | ||
case 4: | ||
return grey(s) | ||
default: | ||
return s | ||
} | ||
} |
Oops, something went wrong.