Random color
How do I make an random color?
Generate random colors with a simple and clean script.. What is a random color? How do you make a random color? This script and codes were developed by Alejandro Montañez on 13 October 2022, Thursday.
Random color - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Random color</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div id='container'> <div id='preview'> <div>#17191B</div> </div> <div id='button'>random color</div>
</div> <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 - Script Codes CSS Codes
@import url(https://fonts.googleapis.com/css?family=Open+Sans+Condensed:300);
html, body{ min-width: 100%; min-height: 100%;
}
body{ margin: 0; padding: 0; background: #0E0F10; color: #a0a0a0;
}
div{ margin: 0; padding: 0;
}
#container{ position: absolute; top: 50%; left: 50%; margin: -147px 0 0 -110px;
}
#preview{ width: 200px; height: 200px; position: relative; margin: 0 auto 25px; border: 10px solid #17191b; border-radius: 20px; background: #19ea92; -webkit-transition: background 300ms; transition: background 300ms;
}
#preview div{ width: 200px; position: absolute; top: 100%; left: 0; margin-top: -40px; padding: 10px 0; text-align: center; letter-spacing: 2px; font: 300 22px/22px 'Open sans condensed', Helvetica; color: #a0a0a0; background: #17191b;
}
#button{ padding: 10px 20px; border-radius: 20px; outline: none; text-align: center; letter-spacing: 3px; font: 300 30px/30px 'Open sans condensed', Helvetica; background: #040505; color: #a0a0a0; cursor: pointer;
}
#button:active{ position: relative; top: 4px;
}
Random color - Script Codes JS Codes
var preview = $('#preview'), text = preview.children('div'), change = function(){ var color = '#' + (Math.random() * 0xFFFFFF << 0).toString(16) preview.css('background',color) text.text(color) };
$('#button').click(change).click()
/* rgb random:
function rand(a, b){ return Math.round( Math.random() * (b - a) + a )
}
// Random color
function randColor(){ var red = rand(0,255), green = rand(0,255), blue = rand(0,255); return 'rgb('+ red +', '+ green +', '+ blue +')';
}
$('#button').click(function(){ var color = randColor(); $('#preview').css({ background : color }) .children('div').text(color)
});
*/
Developer | Alejandro Montañez |
Username | codeams |
Uploaded | October 13, 2022 |
Rating | 3 |
Size | 2,362 Kb |
Views | 22,264 |
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 |
Such Spinners, Much Loading | 3,133 Kb |
Animated scroll in 3 lines of jQuery | 3,498 Kb |
Another loading animation | 2,463 Kb |
Progressbar test | 2,727 Kb |
Auto adjustable hexagon | 2,576 Kb |
Loading animation | 2,408 Kb |
Loading animation | 2,249 Kb |
My favorite colors | 3,221 Kb |
Background entrance animation | 2,588 Kb |
Bounce-in css animation | 2,313 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 |
SlideupBoxes | Gavra | 23,772 Kb |
Gradients | Karpovsystems | 2,394 Kb |
RSW | JordanC | 3,726 Kb |
A cube | KyleDavidE | 18,627 Kb |
Expandable Left Side Bar with jQuery animate | Retrofuturistic | 2,483 Kb |
Electric worm | Jeffibacache | 2,377 Kb |
Test | Dviate | 2,668 Kb |
Replace url via jquery | Serluk | 1,429 Kb |
Main page display | BarryKe | 4,562 Kb |
Css color for svg | Ademilter | 2,392 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!