首页 > 文档 > stroke()描边
2017
08-08

stroke()描边

Name

stroke()描边

   

Examples

stroke()描边 - 第1张  | Processing编程艺术stroke()描边 - 第2张  | Processing编程艺术stroke()描边 - 第3张  | Processing编程艺术

stroke(153);

rect(30, 20, 55, 55);

stroke()描边 - 第4张  | Processing编程艺术stroke()描边 - 第5张  | Processing编程艺术stroke()描边 - 第6张  | Processing编程艺术

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, 每个值的范围从0255

 

使用十六进制表示法指定颜色时, 在值之前使用 “#” “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

rgb

int: color value in hexadecimal notation

十六进制表示法中的颜色值

alpha

float: opacity of the stroke

描边的不透明度

gray

float: specifies a value between white and black

指定介于白色和黑色之间的值

v1

float: red or hue value (depending on current color mode)

红色或色相值 (取决于当前颜色模式)

v2

float: green or saturation value (depending on current color mode)

绿色或色相值 (取决于当前颜色模式)

v3

float: blue or brightness value (depending on current color mode)

蓝色或色相值 (取决于当前颜色模式)

Returns

void

Related

noStroke()
strokeWeight()
strokeJoin()
strokeCap()
fill()
noFill()
tint()
background()
colorMode()



最后编辑:
作者:卡萨布兰卡
这个作者貌似有点懒,什么都没有留下。

留下一个回复

你的email不会被公开。