File: colors.go

package info (click to toggle)
golang-github-minio-colorjson 1.0.8-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 204 kB
  • sloc: makefile: 2
file content (29 lines) | stat: -rw-r--r-- 861 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// Copyright 2010 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the https://golang.org/LICENSE file.

package colorjson

import (
	"github.com/fatih/color"
	"github.com/minio/pkg/v3/console"
)

const (
	// FgDarkGray is the shell color code for dark gray. Needs to be followed by
	// FgBlack to render dark gray
	FgDarkGray = 1
	jsonString = "jsonGreen"
	jsonBool   = "jsonRed"
	jsonNum    = "jsonRed"
	jsonKey    = "jsonBoldBlue"
	jsonNull   = "jsonBoldDarkGray"
)

func init() {
	console.SetColor(jsonString, color.New(color.FgGreen))
	console.SetColor(jsonBool, color.New(color.FgRed))
	console.SetColor(jsonNum, color.New(color.FgRed))
	console.SetColor(jsonKey, color.New(color.FgBlue, color.Bold))
	console.SetColor(jsonNull, color.New(FgDarkGray, color.FgBlack, color.Bold))
}