Toward a Canvas and Color Picker: Week 3

Developer
Size
1,898 Kb
Views
30,360

How do I make an toward a canvas and color picker: week 3?

What is a toward a canvas and color picker: week 3? How do you make a toward a canvas and color picker: week 3? This script and codes were developed by Anshu Arora on 15 September 2022, Thursday.

Toward a Canvas and Color Picker: Week 3 Previews

Toward a Canvas and Color Picker: Week 3 - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Toward a Canvas and Color Picker: Week 3</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <h1>Toward a Canvas - Changing Div to Canvas</h1>
<canvas id="d1"> </canvas>
<p> <input type="button" value="make lime" onclick="dolime()"> <input type="color" value="#e2e036" id="clr" onchange="docolor()"> <input type="range" min="10" max="100"
value="10" id="sldr" oninput="dosquare()">
</p> <script src="js/index.js"></script>
</body>
</html>

Toward a Canvas and Color Picker: Week 3 - Script Codes CSS Codes

canvas { width: 300px; height: auto; border: 1px solid #c3c3c3;
}

Toward a Canvas and Color Picker: Week 3 - Script Codes JS Codes

function dolime() { var dd1 = document.getElementById("d1"); dd1.style.backgroundColor="lime";
}
function docolor() { var dd1 = document.getElementById("d1"); var colorinput = document.getElementById("clr"); var color = colorinput.value; dd1.style.backgroundColor = color;
}
function dosquare() { var dd1 = document.getElementById("d1"); var sizeinput = document.getElementById("sldr"); var size = sizeinput.value; var ctx = dd1.getContext("2d"); ctx.clearRect(0,0,dd1.width,dd1.height) ctx.fillStyle = "yellow" ctx.fillRect(10,10,size,size);
}
Toward a Canvas and Color Picker: Week 3 - Script Codes
Toward a Canvas and Color Picker: Week 3 - Script Codes
Home Page Home
Developer Anshu Arora
Username anshusaxenaarora
Uploaded September 15, 2022
Rating 3
Size 1,898 Kb
Views 30,360
Do you need developer help for Toward a Canvas and Color Picker: Week 3?

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!

Anshu Arora (anshusaxenaarora) Script Codes
Create amazing SEO content 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!