Skip to content

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

License

Notifications You must be signed in to change notification settings

code-raisan/gocolor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 

Repository files navigation

gocolor

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

Change the color of characters output to the console with Go.

How to use

Install

go get github.com/code-raisan/gocolor@latest

Sample

gocolor.Default() を使用すると通常の文字色に戻すことができます

色文字の出力例

package main

import (
	"github.com/code-raisan/gocolor"
)

func main() {
    // Out put is red
    println(gocolor.Red("gocolor.Red()"))
	
    // Out put is blue
    println(gocolor.Blue("gocolor.Blue()"))
	
    // Out put is yellow
    println(gocolor.Yellow("gocolor.Yellow()"))
	
    // Out put is green
    println(gocolor.Green("gocolor.Green()"))
	
    // Out put is purple(magenta)
    println(gocolor.Purple("gocolor.Purple()"))
	
    // Out put is cyan
    println(gocolor.Cyan("gocolor.Cyan()"))
	
    // Out put is white
    println(gocolor.White("gocolor.White()"))
	
    // Out put is black
    println(gocolor.Black("gocolor.Black()"))
}

image