-
Notifications
You must be signed in to change notification settings - Fork 44
/
Copy pathshade.gs
74 lines (64 loc) · 1.59 KB
/
shade.gs
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
*
* Help is in the end of this script.
*
function shade( args )
_version = '0.02r1'
if( args = '' )
help()
return
endif
var = subwrd( args, 1 )
min = subwrd( args, 2 )
max = subwrd( args, 3 )
if( min = '-min' )
min = max
max = 1e+30
endif
if( min = '-max' )
min = -1e+30
endif
r = subwrd( args, 4 )
g = subwrd( args, 5 )
b = subwrd( args, 6 )
*** gray (default) ***
if( r = "" | g = "" | b = "" )
r = 211
g = 211
b = 211
endif
'set rgb 90 'r' 'g' 'b' 255'
'set rgb 91 255 255 255 0'
'set gxout shaded'
'set clevs 'min' 'max
* 'set ccols 0 90 0'
'set ccols 91 90 91'
'd 'var
return
*
* help
*
function help()
say ' Name:'
say ' shade '_version' - draw shade'
say ' '
say ' Usage:'
say ' shade '
say ' var (min max | -min min | -max max)'
say ' [r g b]'
say ''
say ' var : Variable name.'
say ' min : Minimum value of the region to shade.'
say ' max : Mamimum value of the region to shade.'
say ' r : RGB value (red) of the color for shading. Default value is 211.'
say ' g : RGB value (green) of the color for shading. Default value is 211.'
say ' b : RGB value (blue) of the color for shading. Default value is 211.'
say ''
say ' Note:'
say ' [arg-name] : specify if needed'
say ' (arg1 | arg2) : arg1 or arg2 must be specified'
say ' If (r,g,b) is not specified, the color of shade is set to gray'
say ''
say ' Copyright (C) 2009-2015 Chihiro Kodama'
say ' Distributed under GNU GPL (http://www.gnu.org/licenses/gpl.html)'
say ''
return