Name |
stroke()描边 |
||||||||||||
Examples |
stroke(153); rect(30, 20, 55, 55);
stroke(204, 102, 0); rect(30, 20, 55, 55); |
||||||||||||
Description |
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 colorMode(). The default color space is RGB, with each value in the range from 0 to 255. When using hexadecimal notation to specify a color, use “#” or “0x” before the values (e.g., #CCFFAA or 0xFFCCFFAA). The # 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 “0x“, 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. The value for the gray parameter must be less than or equal to the current maximum value as specified by colorMode(). The default maximum value is 255. When drawing in 2D with the default renderer, you may need hint(ENABLE_STROKE_PURE) to improve drawing quality (at the expense of performance). See the hint() documentation for more details. 设置用于绘制形状周围线条和边框的颜色。此颜色根据当前 colorMode () 的 RGB 或 HSB 颜色指定。默认的颜色空间是 RGB, 每个值的范围从0到255。
使用十六进制表示法指定颜色时, 在值之前使用 “#” 或 “0x” (例如, CCFFAA 或 0xFFCCFFAA)。# 语法使用六位数字来指定颜色 (就像通常在 HTML 和 CSS 中指定颜色一样)。当使用以 “0x” 开头的十六进制符号时, 必须用八字符指定十六进制值。前两个字符定义了 alpha 分量, 其余部分定义了红色、绿色和蓝色分量。
灰色参数的值必须小于或等于 colorMode () 指定的当前最大值。默认最大值为255。
在2D 中使用默认呈现器绘制时, 可能需要提示 (ENABLE_STROKE_PURE) 以提高绘图质量 (以牺牲性能为代价)。有关详细信息, 请参阅提示 () 文档。 |
||||||||||||
Syntax |
stroke(rgb) stroke(rgb, alpha) stroke(gray) stroke(gray, alpha) stroke(v1, v2, v3) stroke(v1, v2, v3, alpha) |
||||||||||||
Parameters |
|
||||||||||||
Returns |
void |
||||||||||||
Related |
noStroke() |
- 本文固定链接: http://iprocessing.cn/2017/08/08/stroke描边/
- 转载请注明: 卡萨布兰卡 于 Processing编程艺术 发表