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>
19 </li>
20 </ul><hr />
21 <!-- INDEX END -->
22
23 <h1 id="NAME">NAME</h1><p><a href="#TOP" class="toplink">Top</a></p>
24 <div id="NAME_CONTENT">
25 <p>SDL::Color - Format independent color description</p>
26
27 </div>
28 <h2 id="CATEGORY">CATEGORY</h2>
29 <div id="CATEGORY_CONTENT">
30 <p>Core, Video, Structure</p>
31
32 </div>
33 <h1 id="SYNOPSIS">SYNOPSIS</h1><p><a href="#TOP" class="toplink">Top</a></p>
34 <div id="SYNOPSIS_CONTENT">
35 <pre> my $black = SDL::Color-&gt;new(0, 0, 0);
36  my $color = SDL::Color-&gt;new(255, 0, 0);
37  my $r = $color-&gt;r; # 255
38  my $g = $color-&gt;g; # 0
39  my $b = $color-&gt;b; # 0
40  $color-&gt;g(255);
41  $color-&gt;b(255);
42  # $color is now white
43
44 </pre>
45
46 </div>
47 <h1 id="DESCRIPTION">DESCRIPTION</h1><p><a href="#TOP" class="toplink">Top</a></p>
48 <div id="DESCRIPTION_CONTENT">
49 <p><code>SDL_Color</code> describes a color in a format independent way.</p>
50
51 </div>
52 <h1 id="METHODS">METHODS</h1><p><a href="#TOP" class="toplink">Top</a></p>
53 <div id="METHODS_CONTENT">
54
55 </div>
56 <h2 id="new">new</h2>
57 <div id="new_CONTENT">
58 <pre> my $color = SDL::Color-&gt;new(255, 0, 0);
59
60 </pre>
61 <p>The constructor creates a new color with the specified red, green and blue values.</p>
62
63 </div>
64 <h2 id="r">r</h2>
65 <div id="r_CONTENT">
66 <pre> my $r = $color-&gt;r;
67  $color-&gt;r(128);
68
69 </pre>
70 <p>If passed a value, this method sets the red component of the color;
71 if not, it returns the red component of the color.</p>
72
73 </div>
74 <h2 id="g">g</h2>
75 <div id="g_CONTENT">
76 <pre> my $g = $color-&gt;g;
77  $color-&gt;g(128);
78
79 </pre>
80 <p>If passed a value, this method sets the green component of the color;
81 if not, it returns the green component of the color.</p>
82
83 </div>
84 <h2 id="b">b</h2>
85 <div id="b_CONTENT">
86 <pre> my $b = $color-&gt;b;
87  $color-&gt;b(128);
88
89 </pre>
90 <p>If passed a value, this method sets the blue component of the color;
91 if not, it returns the blue component of the color.</p>
92
93 </div>
94 <h1 id="SEE_ALSO">SEE ALSO</h1><p><a href="#TOP" class="toplink">Top</a></p>
95 <div id="SEE_ALSO_CONTENT">
96 <p><a href="SDL-Surface.html">SDL::Surface</a></p>
97
98 </div>
99 </div>