ansicolor

println 256 colors

ansiColor('xterm') { node('controller') {
  List matrix = []
  List line = []
  [38, 48].collect { fgbg ->
    (1..255).collect { color ->
      """\033[${fgbg};5;${color}m ${String.format("%03d", color)} \033[0m"""
    }
  }.flatten().eachWithIndex{ c, idx ->
    line += [c]
    if ( 4 == (idx+1)%12 ) {
      matrix.add( line )
      line = []
    }
  }

  println matrix.collect{ it.join(' ') }.join('\n')
}}
ansicolor 256 colors
  • or

    ansicolor 256 with name

color matrix libs

  • others

customized colors

xterm

NAME
COLOR
BRIGHT

black

#000000

#4C4C4C

red

#CD0000

#FF0000

green

#4C8045

#84A729

yellow

#F1BD3F

#F2C867

blue

#1E90FF

#4682B4

megenta

#CD00CD

#FF00FF

cyan

#5a9196

#6CB2B9

white

#E5E5E5

#FFFFFF

[!TIP] references:


original settings:

NAME
COLOR
BRIGHT

black

#000000

#4C4C4C

red

#CD0000

#FF0000

green

#00CD00

#00FF00

yellow

#CDCD00

#FFFF00

blue

#1E90FF

#4682B4

megenta

#CD00CD

#FF00FF

cyan

#00CDCD

#00FFFF

white

#E5E5E5

#FFFFFF

Last updated

Was this helpful?