File: en_color.html

package info (click to toggle)
basic256 1.1.4.0-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 24,456 kB
  • sloc: cpp: 10,148; yacc: 3,023; java: 1,091; lex: 1,051; sh: 117; xml: 33; makefile: 15
file content (195 lines) | stat: -rw-r--r-- 12,015 bytes parent folder | download | duplicates (2)
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
<!DOCTYPE html>
<html lang="en" dir="ltr" class="no-js">
<head>
    <meta charset="utf-8" />
    <title>en:color [BASIC 256 - Language Documentation]</title>
<link rel="stylesheet" type="text/css" href="lib/exe/cssc171c1dfe8519125bb40a349172b001a.css"/>
    </head>
<body>
    <div id="dokuwiki__site"><div id="dokuwiki__top" class="site dokuwiki mode_show tpl_dokuwiki     ">
<div id="dokuwiki__header"><div class="pad group">
    <div class="headings group">
        <h1><a href="start.html"  accesskey="h" title="[H]"><img src="lib/tpl/dokuwiki/images/logo.png" width="64" height="64" alt="" /> <span>BASIC 256 - Language Documentation</span></a></h1>
            </div>
    </div>
            <div class="breadcrumbs">
                            <div class="youarehere"><span class="bchead">You are here: </span><span class="home"><bdi><a href="start.html" class="wikilink1" title="start">start</a></bdi></span> » <bdi><a href="en_start.html" class="wikilink1" title="en:start">en</a></bdi> » <bdi><span class="curid"><a href="en_color.html" class="wikilink1" title="en:color">color</a></span></bdi></div>
                    </div>
    <hr class="a11y" />
</div></div>
        <div class="wrapper group">
            <div id="dokuwiki__content"><div class="pad group">
                <div class="pageId"><span>en:color</span></div>
                <div class="page group">
