@@ -167,9 +167,7 @@ const (
167167)
168168
169169// Bit4 an method for create Color
170- func Bit4 (code uint8 ) Color {
171- return Color (code )
172- }
170+ func Bit4 (code uint8 ) Color { return Color (code ) }
173171
174172/*************************************************************
175173 * Color render methods
@@ -185,33 +183,27 @@ func (c Color) Name() string {
185183}
186184
187185// Text render a text message
188- func (c Color ) Text (message string ) string {
189- return RenderString (c .String (), message )
190- }
186+ func (c Color ) Text (message string ) string { return RenderString (c .String (), message ) }
191187
192188// Render messages by color setting
193189// Usage:
194190// green := color.FgGreen.Render
195191// fmt.Println(green("message"))
196- func (c Color ) Render (a ... interface {}) string {
197- return RenderCode (c .String (), a ... )
198- }
192+ func (c Color ) Render (a ... interface {}) string { return RenderCode (c .String (), a ... ) }
199193
200194// Renderln messages by color setting.
201195// like Println, will add spaces for each argument
196+ //
202197// Usage:
203198// green := color.FgGreen.Renderln
204199// fmt.Println(green("message"))
205- func (c Color ) Renderln (a ... interface {}) string {
206- return RenderWithSpaces (c .String (), a ... )
207- }
200+ func (c Color ) Renderln (a ... interface {}) string { return RenderWithSpaces (c .String (), a ... ) }
208201
209202// Sprint render messages by color setting. is alias of the Render()
210- func (c Color ) Sprint (a ... interface {}) string {
211- return RenderCode (c .String (), a ... )
212- }
203+ func (c Color ) Sprint (a ... interface {}) string { return RenderCode (c .String (), a ... ) }
213204
214205// Sprintf format and render message.
206+ //
215207// Usage:
216208// green := color.Green.Sprintf
217209// colored := green("message")
@@ -220,6 +212,7 @@ func (c Color) Sprintf(format string, args ...interface{}) string {
220212}
221213
222214// Print messages.
215+ //
223216// Usage:
224217// color.Green.Print("message")
225218// OR:
@@ -230,16 +223,15 @@ func (c Color) Print(args ...interface{}) {
230223}
231224
232225// Printf format and print messages.
226+ //
233227// Usage:
234228// color.Cyan.Printf("string %s", "arg0")
235229func (c Color ) Printf (format string , a ... interface {}) {
236230 doPrintV2 (c .Code (), fmt .Sprintf (format , a ... ))
237231}
238232
239233// Println messages with new line
240- func (c Color ) Println (a ... interface {}) {
241- doPrintlnV2 (c .String (), a )
242- }
234+ func (c Color ) Println (a ... interface {}) { doPrintlnV2 (c .String (), a ) }
243235
244236// Light current color. eg: 36(FgCyan) -> 96(FgLightCyan).
245237//
@@ -326,21 +318,13 @@ func (c Color) RGB() RGBColor {
326318}
327319
328320// Code convert to code string. eg "35"
329- func (c Color ) Code () string {
330- // return fmt.Sprintf("%d", c)
331- return strconv .Itoa (int (c ))
332- }
321+ func (c Color ) Code () string { return strconv .Itoa (int (c )) }
333322
334323// String convert to code string. eg "35"
335- func (c Color ) String () string {
336- // return fmt.Sprintf("%d", c)
337- return strconv .Itoa (int (c ))
338- }
324+ func (c Color ) String () string { return strconv .Itoa (int (c )) }
339325
340326// IsValid color value
341- func (c Color ) IsValid () bool {
342- return c < 107
343- }
327+ func (c Color ) IsValid () bool { return c < 107 }
344328
345329/*************************************************************
346330 * basic color maps
0 commit comments