diff --git a/web/template/syzoj/category.php b/web/template/syzoj/category.php index 747c9d4..7f0b9e3 100644 --- a/web/template/syzoj/category.php +++ b/web/template/syzoj/category.php @@ -19,14 +19,32 @@ ]; // 生成标签地图 + // 定义颜色主题数组 + $color_theme = array("primary", "secondary", "positive", "negative", "orange", "yellow", "olive", "green", "teal", "blue", "violet", "purple", "pink", "brown", "grey", "black"); + + // 为标签添加颜色样式 + function colorize_tag($tag) { + global $color_theme; + $hash_num = hexdec(substr(md5($tag), 0, 7)); + $label_theme = $color_theme[$hash_num % count($color_theme)]; + + if ($label_theme == "") + $label_theme = "default"; + + return $label_theme; + } + foreach ($tag_map as $level => $tags): ?> -