1
0
This commit is contained in:
Philip Wagner
2024-08-31 10:01:49 +02:00
commit 78b6c0d381
1169 changed files with 235103 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
<?php
function colorToStr(string $color): string {
return match ($color) {
"#f1edeb", "" => "white",
"#ff00ff" => "pink",
"#48bd8d" => "green",
"#8200ff" => "lila",
"#ff6700" => "orange",
"#000000" => "black",
};
}
function bg(string $bgColor, string $gridColor): string {
if ($gridColor == "") $gridColor = "#8200ff";
$bg = 'bg-' . colorToStr($bgColor) . '-' . colorToStr($gridColor);
remember($bg);
return $bg;
}
function remember(string $value): string {
static $oldValue = "bg-white-lila";
$copy = $oldValue;
$oldValue = $value;
return $copy;
}
function randomBg(): string {
static $colors = ["#f1edeb", "#ff00ff", "#48bd8d", "#8200ff", "#ff6700"];
$a = array_rand($colors, 2);
return bg($colors[$a[0]], $colors[$a[1]]);
}