Implement generator classes and perlin noise with colors

This commit is contained in:
Tim
2023-06-03 02:21:48 +02:00
parent 7216edd186
commit 542f1970f5
8 changed files with 328 additions and 4 deletions

27
templates/map.html.twig Normal file
View File

@ -0,0 +1,27 @@
<style>
:root {
--pixel-size: 9px;
--pixel-gap: 0px;
--pixel-color: #000;
}
.map {
display: grid;
grid-template-columns: repeat(279, var(--pixel-size));
grid-auto-rows: var(--pixel-size);
grid-gap: var(--pixel-gap);
}
.map > div {
width: var(--pixel-size);
height: 100%;
grid-area: var(--y) / var(--x) / var(--y) / var(--x);
background-color: var(--pixel-color);
}
</style>
<div class="map">
{% for pixel in pixels %}
{{ pixel|raw }}
{% endfor %}
</div>

View File

@ -0,0 +1 @@
<div style="--x: {{ x }}; --y: {{ y }}; background: {{ color.code }}"></div>