updated docs
[sdlgit/SDL-Site.git] / pages / SDL-Color.html-inc
1 <div class="pod">
2 <!-- INDEX START -->
3 <h3 id="TOP">Index</h3>
4
5 <ul><li><a href="#NAME">NAME</a>
6 <ul><li><a href="#CATEGORY">CATEGORY</a></li>
7 </ul>
8 </li>
9 <li><a href="#SYNOPSIS">SYNOPSIS</a></li>
10 <li><a href="#DESCRIPTION">DESCRIPTION</a></li>
11 <li><a href="#METHODS">METHODS</a>
12 <ul><li><a href="#new">new</a></li>
13 <li><a href="#r">r</a></li>
14 <li><a href="#g">g</a></li>
15 <li><a href="#b">b</a></li>
16 </ul>
17 </li>
18 <li><a href="#SEE_ALSO">SEE ALSO</a></li>
19 <li><a href="#AUTHORS">AUTHORS</a>
20 </li>
21 </ul><hr />
22 <!-- INDEX END -->
23
24 <h1 id="NAME">NAME</h1><p><a href="#TOP" class="toplink">Top</a></p>
25 <div id="NAME_CONTENT">
26 <p>SDL::Color - Format independent color description</p>
27
28 </div>
29 <h2 id="CATEGORY">CATEGORY</h2>
30 <div id="CATEGORY_CONTENT">
31 <p>Core, Video, Structure</p>
32
33 </div>
34 <h1 id="SYNOPSIS">SYNOPSIS</h1><p><a href="#TOP" class="toplink">Top</a></p>
35 <div id="SYNOPSIS_CONTENT">
36 <pre> my $black = SDL::Color-&gt;new(0, 0, 0);
37  my $color = SDL::Color-&gt;new(255, 0, 0);
38  my $r = $color-&gt;r; # 255
39  my $g = $color-&gt;g; # 0
40  my $b = $color-&gt;b; # 0
41  $color-&gt;g(255);
42  $color-&gt;b(255);
43  # $color is now white
44
45 </pre>
46
47 </div>
48 <h1 id="DESCRIPTION">DESCRIPTION</h1><p><a href="#TOP" class="toplink">Top</a></p>
49 <div id="DESCRIPTION_CONTENT">
50 <p><code>SDL_Color</code> describes a color in a format independent way.</p>
51
52 </div>
53 <h1 id="METHODS">METHODS</h1><p><a href="#TOP" class="toplink">Top</a></p>
54 <div id="METHODS_CONTENT">
55
56 </div>
57 <h2 id="new">new</h2>
58 <div id="new_CONTENT">
59 <pre> my $color = SDL::Color-&gt;new(255, 0, 0);
60
61 </pre>
62 <p>The constructor creates a new color with the specified red, green and blue values.</p>
63
64 </div>
65 <h2 id="r">r</h2>
66 <div id="r_CONTENT">
67 <pre> my $r = $color-&gt;r;
68  $color-&gt;r(128);
69
70 </pre>
71 <p>If passed a value, this method sets the red component of the color;
72 if not, it returns the red component of the color.</p>
73
74 </div>
75 <h2 id="g">g</h2>
76 <div id="g_CONTENT">
77 <pre> my $g = $color-&gt;g;
78  $color-&gt;g(128);
79
80 </pre>
81 <p>If passed a value, this method sets the green component of the color;
82 if not, it returns the green component of the color.</p>
83
84 </div>
85 <h2 id="b">b</h2>
86 <div id="b_CONTENT">
87 <pre> my $b = $color-&gt;b;
88  $color-&gt;b(128);
89
90 </pre>
91 <p>If passed a value, this method sets the blue component of the color;
92 if not, it returns the blue component of the color.</p>
93
94 </div>
95 <h1 id="SEE_ALSO">SEE ALSO</h1><p><a href="#TOP" class="toplink">Top</a></p>
96 <div id="SEE_ALSO_CONTENT">
97 <p><a href="SDL-Surface.html">SDL::Surface</a></p>
98
99 </div>
100 <h1 id="AUTHORS">AUTHORS</h1><p><a href="#TOP" class="toplink">Top</a></p>
101 <div id="AUTHORS_CONTENT">
102 <p>See <b>AUTHORS</b> in <cite>SDL</cite>.</p>
103
104
105
106
107
108 </div>
109 </div>