tioga 1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Tioga_README +372 -0
- data/lgpl.txt +504 -0
- data/split/Dtable/defs.h +33 -0
- data/split/Dtable/dtable.c +1928 -0
- data/split/Dtable/dtable_intern.h +144 -0
- data/split/Dtable/dvector.h +61 -0
- data/split/Dtable/extconf.rb +4 -0
- data/split/Dtable/include/dtable.h +35 -0
- data/split/Dtable/lib/Dtable_extras.rb +90 -0
- data/split/Dtable/namespace.h +47 -0
- data/split/Dtable/safe_double.h +104 -0
- data/split/Dtable/symbols.c +92 -0
- data/split/Dtable/symbols.h +52 -0
- data/split/Dvector/defs.h +33 -0
- data/split/Dvector/dvector.c +5486 -0
- data/split/Dvector/dvector_intern.h +142 -0
- data/split/Dvector/extconf.rb +4 -0
- data/split/Dvector/include/dvector.h +61 -0
- data/split/Dvector/lib/Dvector_extras.rb +328 -0
- data/split/Dvector/lib/Numeric_extras.rb +134 -0
- data/split/Dvector/namespace.h +47 -0
- data/split/Dvector/safe_double.h +104 -0
- data/split/Dvector/symbols.c +92 -0
- data/split/Dvector/symbols.h +52 -0
- data/split/Flate/defs.h +33 -0
- data/split/Flate/extconf.rb +19 -0
- data/split/Flate/flate.c +156 -0
- data/split/Flate/flate_intern.h +97 -0
- data/split/Flate/include/flate.h +98 -0
- data/split/Flate/namespace.h +47 -0
- data/split/Flate/safe_double.h +104 -0
- data/split/Flate/symbols.c +92 -0
- data/split/Flate/symbols.h +52 -0
- data/split/Function/defs.h +33 -0
- data/split/Function/dvector.h +61 -0
- data/split/Function/extconf.rb +4 -0
- data/split/Function/function.c +988 -0
- data/split/Function/joint_qsort.c +258 -0
- data/split/Function/lib/Function_extras.rb +44 -0
- data/split/Function/namespace.h +47 -0
- data/split/Function/safe_double.h +104 -0
- data/split/Function/symbols.c +92 -0
- data/split/Function/symbols.h +52 -0
- data/split/Tioga/axes.c +774 -0
- data/split/Tioga/defs.h +33 -0
- data/split/Tioga/dtable.h +35 -0
- data/split/Tioga/dvector.h +61 -0
- data/split/Tioga/extconf.rb +4 -0
- data/split/Tioga/figures.c +672 -0
- data/split/Tioga/figures.h +855 -0
- data/split/Tioga/flate.h +98 -0
- data/split/Tioga/init.c +524 -0
- data/split/Tioga/lib/Arcs_and_Circles.rb +64 -0
- data/split/Tioga/lib/ColorConstants.rb +274 -0
- data/split/Tioga/lib/Colorbars.rb +10 -0
- data/split/Tioga/lib/Colormaps.rb +105 -0
- data/split/Tioga/lib/Coordinate_Conversions.rb +194 -0
- data/split/Tioga/lib/Creating_Paths.rb +94 -0
- data/split/Tioga/lib/Doc.rb +91 -0
- data/split/Tioga/lib/Executive.rb +515 -0
- data/split/Tioga/lib/FigMkr.rb +2224 -0
- data/split/Tioga/lib/FigureConstants.rb +125 -0
- data/split/Tioga/lib/Figures_and_Plots.rb +268 -0
- data/split/Tioga/lib/Images.rb +278 -0
- data/split/Tioga/lib/Legends.rb +190 -0
- data/split/Tioga/lib/MarkerConstants.rb +122 -0
- data/split/Tioga/lib/Markers.rb +129 -0
- data/split/Tioga/lib/Page_Frame_Bounds.rb +567 -0
- data/split/Tioga/lib/Rectangles.rb +94 -0
- data/split/Tioga/lib/Shading.rb +100 -0
- data/split/Tioga/lib/Special_Paths.rb +307 -0
- data/split/Tioga/lib/Strokes.rb +129 -0
- data/split/Tioga/lib/TeX_Text.rb +454 -0
- data/split/Tioga/lib/TexPreamble.rb +358 -0
- data/split/Tioga/lib/Titles_and_Labels.rb +306 -0
- data/split/Tioga/lib/Transparency.rb +89 -0
- data/split/Tioga/lib/Using_Paths.rb +164 -0
- data/split/Tioga/lib/Utils.rb +74 -0
- data/split/Tioga/lib/X_and_Y_Axes.rb +749 -0
- data/split/Tioga/lib/irb_tioga.rb +122 -0
- data/split/Tioga/lib/tioga.rb +1 -0
- data/split/Tioga/lib/tioga_ui.rb +5 -0
- data/split/Tioga/lib/tioga_ui_cmds.rb +793 -0
- data/split/Tioga/makers.c +989 -0
- data/split/Tioga/mk_tioga_sty.rb +53 -0
- data/split/Tioga/namespace.h +47 -0
- data/split/Tioga/pdf_font_dicts.c +18253 -0
- data/split/Tioga/pdfcolor.c +486 -0
- data/split/Tioga/pdfcoords.c +505 -0
- data/split/Tioga/pdffile.c +342 -0
- data/split/Tioga/pdfimage.c +536 -0
- data/split/Tioga/pdfpath.c +914 -0
- data/split/Tioga/pdfs.h +229 -0
- data/split/Tioga/pdftext.c +443 -0
- data/split/Tioga/safe_double.h +104 -0
- data/split/Tioga/symbols.c +92 -0
- data/split/Tioga/symbols.h +52 -0
- data/split/Tioga/texout.c +380 -0
- data/split/defs.h +33 -0
- data/split/extconf.rb +107 -0
- data/split/mkmf2.rb +1612 -0
- data/split/namespace.h +47 -0
- data/split/safe_double.h +104 -0
- data/split/scripts/tioga +4 -0
- data/split/symbols.c +92 -0
- data/split/symbols.h +52 -0
- data/tests/dtable_test.data +6 -0
- data/tests/dvector_read_test.data +1 -0
- data/tests/dvector_test.data +101 -0
- data/tests/tc_Dtable.rb +221 -0
- data/tests/tc_Dvector.rb +791 -0
- data/tests/tc_FMkr.rb +162 -0
- data/tests/tc_Flate.rb +45 -0
- data/tests/tc_Function.rb +111 -0
- data/tests/ts_Tioga.rb +38 -0
- metadata +163 -0
@@ -0,0 +1,64 @@
|
|
1
|
+
# Arcs_and_Circles.rb
|
2
|
+
|
3
|
+
module Tioga
|
4
|
+
|
5
|
+
# These are the methods for creating and using arcs and circles in PDF graphics.
|
6
|
+
|
7
|
+
class Arcs_and_Circles < Doc < FigureMaker
|
8
|
+
|
9
|
+
# Like adding lines from _start_ to _corner_ to _end_, but with the corner rounded
|
10
|
+
# with a radius equal to the minimum of the actual output distances for _dx_ and _dy_.
|
11
|
+
#
|
12
|
+
# The illustration shows in dark blue the arc that is added for the control points given in red.
|
13
|
+
#
|
14
|
+
# http://theory.kitp.ucsb.edu/~paxton/tioga_jpegs/append_arc.jpg
|
15
|
+
#
|
16
|
+
def append_arc_to_path(x_start, y_start, x_corner, y_corner, x_end, y_end, dx, dy)
|
17
|
+
end
|
18
|
+
|
19
|
+
# Create a circle with center at (_x_, _y_) having radius _r_ (given in x units).
|
20
|
+
def append_circle_to_path(x, y, r)
|
21
|
+
end
|
22
|
+
|
23
|
+
# Calls append_circle_to_path followed by #clip.
|
24
|
+
def clip_circle(x, y, r)
|
25
|
+
end
|
26
|
+
|
27
|
+
# Calls append_circle_to_path followed by #fill.
|
28
|
+
def fill_circle(x, y, r)
|
29
|
+
end
|
30
|
+
|
31
|
+
# Calls append_circle_to_path followed by #stroke.
|
32
|
+
def stroke_circle(x, y, r)
|
33
|
+
end
|
34
|
+
|
35
|
+
# Calls append_circle_to_path followed by fill_and_stroke.
|
36
|
+
def fill_and_stroke_circle(x, y, r)
|
37
|
+
end
|
38
|
+
|
39
|
+
# Equivalent to the following: create a unit circle with center at (_x_, _y_), scale it by _dx_ in the x direction,
|
40
|
+
# scale it by _dy_ in the y direction, then rotate it counter-clockwise by _angle_ degrees.
|
41
|
+
def append_oval_to_path(x, y, dx, dy, angle)
|
42
|
+
end
|
43
|
+
|
44
|
+
# Calls append_oval_to_path followed by #clip.
|
45
|
+
def clip_oval(x, y, dx, dy, angle)
|
46
|
+
end
|
47
|
+
|
48
|
+
# Calls append_oval_to_path followed by #fill.
|
49
|
+
def fill_oval(x, y, dx, dy, angle)
|
50
|
+
end
|
51
|
+
|
52
|
+
# Calls append_oval_to_path followed by #stroke.
|
53
|
+
def stroke_oval(x, y, dx, dy, angle)
|
54
|
+
end
|
55
|
+
|
56
|
+
# Calls append_oval_to_path followed by fill_and_stroke.
|
57
|
+
def fill_and_stroke_oval(x, y, dx, dy, angle)
|
58
|
+
end
|
59
|
+
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
end # class
|
64
|
+
end # module Tioga
|
@@ -0,0 +1,274 @@
|
|
1
|
+
module Tioga
|
2
|
+
|
3
|
+
# = Color names
|
4
|
+
#
|
5
|
+
# The table at the end of this webpage has about 200 color names
|
6
|
+
# and the corresponding red-green-blue triples of intensities. These color names can be used wherever a color is called for in tioga.
|
7
|
+
# To use the same colors in text, your TeX preamble should have the following:
|
8
|
+
# \include{color_names}
|
9
|
+
# The file <tt>color_names.tex</tt> is included in the tioga download and defines the full set of
|
10
|
+
# color names given below. To set some text in color, simply use something like the following:
|
11
|
+
# \textcolor{Crimson}{This will appear in crimson.}
|
12
|
+
#
|
13
|
+
# By the way, if you want to use color_names.tex, but don't want copies of it scattered around, you can
|
14
|
+
# put it in a directory that is on the LaTeX search path. Check your system for details. On Linux, I believe
|
15
|
+
# you can "export" the path to TEXINPUTS. On the Mac, you can try putting the file in ~/Library/texmf/tex/latex.
|
16
|
+
# Then add the needed line to your TeX files by doing this in your initialize method for the plots:
|
17
|
+
# t.tex_preamble += "\n\\include{color_names}\n"
|
18
|
+
#
|
19
|
+
# In addition to the list of predefined color names, there is a table below giving a small sample of each color.
|
20
|
+
#
|
21
|
+
# ---
|
22
|
+
#
|
23
|
+
# = Concerning the use of colors in plots
|
24
|
+
#
|
25
|
+
# When you pick colors for your plots, keep in mind that color deficiency, commonly known as "color blindness",
|
26
|
+
# is a common genetic trait. People with color deficiency are not blind to colors, they simply don't distinguish
|
27
|
+
# as many different colors as someone with normal color vision. For example, reds and greens might be the same
|
28
|
+
# ("reens" or "geds"?) and only brightness would show up as different. But the reds/greens would still appear to be
|
29
|
+
# different colors than the blues.
|
30
|
+
#
|
31
|
+
# Two common forms of color deficiency are called "protanopia" and "deuteranopia". Here's how they are
|
32
|
+
# described on the website {What Is Colorblindness}[http://colorvisiontesting.com/color2.htm].
|
33
|
+
#
|
34
|
+
# - For the protanope, the brightness of red, orange, and yellow is much reduced compared to normal. This dimming can be so pronounced that reds may be confused with black or dark gray, and red traffic lights may appear to be extinguished. They may learn to distinguish reds from yellows and from greens primarily on the basis of their apparent brightness or lightness, not on any perceptible hue difference. Violet, lavender, and purple are indistinguishable from various shades of blue because their reddish components are so dimmed as to be invisible. E.g. Pink flowers, reflecting both red light and blue light, may appear just blue to the protanope.
|
35
|
+
#
|
36
|
+
# http://theory.kitp.ucsb.edu/~paxton/tioga_jpegs/normalcolor72gif.gif
|
37
|
+
# http://theory.kitp.ucsb.edu/~paxton/tioga_jpegs/protanope72gif.gif
|
38
|
+
#
|
39
|
+
# - The deuteranope suffers the same hue discrimination problems as the protanope, but without the abnormal dimming. The names red, orange, yellow, and green really mean very little to him aside from being different names that every one else around him seems to be able to agree on. Similarly, violet, lavender, purple, and blue, seem to be too many names to use logically for hues that all look alike to him.
|
40
|
+
#
|
41
|
+
# http://theory.kitp.ucsb.edu/~paxton/tioga_jpegs/normalcolor72gif.gif
|
42
|
+
# http://theory.kitp.ucsb.edu/~paxton/tioga_jpegs/deuteranope72gif.gif
|
43
|
+
#
|
44
|
+
# ---
|
45
|
+
#
|
46
|
+
# To be considerate of your color deficient friends, pick color sets that are distinguishable for them too.
|
47
|
+
# Here's an example of a plot using six colors.
|
48
|
+
# In the first version on the left, the colors of the lines are BrightBlue, Goldenrod, Coral, Lilac, FireBrick, and RoyalPurple.
|
49
|
+
# The lower left version uses the often seen combination of red, green, blue, cyan, magenta, and yellow.
|
50
|
+
#
|
51
|
+
# On the right are the same plots as they might appear to someone with protanopia
|
52
|
+
# (made using VischeckURL[http://www.vischeck.com/vischeck/vischeckURL.php] -- a very useful site).
|
53
|
+
#
|
54
|
+
# http://theory.kitp.ucsb.edu/~paxton/tioga_jpegs/color_choices.jpg
|
55
|
+
#
|
56
|
+
# By using the first set of colors rather than the second, you get a plot that looks good for
|
57
|
+
# those in your audience with normal color vision and is much easier on those with a color deficiency.
|
58
|
+
# Why not do it?
|
59
|
+
#
|
60
|
+
# ---
|
61
|
+
#
|
62
|
+
# ---
|
63
|
+
#
|
64
|
+
# http://theory.kitp.ucsb.edu/~paxton/tioga_jpegs/colors1.jpg
|
65
|
+
#
|
66
|
+
# http://theory.kitp.ucsb.edu/~paxton/tioga_jpegs/colors2.jpg
|
67
|
+
#
|
68
|
+
# http://theory.kitp.ucsb.edu/~paxton/tioga_jpegs/colors3.jpg
|
69
|
+
#
|
70
|
+
# http://theory.kitp.ucsb.edu/~paxton/tioga_jpegs/colors4.jpg
|
71
|
+
#
|
72
|
+
|
73
|
+
module ColorConstants
|
74
|
+
AliceBlue = [ 0.94, 0.972, 1 ]
|
75
|
+
AntiqueWhite = [ 0.98, 0.92, 0.844 ]
|
76
|
+
Aqua = [ 0, 1, 1 ]
|
77
|
+
Aquamarine = [ 0.498, 1, 0.83 ]
|
78
|
+
Avocado = [ 0.6, 0.6, 0 ]
|
79
|
+
Azure = [ 0.94, 1, 1 ]
|
80
|
+
Beige = [ 0.96, 0.96, 0.864 ]
|
81
|
+
Bisque = [ 1, 0.894, 0.77 ]
|
82
|
+
Black = [ 0, 0, 0 ]
|
83
|
+
BlanchedAlmond = [ 1, 0.92, 0.804 ]
|
84
|
+
Blue = [ 0, 0, 1 ]
|
85
|
+
BlueGreen = [ 0, 0.6, 0.4 ]
|
86
|
+
BlueViolet = [ 0.54, 0.17, 0.888 ]
|
87
|
+
BrickRed = [ 0.645, 0, 0.129 ]
|
88
|
+
BrightBlue = [ 0, 0.4, 1.0 ]
|
89
|
+
BrightPink = [ 1.0, 0.4, 0.8 ]
|
90
|
+
Brown = [ 0.648, 0.165, 0.165 ]
|
91
|
+
Burgundy = [ 0.6, 0, 0.2 ]
|
92
|
+
BurlyWood = [ 0.87, 0.72, 0.53 ]
|
93
|
+
CadetBlue = [ 0.372, 0.62, 0.628 ]
|
94
|
+
Cement = [ 0.8, 0.8, 0.6 ]
|
95
|
+
Chartreuse = [ 0.498, 1, 0 ]
|
96
|
+
Chiffon = [ 0.98, 0.98, 0.824 ]
|
97
|
+
Chocolate = [ 0.824, 0.41, 0.116 ]
|
98
|
+
Coral = [ 1, 0.498, 0.312 ]
|
99
|
+
CornflowerBlue = [ 0.392, 0.585, 0.93 ]
|
100
|
+
Cornsilk = [ 1, 0.972, 0.864 ]
|
101
|
+
Crimson = [ 0.8, 0, 0.2 ]
|
102
|
+
Cyan = [ 0, 1, 1 ]
|
103
|
+
DarkBlue = [ 0, 0, 0.545 ]
|
104
|
+
DarkChocolate = [ 0.4, 0.2, 0 ]
|
105
|
+
DarkCyan = [ 0, 0.545, 0.545 ]
|
106
|
+
DarkGoldenrod = [ 0.72, 0.525, 0.044 ]
|
107
|
+
DarkGray = [ 0.664, 0.664, 0.664 ]
|
108
|
+
DarkGreen = [ 0, 0.392, 0 ]
|
109
|
+
DarkGrey = [ 0.664, 0.664, 0.664 ]
|
110
|
+
DarkKhaki = [ 0.74, 0.716, 0.42 ]
|
111
|
+
DarkLavender = [ 0.4, 0.2, 0.6 ]
|
112
|
+
DarkMagenta = [ 0.545, 0, 0.545 ]
|
113
|
+
DarkOliveGreen = [ 0.332, 0.42, 0.185 ]
|
114
|
+
DarkOrange = [ 1, 0.55, 0 ]
|
115
|
+
DarkOrchid = [ 0.6, 0.196, 0.8 ]
|
116
|
+
DarkPeriwinkle = [ 0.4, 0.4, 1.0 ]
|
117
|
+
DarkPurpleBlue = [ 0.4, 0, 0.8 ]
|
118
|
+
DarkRed = [ 0.545, 0, 0 ]
|
119
|
+
DarkRoyalBlue = [ 0, 0.2, 0.8 ]
|
120
|
+
DarkSalmon = [ 0.912, 0.59, 0.48 ]
|
121
|
+
DarkSeaGreen = [ 0.56, 0.736, 0.56 ]
|
122
|
+
DarkSlateBlue = [ 0.284, 0.24, 0.545 ]
|
123
|
+
DarkSlateGray = [ 0.185, 0.31, 0.31 ]
|
124
|
+
DarkSlateGrey = [ 0.185, 0.31, 0.31 ]
|
125
|
+
DarkSmoke = [ 0.92, 0.92, 0.92 ]
|
126
|
+
DarkTurquoise = [ 0, 0.808, 0.82 ]
|
127
|
+
DarkViolet = [ 0.58, 0, 0.828 ]
|
128
|
+
DeepPink = [ 1, 0.08, 0.576 ]
|
129
|
+
DeepSkyBlue = [ 0, 0.75, 1 ]
|
130
|
+
DimGray = [ 0.41, 0.41, 0.41 ]
|
131
|
+
DimGrey = [ 0.41, 0.41, 0.41 ]
|
132
|
+
DodgerBlue = [ 0.116, 0.565, 1 ]
|
133
|
+
FireBrick = [ 0.698, 0.132, 0.132 ]
|
134
|
+
FloralWhite = [ 1, 0.98, 0.94 ]
|
135
|
+
ForestGreen = [ 0.132, 0.545, 0.132 ]
|
136
|
+
Fuchsia = [ 1, 0, 1 ]
|
137
|
+
Gainsboro = [ 0.864, 0.864, 0.864 ]
|
138
|
+
GhostWhite = [ 0.972, 0.972, 1 ]
|
139
|
+
Gold = [ 1, 0.844, 0 ]
|
140
|
+
GoldenBrown = [ 0.6, 0.4, 0 ]
|
141
|
+
Goldenrod = [ 0.855, 0.648, 0.125 ]
|
142
|
+
GrassGreen = [ 0.2, 0.6, 0 ]
|
143
|
+
Gray = [ 0.5, 0.5, 0.5 ]
|
144
|
+
GrayBlue = [ 0, 0.4, 0.6 ]
|
145
|
+
Green = [ 0, 0.5, 0 ]
|
146
|
+
GreenYellow = [ 0.68, 1, 0.185 ]
|
147
|
+
Grey = [ 0.5, 0.5, 0.5 ]
|
148
|
+
Honeydew = [ 0.94, 1, 0.94 ]
|
149
|
+
HotPink = [ 1, 0.41, 0.705 ]
|
150
|
+
IndianRed = [ 0.804, 0.36, 0.36 ]
|
151
|
+
Indigo = [ 0.294, 0, 0.51 ]
|
152
|
+
Ivory = [ 1, 1, 0.94 ]
|
153
|
+
Khaki = [ 0.94, 0.9, 0.55 ]
|
154
|
+
Lavender = [ 0.9, 0.9, 0.98 ]
|
155
|
+
LavenderBlue = [ 0.4, 0.2, 1.0 ]
|
156
|
+
LavenderBlush = [ 1, 0.94, 0.96 ]
|
157
|
+
LawnGreen = [ 0.488, 0.99, 0 ]
|
158
|
+
LemonChiffon = [ 1, 0.98, 0.804 ]
|
159
|
+
LightBlue = [ 0.68, 0.848, 0.9 ]
|
160
|
+
LightBrightGreen = [ 0, 0.8, 0.2 ]
|
161
|
+
LightCoral = [ 0.94, 0.5, 0.5 ]
|
162
|
+
LightCrimson = [ 0.864, 0.08, 0.235 ]
|
163
|
+
LightCyan = [ 0.88, 1, 1 ]
|
164
|
+
LightDullGreen = [ 0.4, 1.0, 0.6 ]
|
165
|
+
LightGold = [ 0.8, 0.8, 0.4 ]
|
166
|
+
LightGrassGreen = [ 0.4, 1.0, 0.4 ]
|
167
|
+
LightGray = [ 0.828, 0.828, 0.828 ]
|
168
|
+
LightGreen = [ 0.565, 0.932, 0.565 ]
|
169
|
+
LightGrey = [ 0.828, 0.828, 0.828 ]
|
170
|
+
LightMustard = [ 1.0, 0.8, 0.4 ]
|
171
|
+
LightOliveGreen = [ 0.6, 0.8, 0.6 ]
|
172
|
+
LightOrchid = [ 0.6, 0.4, 0.8 ]
|
173
|
+
LightPlum = [ 0.8, 0.6, 0.8 ]
|
174
|
+
LightRose = [ 1.0, 0.6, 0.8 ]
|
175
|
+
LightSalmon = [ 1, 0.628, 0.48 ]
|
176
|
+
LightSandyBrown = [ 1.0, 0.8, 0.6 ]
|
177
|
+
LightSeaGreen = [ 0.125, 0.698, 0.668 ]
|
178
|
+
LightSienna = [ 0.8, 0.4, 0 ]
|
179
|
+
LightSkyBlue = [ 0.53, 0.808, 0.98 ]
|
180
|
+
LightSlateGray = [ 0.468, 0.532, 0.6 ]
|
181
|
+
LightSlateGrey = [ 0.468, 0.532, 0.6 ]
|
182
|
+
LightSteelBlue = [ 0.69, 0.77, 0.87 ]
|
183
|
+
LightTurquoise = [ 0.2, 1.0, 0.8 ]
|
184
|
+
LightYellow = [ 1, 1, 0.88 ]
|
185
|
+
LightYellowGreen = [ 0.8, 0.8, 0.2 ]
|
186
|
+
Lilac = [ 0.8, 0.6, 1.0 ]
|
187
|
+
Lime = [ 0, 1, 0 ]
|
188
|
+
LimeGreen = [ 0.196, 0.804, 0.196 ]
|
189
|
+
Linen = [ 0.98, 0.94, 0.9 ]
|
190
|
+
Magenta = [ 1, 0, 1 ]
|
191
|
+
Maroon = [ 0.5, 0, 0 ]
|
192
|
+
Mauve = [ 0.8, 0.2, 0.4 ]
|
193
|
+
MediumAquamarine = [ 0.4, 0.804, 0.668 ]
|
194
|
+
MediumBlue = [ 0, 0, 0.804 ]
|
195
|
+
MediumGreen = [ 0, 0.6, 0 ]
|
196
|
+
MediumOrange = [ 1.0, 0.4, 0 ]
|
197
|
+
MediumOrchid = [ 0.73, 0.332, 0.828 ]
|
198
|
+
MediumPurple = [ 0.576, 0.44, 0.86 ]
|
199
|
+
MediumSeaGreen = [ 0.235, 0.7, 0.444 ]
|
200
|
+
MediumSlateBlue = [ 0.484, 0.408, 0.932 ]
|
201
|
+
MediumSpringGreen = [ 0, 0.98, 0.604 ]
|
202
|
+
MediumTurquoise = [ 0.284, 0.82, 0.8 ]
|
203
|
+
MediumVioletRed = [ 0.78, 0.084, 0.52 ]
|
204
|
+
YellowGreen = [ 0.8, 0.8, 0 ]
|
205
|
+
MidnightBlue = [ 0.098, 0.098, 0.44 ]
|
206
|
+
MintCream = [ 0.96, 1, 0.98 ]
|
207
|
+
MistyRose = [ 1, 0.894, 0.884 ]
|
208
|
+
Moccasin = [ 1, 0.894, 0.71 ]
|
209
|
+
MustardSeed = [ 0.8, 0.6, 0 ]
|
210
|
+
NavajoWhite = [ 1, 0.87, 0.68 ]
|
211
|
+
Navy = [ 0, 0, 0.5 ]
|
212
|
+
OldLace = [ 0.992, 0.96, 0.9 ]
|
213
|
+
Olive = [ 0.5, 0.5, 0 ]
|
214
|
+
OliveDrab = [ 0.42, 0.556, 0.136 ]
|
215
|
+
Orange = [ 1, 0.648, 0 ]
|
216
|
+
OrangeRed = [ 1, 0.27, 0 ]
|
217
|
+
Orchid = [ 0.855, 0.44, 0.84 ]
|
218
|
+
PaleGoldenrod = [ 0.932, 0.91, 0.668 ]
|
219
|
+
PaleGreen = [ 0.596, 0.985, 0.596 ]
|
220
|
+
PaleTurquoise = [ 0.688, 0.932, 0.932 ]
|
221
|
+
PaleVioletRed = [ 0.86, 0.44, 0.576 ]
|
222
|
+
PapayaWhip = [ 1, 0.936, 0.835 ]
|
223
|
+
PeachPuff = [ 1, 0.855, 0.725 ]
|
224
|
+
Periwinkle = [ 0.6, 0, 1.0 ]
|
225
|
+
Peru = [ 0.804, 0.52, 0.248 ]
|
226
|
+
Pink = [ 1, 0.752, 0.796 ]
|
227
|
+
Plum = [ 0.868, 0.628, 0.868 ]
|
228
|
+
PowderBlue = [ 0.69, 0.88, 0.9 ]
|
229
|
+
Pumpkin = [ 1.0, 0.6, 0.2 ]
|
230
|
+
Purple = [ 0.5, 0, 0.5 ]
|
231
|
+
PurpleBlue = [ 0.4, 0.2, 0.8 ]
|
232
|
+
PurpleGray = [ 0.6, 0.6, 0.8 ]
|
233
|
+
Red = [ 1, 0, 0 ]
|
234
|
+
RedBrown = [ 0.8, 0.4, 0.2 ]
|
235
|
+
RedOrange = [ 0.8, 0.2, 0 ]
|
236
|
+
Rose = [ 1.0, 0.4, 0.6 ]
|
237
|
+
RosyBrown = [ 0.736, 0.56, 0.56 ]
|
238
|
+
RoyalBlue = [ 0.255, 0.41, 0.884 ]
|
239
|
+
RoyalPurple = [ 0.4, 0, 0.6 ]
|
240
|
+
SaddleBrown = [ 0.545, 0.27, 0.075 ]
|
241
|
+
LightChartreuse = [ 0.8, 1.0, 0.4 ]
|
242
|
+
Saffron = [ 1.0, 0.8, 0 ]
|
243
|
+
Salmon = [ 0.98, 0.5, 0.448 ]
|
244
|
+
SalmonRed = [ 1.0, 0.4, 0.4 ]
|
245
|
+
SandyBrown = [ 0.956, 0.644, 0.376 ]
|
246
|
+
SeaGreen = [ 0.18, 0.545, 0.34 ]
|
247
|
+
Seashell = [ 1, 0.96, 0.932 ]
|
248
|
+
Sienna = [ 0.628, 0.32, 0.176 ]
|
249
|
+
Silver = [ 0.752, 0.752, 0.752 ]
|
250
|
+
SkyBlue = [ 0.53, 0.808, 0.92 ]
|
251
|
+
SlateBlue = [ 0.415, 0.352, 0.804 ]
|
252
|
+
SlateGray = [ 0.44, 0.5, 0.565 ]
|
253
|
+
SlateGrey = [ 0.44, 0.5, 0.565 ]
|
254
|
+
Smoke = [ 0.95, 0.95, 0.95 ]
|
255
|
+
Snow = [ 1, 0.98, 0.98 ]
|
256
|
+
SoftYellow = [ 1.0, 1.0, 0.4 ]
|
257
|
+
SpringGreen = [ 0, 1, 0.498 ]
|
258
|
+
SteelBlue = [ 0.275, 0.51, 0.705 ]
|
259
|
+
Tan = [ 0.824, 0.705, 0.55 ]
|
260
|
+
Teal = [ 0, 0.5, 0.5 ]
|
261
|
+
Thistle = [ 0.848, 0.75, 0.848 ]
|
262
|
+
Tomato = [ 1, 0.39, 0.28 ]
|
263
|
+
Turquoise = [ 0.25, 0.88, 0.815 ]
|
264
|
+
Violet = [ 0.932, 0.51, 0.932 ]
|
265
|
+
WarmGray = [ 0.678, 0.66, 0.562 ]
|
266
|
+
Wheat = [ 0.96, 0.87, 0.7 ]
|
267
|
+
White = [ 1, 1, 1 ]
|
268
|
+
WhiteSmoke = [ 0.97, 0.97, 0.97 ]
|
269
|
+
Yellow = [ 1, 1, 0 ]
|
270
|
+
|
271
|
+
end # module ColorConstants
|
272
|
+
end # module Tioga
|
273
|
+
|
274
|
+
|
@@ -0,0 +1,105 @@
|
|
1
|
+
# Colormaps.rb
|
2
|
+
|
3
|
+
module Tioga
|
4
|
+
|
5
|
+
# These are the methods for creating and using colormaps and color spaces in PDF graphics.
|
6
|
+
|
7
|
+
class Colormaps < Doc < FigureMaker
|
8
|
+
|
9
|
+
=begin rdoc
|
10
|
+
Returns a color map as specified by the dictionary argument _dict_. The 'length' parameter determines the
|
11
|
+
number of entries in the map and must be an integer between 2 and 256. The 'points' vector gives positions
|
12
|
+
between 0.0 and 1.0 where the colors are explicitly specified for the map. The first color map entry corresponds to
|
13
|
+
position 0.0, the last map entry is for position 1.0, and intermediate map entries are spaced evenly in between.
|
14
|
+
The color specifications are given either as RGB triples (in the vectors 'Rs', 'Gs', and 'Bs') or as
|
15
|
+
HLS triples (in the vectors 'Hs', 'Ls', and 'Ss'). In either case, there must be the same number of triples as
|
16
|
+
there are positions in the 'points' vector. The color position points[i] is assigned the color from the
|
17
|
+
corresponding Rs[i], Gs[i], and Bs[i] for the RGB case. In the HLS case, the triple Hs[i], Ls[i], and Ss[i]
|
18
|
+
is converted to a triple of RGB intensities, and that is assigned to the color position given by points[i]. Color map
|
19
|
+
entries for other positions are determined by linear interpolation from the neighboring assigned colors.
|
20
|
+
|
21
|
+
See also the prebuilt colormaps: intense_colormap, mellow_colormap, and rainbow_colormap.
|
22
|
+
|
23
|
+
Dictionary Entries
|
24
|
+
'length' => an_integer # integer between 2 and 256. default is 256.
|
25
|
+
'points' => a_dvector # increasing locations starting at 0.0 and ending at 1.0
|
26
|
+
'Rs' => a_dvector # red intensities (between 0.0 and 1.0)
|
27
|
+
'Gs' => a_dvector # green intensities (between 0.0 and 1.0)
|
28
|
+
'Bs' => a_dvector # blue intensities (between 0.0 and 1.0)
|
29
|
+
'Hs' => a_dvector # hue angles in degrees (between 0 and 360)
|
30
|
+
'Ls' => a_dvector # lightness (between 0.0 and 1.0)
|
31
|
+
'Ss' => a_dvector # saturation (between 0.0 and 1.0)
|
32
|
+
|
33
|
+
=end
|
34
|
+
def create_colormap(dict)
|
35
|
+
end
|
36
|
+
|
37
|
+
# :call-seq:
|
38
|
+
# intense_colormap
|
39
|
+
#
|
40
|
+
# Returns a colormap with fully saturated reds and blues.
|
41
|
+
def intense_colormap
|
42
|
+
end
|
43
|
+
|
44
|
+
# :call-seq:
|
45
|
+
# mellow_colormap
|
46
|
+
#
|
47
|
+
# Returns a colormap with reds and blues in which the saturation drops for high and low color positions,
|
48
|
+
def mellow_colormap
|
49
|
+
end
|
50
|
+
|
51
|
+
# :call-seq:
|
52
|
+
# rainbow_colormap
|
53
|
+
#
|
54
|
+
# Returns a colormap covering the spectrum from red, orange, yellow, green, blue, indigo, to violet
|
55
|
+
# (special thanks to Roy G. Biv for providing this).
|
56
|
+
def rainbow_colormap
|
57
|
+
end
|
58
|
+
|
59
|
+
=begin rdoc
|
60
|
+
Returns a color map for a gradient of HLS colors as specified by the dictionary argument _dict_.
|
61
|
+
The hue is either fixed ('hue') or varies linearly (from 'starting_H' to 'ending_H').
|
62
|
+
The lightness is either fixed ('lightness') or varies linearly (from 'starting_L' to 'ending_L').
|
63
|
+
The saturation is either fixed ('saturation') or varies linearly (from 'starting_S' to 'ending_S').
|
64
|
+
|
65
|
+
Dictionary Entries
|
66
|
+
'hue' => a_float # hue angle in degrees (default 0)
|
67
|
+
'starting_H' => a_float # the starting hue angle
|
68
|
+
'ending_H' => a_float # the ending hue angle
|
69
|
+
'lightness' => a_float # lightness (default 0.5)
|
70
|
+
'starting_L' => a_float # the starting lightness
|
71
|
+
'ending_L' => a_float # the ending lightness
|
72
|
+
'saturation' => a_float # saturation (default 0.5)
|
73
|
+
'starting_S' => a_float # the starting saturation
|
74
|
+
'ending_S' => a_float # the ending saturation
|
75
|
+
|
76
|
+
=end
|
77
|
+
def create_gradient_colormap(dict)
|
78
|
+
end
|
79
|
+
|
80
|
+
# Returns a colormap corresponding to the given vectors of intensities.
|
81
|
+
# The intensities must be numbers between 0 and 1, and the vectors must
|
82
|
+
# be of equal lengths.
|
83
|
+
def convert_to_colormap(reds, greens, blues)
|
84
|
+
end
|
85
|
+
|
86
|
+
# Returns the triple [ red, green, blue ] for the intensities of the color
|
87
|
+
# at the given <i>color_position</i> in _colormap_. Recall that a color position
|
88
|
+
# is a number between 0 and 1. See create_colormap.
|
89
|
+
def get_color_from_colormap(colormap, color_position)
|
90
|
+
end
|
91
|
+
|
92
|
+
# Returns a vector of [ red, green, blue ] intensities corresponding to the
|
93
|
+
# <i>hls_vec</i> color given as [ hue, lightness, saturation]. See also rgb_to_hls.
|
94
|
+
def hls_to_rgb(hls_vec)
|
95
|
+
end
|
96
|
+
|
97
|
+
# Returns a vector of [ hue, lightness, saturation ] corresponding to the
|
98
|
+
# <i>rgb_vec</i> color given as [ red, green, blue] intensities. See also hls_to_rgb.
|
99
|
+
def rgb_to_hls(rgb_vec)
|
100
|
+
end
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
end # class
|
105
|
+
end # module Tioga
|