<div id="dw__toc">
<h3 class="toggle">Table of Contents</h3>
<div>
<ul class="toc">
<li class="level2"><div class="li"><a href="en_color.html#color_statement">Color (Statement)</a></div>
<ul class="toc">
<li class="level3"><div class="li"><a href="en_color.html#format">Format</a></div></li>
<li class="level3"><div class="li"><a href="en_color.html#description">Description</a></div></li>
<li class="level3"><div class="li"><a href="en_color.html#deprecated_form">Deprecated Form</a></div></li>
<li class="level3"><div class="li"><a href="en_color.html#example">Example</a></div></li>
<li class="level3"><div class="li"><a href="en_color.html#see_also">See Also</a></div></li>
<li class="level3"><div class="li"><a href="en_color.html#history">History</a></div></li>
</ul></li>
</ul>
</div>
</div>
<h2 class="sectionedit1" id="color_statement">Color (Statement)</h2>
<div class="level2">
</div>
<h3 class="sectionedit2" id="format">Format</h3>
<div class="level3">
<p>
<strong>color</strong> <em><a class="explain" href="en_color.html#color_names_and_rgb_values">color_name</a></em><br/>
<strong>color</strong> ( <em><a class="explain" href="en_color.html#color_names_and_rgb_values">color_name</a></em> )<br/>
<strong>color</strong> <em><a class="explain" href="en_rgb.html">rgb_expr</a></em><br/>
<strong>color</strong> ( <em><a class="explain" href="en_rgb.html">rgb_expr</a></em> )<br/>
<strong>color</strong> <em><a class="explain" href="en_color.html#color_names_and_rgb_values">pen_color_name</a></em> , <em><a class="explain" href="en_color.html#color_names_and_rgb_values">brush_color_name</a></em><br/>
<strong>color</strong> ( <em><a class="explain" href="en_color.html#color_names_and_rgb_values">pen_color_name</a></em> , <em><a class="explain" href="en_color.html#color_names_and_rgb_values">brush_color_name</a></em> )<br/>
<strong>color</strong> <em><a class="explain" href="en_rgb.html">pen_rgb_expr</a></em> , <em><a class="explain" href="en_rgb.html">brush_rgb_expr</a></em><br/>
<strong>color</strong> ( <em><a class="explain" href="en_rgb.html">pen_rgb_expr</a></em> , <em><a class="explain" href="en_rgb.html">brush_rgb_expr</a></em> )
</p>
</div>
<h3 class="sectionedit3" id="description">Description</h3>
<div class="level3">
<p>
Sets the current drawing color to <em>colorname</em> or to an ARGB value where ( (a * 256 + r) * 256 + b) * 256 + g.  If a single color is specified both the pen and the brush will be set to the same color.
</p>
<p>
When drawing solid shapes (<a href="en_chord.html" class="wikilink1" title="en:chord">Chord</a>,<a href="en_circle.html" class="wikilink1" title="en:circle">Circle</a>,<a href="en_pie.html" class="wikilink1" title="en:pie">Pie</a>,<a href="en_poly.html" class="wikilink1" title="en:poly">Poly</a>,<a href="en_rect.html" class="wikilink1" title="en:rect">Rect</a>, and <a href="en_stamp.html" class="wikilink1" title="en:stamp">Stamp</a>) the border of the shape will be drawn with the pen color and the shape itself will be filled with the brush color.  A brush color of CLEAR is used to not fill a closed shape.
</p>
<p>
If the current pen and brush are both set to CLEAR the pixels or shapes drawn will clear the pixels of the graphics output area and make them transparent.  This is especially useful when creating sprites using the Spriteslice command.<br/>
</p>
</div>
<h4 id="color_names_and_rgb_values">Color names and RGB values</h4>
<div class="level4">
<div class="table sectionedit4"><table class="inline">
	<tr class="row0">
		<th class="col0">Color Name</th><th class="col1">ARGB Values</th><th class="col2" colspan="2">Integer</th>
	</tr>
	<tr class="row1">
		<td class="col0">black</td><td class="col1">255, 0, 0, 0</td><td class="col2">4278190080</td><td class="col3"><span style="background-color: #000000">        </span></td>
	</tr>
	<tr class="row2">
		<td class="col0">white</td><td class="col1">255, 255, 255, 255</td><td class="col2">4294506744</td><td class="col3"><span style="background-color: #FFFFFF">        </span></td>
	</tr>
	<tr class="row3">
		<td class="col0">red</td><td class="col1">255, 255, 0, 0</td><td class="col2">4294901760</td><td class="col3"><span style="background-color: #FF0000">        </span></td>
	</tr>
	<tr class="row4">
		<td class="col0">darkred</td><td class="col1">255, 128, 0, 0</td><td class="col2">4286578688</td><td class="col3"><span style="background-color: #800000">        </span></td>
	</tr>
	<tr class="row5">
		<td class="col0">green</td><td class="col1">255, 0, 255, 0</td><td class="col2">4278255360</td><td class="col3"><span style="background-color: #00FF00">        </span></td>
	</tr>
	<tr class="row6">
		<td class="col0">darkgreen</td><td class="col1">255, 0, 128, 0</td><td class="col2">4278222848</td><td class="col3"><span style="background-color: #008000">        </span></td>
	</tr>
	<tr class="row7">
		<td class="col0">blue</td><td class="col1">255, 0, 0, 255</td><td class="col2">4278190335</td><td class="col3"><span style="background-color: #0000FF">        </span></td>
	</tr>
	<tr class="row8">
		<td class="col0">darkblue</td><td class="col1">255, 0, 0, 128</td><td class="col2">4278190208</td><td class="col3"><span style="background-color: #000080">        </span></td>
	</tr>
	<tr class="row9">
		<td class="col0">cyan</td><td class="col1">255, 0, 255, 255</td><td class="col2">4278255615</td><td class="col3"><span style="background-color: #00FFFF">        </span></td>
	</tr>
	<tr class="row10">
		<td class="col0">darkcyan</td><td class="col1">255, 0, 128, 128</td><td class="col2">4278222976</td><td class="col3"><span style="background-color: #008080">        </span></td>
	</tr>
	<tr class="row11">
		<td class="col0">purple</td><td class="col1">255, 255, 0, 255</td><td class="col2">4294902015</td><td class="col3"><span style="background-color: #FF00FF">        </span></td>
	</tr>
	<tr class="row12">
		<td class="col0">darkpurple</td><td class="col1">255, 128, 0, 128</td><td class="col2">4286578816</td><td class="col3"><span style="background-color: #800080">        </span></td>
	</tr>
	<tr class="row13">
		<td class="col0">yellow</td><td class="col1">255, 255, 255, 0</td><td class="col2">4294967040</td><td class="col3"><span style="background-color: #FFFF00">        </span></td>
	</tr>
	<tr class="row14">
		<td class="col0">darkyellow</td><td class="col1">255, 128, 128 ,0</td><td class="col2">4286611456</td><td class="col3"><span style="background-color: #808000">        </span></td>
	</tr>
	<tr class="row15">
		<td class="col0">orange</td><td class="col1">255, 255, 102, 0</td><td class="col2">4294927872</td><td class="col3"><span style="background-color: #FF6600">        </span></td>
	</tr>
	<tr class="row16">
		<td class="col0">darkorange</td><td class="col1">255, 176, 61 ,0</td><td class="col2">4289344256</td><td class="col3"><span style="background-color: #B03D00">        </span></td>
	</tr>
	<tr class="row17">
		<td class="col0">grey</td><td class="col1">255, 164, 164 ,164</td><td class="col2">4288980132</td><td class="col3"><span style="background-color: #A4A4A4">        </span></td>
	</tr>
	<tr class="row18">
		<td class="col0">darkgrey</td><td class="col1">255, 128, 128 ,128</td><td class="col2">4286611584</td><td class="col3"><span style="background-color: #808080">        </span></td>
	</tr>
	<tr class="row19">
		<td class="col0">clear</td><td class="col1">0, 0, 0, 0</td><td class="col2">0</td><td class="col3"> </td>
	</tr>
