Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
code-raisan committed May 18, 2022
1 parent a111972 commit d097ce8
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 3 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# gocolor

Goでコンソールに出力する文字色を変えれます。

# How to use

1. Install

```bash
go install
```
44 changes: 41 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,43 @@
package gocolor
package main

func Say() {
print("hello")
var defalt string = "\u001b[0m"

func Red(text string) string {
result := "\u001b[31m" + text + defalt
return result
}

func Blue(text string) string {
result := "\u001b[34m" + text + defalt
return result
}

func Yellow(text string) string {
result := "\u001b[33m" + text + defalt
return result
}

func Green(text string) string {
result := "\u001b[32m" + text + defalt
return result
}

func Magenta(text string) string {
result := "\u001b[35m" + text + defalt
return result
}

func Cayn(text string) string {
result := "\u001b[36m" + text + defalt
return result
}

func White(text string) string {
result := "\u001b[37m" + text + defalt
return result
}

func Black(text string) string {
result := "\u001b[30m" + text + defalt
return result
}

0 comments on commit d097ce8

Please sign in to comment.