Color chooser practice-2

Developer
Size
1,887 Kb
Views
16,192

How do I make an color chooser practice-2?

What is a color chooser practice-2? How do you make a color chooser practice-2? This script and codes were developed by Lichi Chen on 18 October 2022, Tuesday.

Color chooser practice-2 Previews

Color chooser practice-2 - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>color chooser practice-2</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <h1>Canvas Element</h1>
<canvas id="one"></canvas>
<p> <input type = "button" value = "black" onclick = "doblack()"> <input id = "clr" type = "color" value = "#0000FF" onclick = "docolor()"> <input id = "sldr" type = "range" min = "0" max = "100" value = "0" oninput = "dosquare()">
</p> <script src="js/index.js"></script>
</body>
</html>

Color chooser practice-2 - Script Codes CSS Codes

canvas { width: 200px; height: 100px; margin: 20px;
}

Color chooser practice-2 - Script Codes JS Codes

function doblack() { var c1 = document.getElementById("one"); c1.style.backgroundColor = "black";
}
function docolor() { var c1 = document.getElementById("one"); var colorinput = document.getElementById("clr"); var color = colorinput.value; c1.style.backgroundColor = color;
}
function dosquare() { var sizeinput = document.getElementById("sldr"); var size = sizeinput.value; var c1 = document.getElementById("one"); var ctx = c1.getContext("2d"); ctx.clearRect(10,10,c1.width,c1.height); ctx.fillStyle = "yellow"; ctx.fillRect (10,10,size,size);
}
Color chooser practice-2 - Script Codes
Color chooser practice-2 - Script Codes
Home Page Home
Developer Lichi Chen
Username chenlichiclc
Uploaded October 18, 2022
Rating 3
Size 1,887 Kb
Views 16,192
Do you need developer help for Color chooser practice-2?

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!

Lichi Chen (chenlichiclc) Script Codes
Name
Upload and Display
Color chooser practice-1
1
3
My Interests Page
2
The Filter Page-3
Week 3
Draft
The Filter Page
Create amazing blog posts 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!