</table></div>
</div>
<h3 class="sectionedit5" id="deprecated_form">Deprecated Form</h3>
<div class="level3">
<p>
In version 0.9.9.26 the statement form “<strong>color</strong> <em>red</em>, <em>blue</em>, <em>green</em>” or “<strong>color</strong> ( <em>red</em>, <em>blue</em>, <em>green</em> )” was deprecated and a warning will be displayed when it is encountered.  It should be replaced with “<strong>color</strong> <strong>rgb</strong> ( <em>red</em>, <em>blue</em>, <em>green</em> )”.
</p>
</div>
<h3 class="sectionedit6" id="example">Example</h3>
<div class="level3">
<pre class="code">clg
color rgb(128,128,128)
rect 0,0,graphwidth, graphheight
penwidth 5
color green,red
circle 100,100,50
penwidth 1
color rgb(255,160,160)
circle 100,100,25</pre>
<p>
Will draw a grey rectangle with a green circle filled with red and then a pink circle inside it.<br/>
<a href="http://doc.basic256.org/lib/exe/detail.php?id=en_color&amp;media=color.png" class="media" title="color.png"><img src="lib/exe/color.png" class="media" title="Color" alt="Color" /></a>
</p>
</div>
<h3 class="sectionedit7" id="see_also">See Also</h3>
<div class="level3">
</div>
<div class="plugin_include_content plugin_include__en:start">
<div class="level3">
<p>
<span class="curid"><a href="en_color.html" class="wikilink1" title="en:color">Color</a></span>, <a href="en_getbrushcolor.html" class="wikilink1" title="en:getbrushcolor">GetBrushColor</a>, <a href="en_getcolor.html" class="wikilink1" title="en:getcolor">GetColor</a>, <a href="en_rgb.html" class="wikilink1" title="en:rgb">Rgb</a>
</p>
</div>
</div>
<div class="level3">
</div>
<h3 class="sectionedit11" id="history">History</h3>
<div class="level3">
<div class="table sectionedit12"><table class="inline">
	<tr class="row0">
		<td class="col0">0.9.5m</td><td class="col1">added “COLOR r,g,b” form and numeric representation of color names</td>
	</tr>
	<tr class="row1">
		<td class="col0">0.9.9.26</td><td class="col1">Added brush color and deprecated the “COLOR r,g,b”.</td>
	</tr>
	<tr class="row2">
		<td class="col0">0.9.9.28</td><td class="col1">Changed color values to include Alpha (transparency) and changed color constants to new ARGB values.</td>
	</tr>
	<tr class="row3">
		<td class="col0">0.9.9.45</td><td class="col1">changed values to positive numbers following formula as documented.</td>
	</tr>
</table></div>
</div>
                                    </div>
                <div class="docInfo"><bdi>en/color.txt</bdi> · Last modified: 2014/02/08 18:46 by <bdi>admin</bdi></div>
                            </div></div>
            <hr class="a11y" />
        </div>
<div id="dokuwiki__footer"><div class="pad">
    <div class="license">Except where otherwise noted, content on this wiki is licensed under the following license: <bdi><a href="http://creativecommons.org/licenses/by-sa/3.0/" rel="license" class="urlextern">CC Attribution-Share Alike 3.0 Unported</a></bdi></div>
</div></div>
    </div></div>
    <div id="screen__mode" class="no"></div>
</body>
</html>