Added Shows, ActionFoto's and Attraction Status
This commit is contained in:
parent
b105bd7db7
commit
ad320963fc
30 changed files with 1190 additions and 503 deletions
52
app/Color/MinecraftColor.php
Normal file
52
app/Color/MinecraftColor.php
Normal file
|
@ -0,0 +1,52 @@
|
|||
<?php
|
||||
namespace App\Color;
|
||||
|
||||
class MinecraftColor {
|
||||
|
||||
private static $array = [
|
||||
"&0" => "#333",
|
||||
"&1" => "#2980b9",
|
||||
"&2" => "#27ae60",
|
||||
"&3" => "#01a3a4",
|
||||
"&4" => "#c0392b",
|
||||
"&5" => "#8e44ad",
|
||||
"&6" => "#f39c12",
|
||||
"&7" => "#95a5a6",
|
||||
"&8" => "#7f8c8d",
|
||||
"&9" => "#3498db",
|
||||
"&a" => "#2ecc71",
|
||||
"&b" => "#00d2d3",
|
||||
"&c" => "#e74c3c",
|
||||
"&d" => "#f368e0",
|
||||
"&e" => "#f1c40f",
|
||||
"&f" => "#bdc3c7"
|
||||
];
|
||||
|
||||
private static $none = [
|
||||
"&l", "&m", "&n", "&o", "&r",
|
||||
];
|
||||
|
||||
public static function color($text) {
|
||||
foreach(self::$array as $key => $value) {
|
||||
$str = str_replace($key, $value, $text);
|
||||
if($str !== $text) {
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
public static function stripColor($text) {
|
||||
foreach(self::$array as $key => $value) {
|
||||
$text = str_replace($key, "", $text);
|
||||
}
|
||||
|
||||
foreach(self::$none as $key) {
|
||||
$text = str_replace($key, "", $text);
|
||||
}
|
||||
|
||||
return $text;
|
||||
}
|
||||
|
||||
}
|
Reference in a new issue