Rainbow Pinwheel - p5.js

Size
2,190 Kb
Views
107,272

How do I make an rainbow pinwheel - p5.js?

Drag/click for effect. What is a rainbow pinwheel - p5.js? How do you make a rainbow pinwheel - p5.js? This script and codes were developed by Tina Anastopoulos on 31 August 2022, Wednesday.

Rainbow Pinwheel - p5.js Previews

Rainbow Pinwheel - p5.js - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Rainbow Pinwheel - p5.js</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <script src='https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.5.7/p5.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Rainbow Pinwheel - p5.js - Script Codes CSS Codes

body { background: #141432; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center;
}
canvas { border-radius: 50%;
}

Rainbow Pinwheel - p5.js - Script Codes JS Codes

var incr = 0;
var spiral = true;
function setup() { createCanvas(485, 485);
}
function draw() { background(0);	var color = ['rgb(255, 0 , 0)', 'rgb(255, 127, 0)','rgb(255, 255, 0)','rgb(0, 255, 0)','rgb(0, 0, 255)','rgb(75, 0, 130)','rgb(148, 0, 211)']; translate(width/2, height/2); for (var i = 0; i < 84; i++) {	fill(color[i%7]); bezier(200, 34, 300, 141, 63, 10, 49, 91); rotate((incr)); if (spiral) scale(1, 0.99); } incr += map(mouseX, 0, width, -.005, .005); pop();
};
function mousePressed() { spiral = !spiral;
}
Rainbow Pinwheel - p5.js - Script Codes
Rainbow Pinwheel - p5.js - Script Codes
Home Page Home
Developer Tina Anastopoulos
Username TWAIN
Uploaded August 31, 2022
Rating 4
Size 2,190 Kb
Views 107,272
Do you need developer help for Rainbow Pinwheel - p5.js?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Tina Anastopoulos (TWAIN) Script Codes
Create amazing Facebook ads with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!