Random color generator
How do I make an random color generator?
What is a random color generator? How do you make a random color generator? This script and codes were developed by Yuvaraj Tana on 23 November 2022, Wednesday.
Random color generator - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Random color generator </title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <p>color of text will keep changing on each click</p>
<button onClick="getRandomColor()">Click on me</button> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Random color generator - Script Codes CSS Codes
p{ font-size:60px; text-align:center;
}
Random color generator - Script Codes JS Codes
//Method:1
function getRandomColor() { var letters = '0123456789ABCDEF'.split(''); var color = '#'; for (var i = 0; i < 6; i++ ) { color += letters[Math.floor(Math.random() * 16)]; } $('p').css('color',color);
}
// Method:2
var randomColorHaxValues = Math.floor(Math.random()*16777215).toString(16);
$('p').css('color',randomColorHaxValues);
var randomColorRgbValues = 'rgb(' + (Math.floor(Math.random() * 256)) + ',' + (Math.floor(Math.random() * 256)) + ',' + (Math.floor(Math.random() * 256)) + ')';
Developer | Yuvaraj Tana |
Username | YuvarajTana |
Uploaded | November 23, 2022 |
Rating | 3 |
Size | 1,844 Kb |
Views | 12,144 |
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!
Name | Size |
A Pen by Yuvaraj Tana | 1,165 Kb |
Basic HTML5 Structure | 1,289 Kb |
Understanding Box Model | 1,459 Kb |
Background Text Using CSS overlay Like Watermark | 1,613 Kb |
Ng-repeat | 2,124 Kb |
Example 1 - SVG - Circle | 1,248 Kb |
Grouping checkbox | 1,964 Kb |
React - Hello world | 2,212 Kb |
Angular custom directive for donut chart | 1,951 Kb |
Digital Clock using JavaScript | 1,828 Kb |
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!
Name | Username | Size |
Android Play Store With Slick Carousel | -J0hn- | 4,982 Kb |
Easing | GreenSock | 2,043 Kb |
CSS3 Media Queries demo | Machal | 1,824 Kb |
Sticky div | Kaslab | 2,225 Kb |
Super Discount | Orrinward | 3,225 Kb |
STAR WARS LIGHTSABER | Francoiscoron | 4,420 Kb |
CSS Heart Loaders | Nourabusoud | 2,161 Kb |
Pure CSS Read More Arrow | Zephyr | 1,747 Kb |
A Pen by Rob Levin | Roblevin | 2,787 Kb |
CSS Colors | Alexpate | 2,232 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!