Skip to content

Instantly share code, notes, and snippets.

@victor141516
Created May 23, 2023 13:52
Show Gist options
  • Save victor141516/010228ad3419998487f6594a08438eec to your computer and use it in GitHub Desktop.
Save victor141516/010228ad3419998487f6594a08438eec to your computer and use it in GitHub Desktop.
hex colors that look like spanish words
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Colors</title>
<style>
body {
display: grid;
grid-template-columns: repeat(auto-fit, 100px);
grid-auto-rows: 100px;
gap: 10px;
}
.color {
position: relative;
}
.text {
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
text-shadow: 0px 0px 5px white, 0px 0px 5px white, 0px 0px 5px white;
}
</style>
</head>
<body>
</body>
<script>
(() => {
const colors = [
'#a7a',
'#ba0bab',
'#ba5ada',
'#ba7a7a',
'#becada',
'#b0a',
'#b0bada',
'#b0ca7a',
'#cac07a',
'#ca5e7a',
'#ca5e7e',
'#dece50',
'#d05',
'#ec0',
'#efe',
'#efec70',
'#e5a',
'#e5e',
'#fabada',
'#fe0',
'#aca7e5',
'#0ca',
'#0da',
'#05a',
'#5acada',
'#5ed',
'#5e0',
'#7abac0',
'#7a0',
'#7ea',
'#7e7ada',
]
colors.forEach(color => {
const element = document.createElement('div')
const text = document.createElement('span')
text.classList.add('text')
text.innerText = color
element.appendChild(text)
element.classList.add('color')
element.style.backgroundColor = color
document.body.appendChild(element)
})
})()
</script>
</html>
@victor141516
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment