Ignore black for random colors

This commit is contained in:
games647 2017-06-01 19:49:30 +02:00
parent 5455c8d039
commit b8c61ecaba
No known key found for this signature in database
GPG Key ID: E9E962F08F621538
3 changed files with 7 additions and 2 deletions

View File

@ -8,7 +8,7 @@
<packaging>jar</packaging>
<name>ColorConsole</name>
<version>2.1</version>
<version>2.2</version>
<inceptionYear>2016</inceptionYear>
<url>http://dev.bukkit.org/bukkit-plugins/colorconsole/</url>
<description>

View File

@ -3,6 +3,7 @@ package com.github.games647.colorconsole.common;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import java.util.Arrays;
import java.util.Collection;
import java.util.Map;
import java.util.Random;
@ -10,6 +11,7 @@ import java.util.Set;
import org.fusesource.jansi.Ansi;
import org.fusesource.jansi.Ansi.Attribute;
import org.fusesource.jansi.Ansi.Color;
import org.fusesource.jansi.AnsiRenderer;
public class CommonFormatter {
@ -42,7 +44,9 @@ public class CommonFormatter {
public void initPluginColors(Collection<String> plugins, Map<String, String> configColors, String def) {
Random random = new Random();
Ansi.Color[] colors = Ansi.Color.values();
Color[] colors = Color.values();
//remove black, because it's often hard to read
colors = Arrays.copyOfRange(colors, 1, colors.length);
ImmutableMap.Builder<String, String> colorBuilder = ImmutableMap.builder();
for (String plugin : plugins) {

View File

@ -33,6 +33,7 @@ TRACE: blue
# This can be the default color or "random" it gives each plugin (besides the ones specified below) a different color
# which keeps the same until the server shuts down.
# Black is ignored by default, because it's often hard to read on the console
PLUGIN: blue
# Plugin: random