You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
1.0 KiB

  1. package main
  2. import "fmt"
  3. //Color struct, defines the color
  4. type Color struct{}
  5. var c Color
  6. //DarkGray color
  7. func (c Color) DarkGray(t string) {
  8. fmt.Print("\x1b[30;1m") //dark gray
  9. fmt.Println(t)
  10. fmt.Print("\x1b[0m") //defaultColor
  11. }
  12. //Red color
  13. func (c Color) Red(t string) {
  14. fmt.Print("\x1b[31;1m") //red
  15. fmt.Println(t)
  16. fmt.Print("\x1b[0m") //defaultColor
  17. }
  18. //Green color
  19. func (c Color) Green(t string) {
  20. fmt.Print("\x1b[32;1m") //green
  21. fmt.Println(t)
  22. fmt.Print("\x1b[0m") //defaultColor
  23. }
  24. //Yellow color
  25. func (c Color) Yellow(t string) {
  26. fmt.Print("\x1b[33;1m") //yellow
  27. fmt.Println(t)
  28. fmt.Print("\x1b[0m") //defaultColor
  29. }
  30. //Blue color
  31. func (c Color) Blue(t string) {
  32. fmt.Print("\x1b[34;1m") //blue
  33. fmt.Println(t)
  34. fmt.Print("\x1b[0m") //defaultColor
  35. }
  36. //Purple color
  37. func (c Color) Purple(t string) {
  38. fmt.Print("\x1b[35;1m") //purple
  39. fmt.Println(t)
  40. fmt.Print("\x1b[0m") //defaultColor
  41. }
  42. //Cyan color
  43. func (c Color) Cyan(t string) {
  44. fmt.Print("\x1b[36;1m") //cyan
  45. fmt.Println(t)
  46. fmt.Print("\x1b[0m") //defaultColor
  47. }