当前位置:网站首页>P5.js development - setting
P5.js development - setting
2022-07-03 19:49:00 【PGzxc】
One summary
- Background color related (background/clear/clolorMode)
- Fill in related (fill/noFill)
- Stroke correlation (stroke/noStroke)
- Erase canvas related (erase/noErase)
Two Background color related (background/clear/clolorMode)
2.1 Attribute specification
| No | attribute | explain |
|---|---|---|
| 1 | background | Background color |
| 2 | clear | Clear the pixels in the graphics buffer |
| 3 | colorMode | colorMode() change p5.js How to interpret color data |
2.2 Example
Code
let value=51;
function setup() {
background(value);
}
function mouseClicked()
{
clear();
colorMode(HSB, 100);
background('red');
}
design sketch

3、 ... and Fill in related (fill/noFill)
3.1 Attribute specification
| No | attribute | explain |
|---|---|---|
| 1 | fill | Fill color |
| 2 | noFill | Disable padding |
3.2 Example
Code
function setup() {
createCanvas(displayWidth, displayHeight);
fill(51);
rect(20, 20, 60, 60);
}
function mouseClicked()
{
noFill();
rect(30, 30, 80, 80);
}
design sketch

Four Stroke correlation (stroke/noStroke)
4.1 Attribute specification
| No | attribute | explain |
|---|---|---|
| 1 | stroke | Stroke |
| 2 | noStroke | Disable stroke |
4.2 Example
Code
function setup() {
createCanvas(displayWidth, displayHeight);
background(200);
}
function draw() {
strokeWeight(4);
stroke(51);
rect(20, 20, 60, 60);
}
function mouseClicked()
{
noStroke();
rect(80, 80,60, 60);
}
design sketch

5、 ... and Erase canvas related (erase/noErase)
5.1 Attribute specification
| No | attribute | explain |
|---|---|---|
| 1 | erase | Erase drawing |
| 2 | noErase | Cancel erase |
5.2 Example
Code
function setup() {
createCanvas(displayWidth, displayHeight);
background(200);
}
function draw() {
fill(250, 100, 100);
rect(20, 20, 60, 60);
erase();
}
function mouseClicked()
{
ellipse(25, 30, 30);
noErase();
}
design sketch

边栏推荐
- Day10 ---- 强制登录, token刷新与jwt禁用
- Read the paper glodyne global topology preserving dynamic network embedding
- Octopus online ecological chain tour Atocha protocol received near grant worth $50000
- Day11 - my page, user information acquisition, modification and channel interface
- Find a line in a file and remove it
- Day11 ---- 我的页面, 用户信息获取修改与频道接口
- CMD implements the language conversion of locale non Unicode programs
- 第二章:求a,b的最大公约与最小公倍数经典求解,求a,b的最大公约与最小公倍数常规求解,求n个正整数的的最大公约与最小公倍数
- 2022-06-30 advanced network engineering (XIV) routing strategy - matching tools [ACL, IP prefix list], policy tools [filter policy]
- Native table - scroll - merge function
猜你喜欢

Chapter 1: sum of three factorials, graph point scanning

Teach you how to quickly recover data by deleting recycle bin files by mistake

第一章:简化同码小数和s(d, n)

02 -- QT OpenGL drawing triangle

第一章: 舍罕王失算

Phpstudy set LAN access

BOC protected alanine zinc porphyrin Zn · TAPP ala BOC / alanine zinc porphyrin Zn · TAPP ala BOC / alanine zinc porphyrin Zn · TAPP ala BOC / alanine zinc porphyrin Zn · TAPP ala BOC supplied by Qiyu

Detailed and not wordy. Share the win10 tutorial of computer reinstallation system

2022.2.14 Li Kou - daily question - single element in an ordered array

Gym welcomes the first complete environmental document, which makes it easier to get started with intensive learning!
随机推荐
Common text labels
Web Security (VIII) what is CSRF attack? Why can token prevent csdf attacks?
BUUCTF
第一章: 舍罕王失算
Detailed and not wordy. Share the win10 tutorial of computer reinstallation system
Zhang Fei hardware 90 day learning notes - personal record on day 5. Please see my personal profile / homepage for the complete record
4. Data splitting of Flink real-time project
2022-06-30 网工进阶(十四)路由策略-匹配工具【ACL、IP-Prefix List】、策略工具【Filter-Policy】
03 -- QT OpenGL EBO draw triangle
kubernetes集群搭建efk日志收集平台
FAQs for datawhale learning!
Don't be afraid of no foundation. Zero foundation doesn't need any technology to reinstall the computer system
BOC protected alanine porphyrin compound TAPP ala BOC BOC BOC protected phenylalanine porphyrin compound TAPP Phe BOC Qi Yue supply
P3402 persistent and searchable
Acquisition and transmission of parameters in automatic testing of JMeter interface
7. Data broker presentation
Win10 share you don't have permission
Chapter 1: simplify the same code decimal sum s (D, n)
BOC protected phenylalanine zinc porphyrin (Zn · TAPP Phe BOC) / iron porphyrin (Fe · TAPP Phe BOC) / nickel porphyrin (Ni · TAPP Phe BOC) / manganese porphyrin (Mn · TAPP Phe BOC) Qiyue Keke
第一章:求n的阶乘n!