colors.go 916 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. package aes
  2. import "strings"
  3. import "strconv"
  4. //import "fmt"
  5. type Effect int
  6. type Effects []Effect
  7. func (effects Effects) Format() string {
  8. intStrs := make([]string, len(effects))
  9. for i, e := range effects {
  10. intStrs[i] = strconv.Itoa(int(e))
  11. }
  12. return strings.Join(intStrs, ";")
  13. }
  14. // Effect codes.
  15. const (
  16. EffectReset Effect = iota
  17. EffectBold
  18. EffectDim
  19. EffectItalic
  20. EffectUnderline
  21. EffectBlinking
  22. )
  23. // Keep effect codes.
  24. const (
  25. EffectInverse Effect = 7 + iota
  26. EffectHidden
  27. // Effect strikethrough.
  28. EffectStirke
  29. )
  30. // Foreground effect codes.
  31. const (
  32. EffectBlackFG = 30 + iota
  33. EffectRedFG
  34. EffectGreenFG
  35. EffectYellowFG
  36. EffectBlueFG
  37. EffectMagentaFG
  38. EffectCyanFG
  39. EffectWhiteFG
  40. EffectDefaultFG
  41. )
  42. // Background effect codes.
  43. const (
  44. EffectBlackBG Effect = 40 + iota
  45. EffectRedBG
  46. EffectGreenBG
  47. EffectYellowBG
  48. EffectBlueBG
  49. EffectMagentaBG
  50. EffectCyanBG
  51. EffectWhiteBG
  52. EffectDefaultBG
  53. )