Files
Examples/Java/Processing/processing-3.3.6/modes/java/reference/stroke_.html
2018-04-20 10:15:15 +01:00

198 lines
9.0 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>stroke() \ Language (API) \ Processing 2+</title>
<link rel="icon" href="/favicon.ico" type="image/x-icon" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="Author" content="Processing Foundation" />
<meta name="Publisher" content="Processing Foundation" />
<meta name="Keywords" content="Processing, Sketchbook, Programming, Coding, Code, Art, Design" />
<meta name="Description" content="Processing is a flexible software sketchbook and a language for learning how to code within the context of the visual arts. Since 2001, Processing has promoted software literacy within the visual arts and visual literacy within technology." />
<meta name="Copyright" content="All contents copyright the Processing Foundation, Ben Fry, Casey Reas, and the MIT Media Laboratory" />
<script src="javascript/modernizr-2.6.2.touch.js" type="text/javascript"></script>
<link href="css/style.css" rel="stylesheet" type="text/css" />
</head>
<body id="Langauge-en" onload="" >
<!-- ==================================== PAGE ============================ -->
<div id="container">
<!-- ==================================== HEADER ============================ -->
<div id="ribbon">
<ul class="left">
<li class="highlight"><a href="http://processing.org/">Processing</a></li>
<li><a href="http://p5js.org/">p5.js</a></li>
<li><a href="http://py.processing.org/">Processing.py</a></li>
<li><a href="http://android.processing.org/">Processing for Android</a></li>
</ul>
<ul class="right">
<li><a href="https://processingfoundation.org/">Processing Foundation</a></li>
</ul>
<div class="clear"></div>
</div>
<div id="header">
<a href="/" title="Back to the Processing cover."><div class="processing-logo no-cover" alt="Processing cover"></div></a>
<form name="search" method="get" action="//www.google.com/search">
<p><input type="hidden" name="as_sitesearch" value="processing.org" />
<input type="text" name="as_q" value="" size="20" class="text" />
<input type="submit" value=" " /></p>
</form>
</div>
<a id="TOP" name="TOP"></a>
<div id="navigation">
<div class="navBar" id="mainnav">
<a href="index.html" class='active'>Language</a><br>
<a href="libraries/index.html" >Libraries</a><br>
<a href="tools/index.html">Tools</a><br>
<a href="environment/index.html">Environment</a><br>
</div>
<script> document.querySelectorAll(".processing-logo")[0].className = "processing-logo"; </script>
</div>
<!-- ==================================== CONTENT - Headers ============================ -->
<div class="content">
<p class="ref-notice">This reference is for Processing 3.0+. If you have a previous version, use the reference included with your software in the Help menu. If you see any errors or have suggestions, <a href="https://github.com/processing/processing-docs/issues?state=open">please let us know</a>. If you prefer a more technical reference, visit the <a href="http://processing.github.io/processing-javadocs/core/">Processing Core Javadoc</a> and <a href="http://processing.github.io/processing-javadocs/libraries/">Libraries Javadoc</a>.</p>
<table cellpadding="0" cellspacing="0" border="0" class="ref-item">
<tr class="name-row">
<th scope="row">Name</th>
<td><h3>stroke()</h3></td>
</tr>
<tr class="">
<tr class=""><th scope="row">Examples</th><td><div class="example"><img src="images/stroke_0.png" alt="example pic" /><pre class="margin">
stroke(153);
rect(30, 20, 55, 55);
</pre></div>
<div class="example"><img src="images/stroke_1.png" alt="example pic" /><pre class="margin">
stroke(204, 102, 0);
rect(30, 20, 55, 55);
</pre></div>
</td></tr>
<tr class="">
<th scope="row">Description</th>
<td>
Sets the color used to draw lines and borders around shapes. This color is either specified in terms of the RGB or HSB color depending on the current <b>colorMode().</b> The default color space is RGB, with each value in the range from 0 to 255.
<br /> <br />
When using hexadecimal notation to specify a color, use "<b>#</b>" or "<b>0x</b>" before the values (e.g., <b>#CCFFAA</b> or <b>0xFFCCFFAA</b>). The <b>#</b> syntax uses six digits to specify a color (just as colors are typically specified in HTML and CSS). When using the hexadecimal notation starting with "<b>0x</b>", the hexadecimal value must be specified with eight characters; the first two characters define the alpha component, and the remainder define the red, green, and blue components.
<br /> <br />
The value for the gray parameter must be less than or equal to the current maximum value as specified by <b>colorMode()</b>. The default maximum value is 255.
<br /> <br />
When drawing in 2D with the default renderer, you may need <b>hint(ENABLE_STROKE_PURE)</b> to improve drawing quality (at the expense of performance). See the hint() documentation for more details.
</td>
</tr>
<tr class=""><th scope="row">Syntax</th><td><pre>stroke(<kbd>rgb</kbd>)
stroke(<kbd>rgb</kbd>, <kbd>alpha</kbd>)
stroke(<kbd>gray</kbd>)
stroke(<kbd>gray</kbd>, <kbd>alpha</kbd>)
stroke(<kbd>v1</kbd>, <kbd>v2</kbd>, <kbd>v3</kbd>)
stroke(<kbd>v1</kbd>, <kbd>v2</kbd>, <kbd>v3</kbd>, <kbd>alpha</kbd>)</pre></td></tr>
<tr class=""> <th scope="row">Parameters</th><td><table cellpadding="0" cellspacing="0" border="0"><tr class="">
<th scope="row" class="code">rgb</th>
<td>int: color value in hexadecimal notation</td>
</tr>
<tr class="">
<th scope="row" class="code">alpha</th>
<td>float: opacity of the stroke</td>
</tr>
<tr class="">
<th scope="row" class="code">gray</th>
<td>float: specifies a value between white and black</td>
</tr>
<tr class="">
<th scope="row" class="code">v1</th>
<td>float: red or hue value (depending on current color mode)</td>
</tr>
<tr class="">
<th scope="row" class="code">v2</th>
<td>float: green or saturation value (depending on current color mode)</td>
</tr>
<tr class="">
<th scope="row" class="code">v3</th>
<td>float: blue or brightness value (depending on current color mode)</td>
</tr></table></td> </tr>
<tr class=""><th scope="row">Returns</th><td class="code">void</td></tr>
<tr class=""><th scope="row">Related</th><td><a class="code" href="noStroke_.html">noStroke()</a><br />
<a class="code" href="strokeWeight_.html">strokeWeight()</a><br />
<a class="code" href="strokeJoin_.html">strokeJoin()</a><br />
<a class="code" href="strokeCap_.html">strokeCap()</a><br />
<a class="code" href="fill_.html">fill()</a><br />
<a class="code" href="noFill_.html">noFill()</a><br />
<a class="code" href="tint_.html">tint()</a><br />
<a class="code" href="background_.html">background()</a><br />
<a class="code" href="colorMode_.html">colorMode()</a><br /></td></tr>
</table>
Updated on April 30, 2017 02:33:18pm EDT<br /><br />
<!-- Creative Commons License -->
<div class="license">
<a rel="license" href="//creativecommons.org/licenses/by-nc-sa/4.0/"><img alt="Creative Commons License" style="border: none" src="https://licensebuttons.net/l/by-nc-sa/4.0/88x31.png" /></a>
</div>
<!--
<?xpacket begin='' id=''?>
<x:xmpmeta xmlns:x='adobe:ns:meta/'>
<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'>
<rdf:Description rdf:about=''
xmlns:xapRights='http://ns.adobe.com/xap/1.0/rights/'>
<xapRights:Marked>True</xapRights:Marked>
</rdf:Description>
<rdf:Description rdf:about=''
xmlns:xapRights='http://ns.adobe.com/xap/1.0/rights/'
>
<xapRights:UsageTerms>
<rdf:Alt>
<rdf:li xml:lang='x-default' >This work is licensed under a &lt;a rel=&#34;license&#34; href=&#34;http://creativecommons.org/licenses/by-nc-sa/4.0/&#34;&gt;Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License&lt;/a&gt;.</rdf:li>
<rdf:li xml:lang='en' >This work is licensed under a &lt;a rel=&#34;license&#34; href=&#34;http://creativecommons.org/licenses/by-nc-sa/4.0/&#34;&gt;Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License&lt;/a&gt;.</rdf:li>
</rdf:Alt>
</xapRights:UsageTerms>
</rdf:Description>
<rdf:Description rdf:about=''
xmlns:cc='http://creativecommons.org/ns#'>
<cc:license rdf:resource='http://creativecommons.org/licenses/by-nc-sa/4.0/'/>
</rdf:Description>
</rdf:RDF>
</x:xmpmeta>
<?xpacket end='r'?>
-->
</div>
<!-- ==================================== FOOTER ============================ -->
<div id="footer">
<div id="copyright">Processing is an open project intiated by <a href="http://benfry.com/">Ben Fry</a> and <a href="http://reas.com">Casey Reas</a>. It is developed by a <a href="http://processing.org/about/people/">team of volunteers</a>.</div>
<div id="colophon">
<a href="copyright.html">&copy; Info</a>
</div>
</div>
</div>
<script src="javascript/jquery-1.9.1.min.js"></script>
<script src="javascript/site.js" type="text/javascript"></script>
</body>
</html>