+ 1
How can I check all the hexadecimal color values that are present in css?
Can I check all the hexadecimal color values present in css by a program or code or something else? I didn't understand much in the CSS Course about Hexadecimal values of colors, so I am just asking if I can know all of them. I am making a program for that.👇 https://code.sololearn.com/WpEom2mCEC1e/?ref=app
2 Réponses
+ 2
Check this out you will get one random color from all the possible colors that can be form through hex codes.
// JS CODE:
function get_color() {
var letters = '0123456789ABCDEF'.split('');
var color = '#';
for (var i = 0; i < 6; i++) {
color += letters[Math.round(Math.random() * 15)];
}
return color;
}
window.onload = (event) => {
var colour = get_color();
document.body.style.backgroundColor = colour;
console.log(colour);
};
+ 1
RKK Thanks for the answer😊