File: colour_tester.in

package info (click to toggle)
munin 2.0.76-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 7,064 kB
  • sloc: perl: 11,684; java: 1,924; sh: 1,632; makefile: 636; javascript: 365; python: 267
file content (52 lines) | stat: -rw-r--r-- 1,321 bytes parent folder | download | duplicates (5)
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!@@BASH@@
# -*- sh -*-

#%# family=test

# Requires munin master version 1.2.5 or 1.3.3 or higher.
# Just draw coloured lines to show off palette.

#        Greens Blues Oranges Dk yel Dk blu Purple lime   Reds   Gray
COLOURS="00CC00 0066B3 FF8000 FFCC00 330099 990099 CCFF00 FF0000 808080
         008F00 00487D B35A00 B38F00        6B006B 8FB300 B30000 BEBEBE
         80FF80 80C9FF FFC080 FFE680 AA80FF EE00CC FF8080
         666600 FFBFFF 00FFCC CC6699 999900"

# Removed: Dark blue line 2: 24006B
# Removed: Line 3, pastels
# Removed: Purple line 3, FF80FF
# Removed: Line 3, column green.  Too light.
# Inserted: Gray column
# Inserted: New last line with misc colours not represented on the
# colour wheel; for this line the headlines are not accurate.

# http://www.visibone.com/color/chart_847.gif

I=1
for C in $COLOURS; do
    col[$I]="$C"
    I=$((I + 1))
done
NUMCOL=$((I - 1))


do_ () { # Fetch
   for I in $(seq 1 "$NUMCOL"); do
       echo "l$I.value $I"
   done
}

do_config () {
    echo "graph_title Colour testing plugin"
    echo "graph_vlabel Colour index and colour"
    for I in $(seq 1 "$NUMCOL"); do
        echo "l$I.label ${col[$I]}"
        echo "l$I.colour ${col[$I]}"
        echo "l$I.type GAUGE"
    done
}

case $1 in
    ''|config) eval "do_$1";;
    *) echo Error >&2; exit 1;;
esac