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.

49 lines
911 B

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