Skip to content

Commit

Permalink
feat: add color styles
Browse files Browse the repository at this point in the history
  • Loading branch information
forivall committed Jul 9, 2022
1 parent 555e94f commit fa099a7
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,44 @@ func parseColumns(cols string) ([]int, error) {
func parseStyle(styleOpt string) (table.Style, error) {
switch styleOpt {
case "unicode":
case "round":
return table.StyleRounded, nil
case "ascii":
return table.StyleDefault, nil
case "bold":
return table.StyleBold, nil
case "square":
return table.StyleLight, nil
case "double":
return table.StyleDouble, nil
case "color-bright":
return table.StyleColoredBright, nil
case "color-dark":
return table.StyleColoredDark, nil
case "color-dark-blue":
return table.StyleColoredBlackOnBlueWhite, nil
case "color-dark-cyan":
return table.StyleColoredBlackOnCyanWhite, nil
case "color-dark-green":
return table.StyleColoredBlackOnGreenWhite, nil
case "color-dark-magenta":
return table.StyleColoredBlackOnMagentaWhite, nil
case "color-dark-yellow":
return table.StyleColoredBlackOnYellowWhite, nil
case "color-dark-red":
return table.StyleColoredBlackOnRedWhite, nil
case "color-bright-blue":
return table.StyleColoredBlueWhiteOnBlack, nil
case "color-bright-cyan":
return table.StyleColoredCyanWhiteOnBlack, nil
case "color-bright-green":
return table.StyleColoredGreenWhiteOnBlack, nil
case "color-bright-magenta":
return table.StyleColoredMagentaWhiteOnBlack, nil
case "color-bright-red":
return table.StyleColoredRedWhiteOnBlack, nil
case "color-bright-yellow":
return table.StyleColoredYellowWhiteOnBlack, nil
default:
return table.Style{}, fmt.Errorf("unknown style option: %s", styleOpt)
}
Expand Down

0 comments on commit fa099a7

Please sign in to comment.