Add completed color test in RGB and HSB modes
This commit is contained in:
@ -0,0 +1,14 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Document</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<script src="p5.min.js"></script>
|
||||||
|
<script src="sketch.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
3
CM2030 Graphics Programming/Week 13/13.1.2 Colours/p5.min.js
vendored
Normal file
3
CM2030 Graphics Programming/Week 13/13.1.2 Colours/p5.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
39
CM2030 Graphics Programming/Week 13/13.1.2 Colours/sketch.js
Normal file
39
CM2030 Graphics Programming/Week 13/13.1.2 Colours/sketch.js
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
function setup() {
|
||||||
|
createCanvas(1000, 500);
|
||||||
|
colorMode(RGB);
|
||||||
|
for(let i=0; i<255; i++)
|
||||||
|
{
|
||||||
|
for(let j=0; j<255; j++)
|
||||||
|
{
|
||||||
|
stroke(i, j, 0);
|
||||||
|
point(i, j);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
colorMode(HSB);
|
||||||
|
translate(255, 0);
|
||||||
|
for(let x=0; x<360; x++)
|
||||||
|
{
|
||||||
|
for(let y=0; y<100; y++)
|
||||||
|
{
|
||||||
|
stroke(x, y, 100);
|
||||||
|
point(x, y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
translate(0, 155);
|
||||||
|
for(let x=0; x<360; x++)
|
||||||
|
{
|
||||||
|
for(let y=0; y<100; y++)
|
||||||
|
{
|
||||||
|
stroke(x, 100, y);
|
||||||
|
point(x, y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
noLoop();
|
||||||
|
}
|
||||||
|
|
||||||
|
function draw() {
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user