Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / tools / perl-5.8.0 / man / man3 / Pastel::Color.3
CommitLineData
86530b38
AT
1.\" Automatically generated by Pod::Man v1.34, Pod::Parser v1.13
2.\"
3.\" Standard preamble:
4.\" ========================================================================
5.de Sh \" Subsection heading
6.br
7.if t .Sp
8.ne 5
9.PP
10\fB\\$1\fR
11.PP
12..
13.de Sp \" Vertical space (when we can't use .PP)
14.if t .sp .5v
15.if n .sp
16..
17.de Vb \" Begin verbatim text
18.ft CW
19.nf
20.ne \\$1
21..
22.de Ve \" End verbatim text
23.ft R
24.fi
25..
26.\" Set up some character translations and predefined strings. \*(-- will
27.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
28.\" double quote, and \*(R" will give a right double quote. | will give a
29.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
30.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
31.\" expand to `' in nroff, nothing in troff, for use with C<>.
32.tr \(*W-|\(bv\*(Tr
33.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
34.ie n \{\
35. ds -- \(*W-
36. ds PI pi
37. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
38. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
39. ds L" ""
40. ds R" ""
41. ds C` ""
42. ds C' ""
43'br\}
44.el\{\
45. ds -- \|\(em\|
46. ds PI \(*p
47. ds L" ``
48. ds R" ''
49'br\}
50.\"
51.\" If the F register is turned on, we'll generate index entries on stderr for
52.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
53.\" entries marked with X<> in POD. Of course, you'll have to process the
54.\" output yourself in some meaningful fashion.
55.if \nF \{\
56. de IX
57. tm Index:\\$1\t\\n%\t"\\$2"
58..
59. nr % 0
60. rr F
61.\}
62.\"
63.\" For nroff, turn off justification. Always turn off hyphenation; it makes
64.\" way too many mistakes in technical documents.
65.hy 0
66.if n .na
67.\"
68.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
69.\" Fear. Run. Save yourself. No user-serviceable parts.
70. \" fudge factors for nroff and troff
71.if n \{\
72. ds #H 0
73. ds #V .8m
74. ds #F .3m
75. ds #[ \f1
76. ds #] \fP
77.\}
78.if t \{\
79. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
80. ds #V .6m
81. ds #F 0
82. ds #[ \&
83. ds #] \&
84.\}
85. \" simple accents for nroff and troff
86.if n \{\
87. ds ' \&
88. ds ` \&
89. ds ^ \&
90. ds , \&
91. ds ~ ~
92. ds /
93.\}
94.if t \{\
95. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
96. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
97. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
98. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
99. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
100. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
101.\}
102. \" troff and (daisy-wheel) nroff accents
103.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
104.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
105.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
106.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
107.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
108.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
109.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
110.ds ae a\h'-(\w'a'u*4/10)'e
111.ds Ae A\h'-(\w'A'u*4/10)'E
112. \" corrections for vroff
113.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
114.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
115. \" for low resolution devices (crt and lpr)
116.if \n(.H>23 .if \n(.V>19 \
117\{\
118. ds : e
119. ds 8 ss
120. ds o a
121. ds d- d\h'-1'\(ga
122. ds D- D\h'-1'\(hy
123. ds th \o'bp'
124. ds Th \o'LP'
125. ds ae ae
126. ds Ae AE
127.\}
128.rm #[ #] #H #V #F C
129.\" ========================================================================
130.\"
131.IX Title "Pastel::Color 3"
132.TH Pastel::Color 3 "2003-04-06" "perl v5.8.0" "User Contributed Perl Documentation"
133.SH "NAME"
134Pastel::Color\r
135.PP
136The Pastel::Color class encapsulates colors in the default sRGB color space. At present\r
137sRGB is the only Colorspace implemented.\r
138.SH "Description"
139.IX Header "Description"
140Every color has an implicit alpha value of 1.0 or an explicit one provided in the\r
141constructor. The alpha value defines the transparency of a color and can be represented\r
142by a float value in the range 0.0 \- 1.0 . An alpha value of 1.0 \r
143means that the color is completely opaque and an alpha value of 0 or 0.0 means that\r
144the color is completely transparent.\r
145.PP
146The default color space for the Pastel::Color \s-1API\s0 is sRGB (at present the only colorspace\r
147implemented). For further information on sRGB, see\r
148<http://www.w3.org/pub/WWW/Graphics/Color/sRGB.html>.\r
149.SH "Synopsis"
150.IX Header "Synopsis"
151.Vb 2
152\& use Pastel::Graphics;\r
153\& use strict;
154.Ve
155.PP
156.Vb 3
157\& my $color = Pastel::Color->new (10, 20, 30);\r
158\& my $color1 = Pastel::Color->new (-r=>10, -g=>20, -b=>30, -a=>0.5);\r
159\& my $color2 = Pastel::Color->new (10, 20, 30, 0.5); # $color now 50% transparent
160.Ve
161.PP
162.Vb 4
163\& my $graphics = Pastel::Graphics->new(-width=>800, -height=>600);\r
164\& $graphics->set_paint($color); # All the drawing from now on will be in $color\r
165\& ...\r
166\& ...
167.Ve
168.SH "CONSTRUCTOR"
169.IX Header "CONSTRUCTOR"
170.ie n .IP "Pastel::Color\->new( $int\fR, \f(CW$int\fR, \f(CW$int);" 4
171.el .IP "Pastel::Color\->new( \f(CW$int\fR, \f(CW$int\fR, \f(CW$int\fR);" 4
172.IX Item "Pastel::Color->new( $int, $int, $int);"
173Creates an sRGB color with the specified red, green, blue in the range (0 \- 255).\r
174The tranparency is set to 1.0. Fully opaque.\r
175.ie n .IP "Pastel::Color\->new( $int\fR, \f(CW$int\fR, \f(CW$int\fR, \f(CW$float_alpha)" 4
176.el .IP "Pastel::Color\->new( \f(CW$int\fR, \f(CW$int\fR, \f(CW$int\fR, \f(CW$float_alpha\fR)" 4
177.IX Item "Pastel::Color->new( $int, $int, $int, $float_alpha)"
178Creates an sRGB color with the specified red, green, blue in the range (0 \- 255).\r
179Alpha values in the range (0.0 \- 1.0). \r
180.IP "Pastel::Color\->new(\-r=>$int, \-g=>$int, \-b=>$int, \-a=>$float);" 4
181.IX Item "Pastel::Color->new(-r=>$int, -g=>$int, -b=>$int, -a=>$float);"
182With Perl style named parameters.\r
183\&\-r = Red, \-g = Green , \-b = Blue, \-a = Alpha\r
184.SH "FIELDS"
185.IX Header "FIELDS"
186.IP "_rgb_value" 4
187.IX Item "_rgb_value"
188Private.A value calculated from the Red, Green and the Blue integers supplied in the\r
189constructors. Alpha value supplied is not stored in this value because of rounding\r
190problems is Perl.\r
191.IP "_alpha" 4
192.IX Item "_alpha"
193Private. Stores the transparency float value.\r
194.SH "ACCESSORS"
195.IX Header "ACCESSORS"
196.Sh "\fIget_rgb()\fP"
197.IX Subsection "get_rgb()"
198Returns \s-1RGB\s0 value of the color. Red channel by bits 16\-23, Green by bits 8\-15\r
199and Blue by bits 0\-7. Transparency value is not stored at bits 24\-32, unlike the\r
200Java implementation, to avoid rounding error problems in Perl. To get Transparency\r
201(alpha) value use \fIget_alpha()\fR method.\r
202.PP
203Usage: \f(CW$color\fR\->\fIget_rgb()\fR\r
204.Sh "\fIget_red()\fP"
205.IX Subsection "get_red()"
206Return the Red chaneel value in integer in the range 0\-255.\r
207.PP
208Usage: \f(CW$color\fR\->\fIget_red()\fR\r
209.Sh "\fIget_green()\fP"
210.IX Subsection "get_green()"
211Return the Green chaneel value in integer in the range 0\-255.\r
212.PP
213Usage: \f(CW$color\fR\->\fIget_green()\fR\r
214.Sh "\fIget_blue()\fP"
215.IX Subsection "get_blue()"
216Return the Blue chaneel value in integer in the range 0\-255.\r
217.PP
218Usage: \f(CW$color\fR\->\fIget_blue()\fR\r
219.Sh "\fIget_alpha()\fP"
220.IX Subsection "get_alpha()"
221Return the Alpha (transparency) value in the range 0.0 \- 1.0.\r
222.PP
223Usage: \f(CW$color\fR\->\fIget_alpha()\fR\r
224.SH "METHODS"
225.IX Header "METHODS"
226.Sh "\fIbrighter()\fP"
227.IX Subsection "brighter()"
228Return a brighter version of the present Color object.\r
229.PP
230.Vb 1
231\& Usage: my $brighter = $color->brighter();
232.Ve
233.Sh "\fIdarker()\fP"
234.IX Subsection "darker()"
235Return a darker version of the present color object.\r
236.PP
237.Vb 1
238\& Usage: my $darker_color = $color->darker();
239.Ve
240.Sh "\fIblack()\fP"
241.IX Subsection "black()"
242Return a color object \*(L"black\*(R".\r
243.PP
244.Vb 1
245\& Usage: my $graphics->set_paint( Pastel::Color->black() );
246.Ve
247.Sh "\fIblue()\fP"
248.IX Subsection "blue()"
249Return a color object \*(L"blue\*(R"\r
250.PP
251.Vb 1
252\& Usage: my $graphics->set_paint ( Pastel::Color->blue());
253.Ve
254.Sh "\fIred()\fP"
255.IX Subsection "red()"
256Returns a color object \*(L"red\*(R".\r
257.PP
258.Vb 1
259\& Usage: my $graphics->set_paint ( Pastel::Color->red());
260.Ve
261.Sh "\fIwhite()\fP"
262.IX Subsection "white()"
263Returns a color object \*(L"white\*(R".\r
264.PP
265.Vb 1
266\& Usage: my $graphics->set_paint ( Pastel::Color->white());
267.Ve
268.Sh "\fIlight_gray()\fP"
269.IX Subsection "light_gray()"
270Returns a color object \*(L"light_gray\*(R".\r
271.PP
272.Vb 1
273\& Usage: my $graphics->set_paint ( Pastel::Color->light_gray());
274.Ve
275.Sh "\fIgray()\fP"
276.IX Subsection "gray()"
277Returns a color object \*(L"gray\*(R".\r
278.PP
279.Vb 1
280\& Usage: my $graphics->set_paint ( Pastel::Color->gray());
281.Ve
282.Sh "\fIdark_gray()\fP"
283.IX Subsection "dark_gray()"
284Returns a color object \*(L"dark_gray\*(R".\r
285.PP
286.Vb 1
287\& Usage: my $graphics->set_paint ( Pastel::Color->dark_gray());
288.Ve
289.Sh "\fIpink()\fP"
290.IX Subsection "pink()"
291Returns a color object \*(L"pink\*(R".\r
292.PP
293.Vb 1
294\& Usage: my $graphics->set_paint ( Pastel::Color->pink());
295.Ve
296.Sh "\fIorange()\fP"
297.IX Subsection "orange()"
298Returns a color object \*(L"red\*(R".\r
299.PP
300.Vb 1
301\& Usage: my $graphics->set_paint ( Pastel::Color->orange());
302.Ve
303.Sh "\fIyellow()\fP"
304.IX Subsection "yellow()"
305Returns a color object \*(L"yellow\*(R".\r
306.PP
307.Vb 1
308\& Usage: my $graphics->set_paint ( Pastel::Color->yellow());
309.Ve
310.Sh "\fIgreen()\fP"
311.IX Subsection "green()"
312Returns a color object \*(L"green\*(R".\r
313.PP
314.Vb 1
315\& Usage: my $graphics->set_paint ( Pastel::Color->green());
316.Ve
317.Sh "\fImagenta()\fP"
318.IX Subsection "magenta()"
319Returns a color object \*(L"magenta\*(R".\r
320.PP
321.Vb 1
322\& Usage: my $graphics->set_paint ( Pastel::Color->magenta());
323.Ve
324.Sh "\fIcyan()\fP"
325.IX Subsection "cyan()"
326Returns a color object \*(L"cyan\*(R".\r
327.PP
328.Vb 1
329\& Usage: my $graphics->set_paint ( Pastel::Color->cyan());
330.Ve
331.ie n .Sh "equals(Color $color)"
332.el .Sh "equals(Color \f(CW$color\fP)"
333.IX Subsection "equals(Color $color)"
334Returns true if \f(CW$color\fR is equivalent to the present color. This method\r
335compares the \*(L"red\*(R", \*(L"green\*(R", \*(L"blue\*(R" and the \*(L"alpha\*(R" value of the two colors\r
336and return 1 if both are same or returns 0 if they are diffrent.\r
337.PP
338.Vb 3
339\& Usage: my $color1 = Pastel::Color->new(255, 255, 255);\r
340\& my $white = Pastel::Color->white();\r
341\& print "They are same" if $color1->equals($white);
342.Ve
343.Sh "\fIto_string()\fP"
344.IX Subsection "to_string()"
345Returns the string representation of the object.\r
346.PP
347.Vb 1
348\& Usage: $color->to_string();
349.Ve
350.SH "PRIVATE METHODS"
351.IX Header "PRIVATE METHODS"
352.Sh "\fIto_svg()\fP"
353.IX Subsection "to_svg()"
354Return the string Pastel coded form of this object. Called by any object with\r
355style color.\r