#2931: Fix exceptions on ChatColor.of(Color) due to truncation
This commit is contained in:
parent
aa22fe68e5
commit
64e4f4658a
@ -72,7 +72,7 @@ public final class ChatColor
|
|||||||
/**
|
/**
|
||||||
* Represents blue.
|
* Represents blue.
|
||||||
*/
|
*/
|
||||||
public static final ChatColor BLUE = new ChatColor( '9', "blue", new Color( 0x05555FF ) );
|
public static final ChatColor BLUE = new ChatColor( '9', "blue", new Color( 0x5555FF ) );
|
||||||
/**
|
/**
|
||||||
* Represents green.
|
* Represents green.
|
||||||
*/
|
*/
|
||||||
@ -238,7 +238,7 @@ public final class ChatColor
|
|||||||
|
|
||||||
public static ChatColor of(Color color)
|
public static ChatColor of(Color color)
|
||||||
{
|
{
|
||||||
return of( "#" + Integer.toHexString( color.getRGB() ).substring( 2 ) );
|
return of( "#" + String.format( "%08x", color.getRGB() ).substring( 2 ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ChatColor of(String string)
|
public static ChatColor of(String string)
|
||||||
|
Loading…
Reference in New Issue
Block a user