Applied-Energistics-2-tiler.../src/api/java/appeng/api/util/AEColor.java

127 lines
4.3 KiB
Java
Raw Normal View History

2014-12-13 01:19:51 +01:00
/*
* The MIT License (MIT)
2015-02-03 12:04:13 +01:00
*
2014-12-13 01:19:51 +01:00
* Copyright (c) 2013 AlgorithmX2
2015-02-03 12:04:13 +01:00
*
2014-12-13 01:19:51 +01:00
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
2015-02-03 12:04:13 +01:00
*
2014-12-13 01:19:51 +01:00
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
2015-02-03 12:04:13 +01:00
*
2014-12-13 01:19:51 +01:00
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package appeng.api.util;
import java.util.Arrays;
import java.util.List;
2015-06-16 02:44:59 +02:00
import net.minecraft.item.EnumDyeColor;
import net.minecraft.util.StatCollector;
/**
* List of all colors supported by AE, their names, and various colors for display.
2015-02-03 12:04:13 +01:00
*
* Should be the same order as Dyes, excluding Transparent.
*/
public enum AEColor
{
2015-06-16 02:44:59 +02:00
White( "gui.appliedenergistics2.White", EnumDyeColor.WHITE, 0xBEBEBE, 0xDBDBDB, 0xFAFAFA ),
2015-06-16 02:44:59 +02:00
Orange( "gui.appliedenergistics2.Orange", EnumDyeColor.ORANGE, 0xF99739, 0xFAAE44, 0xF4DEC3 ),
2015-06-16 02:44:59 +02:00
Magenta( "gui.appliedenergistics2.Magenta", EnumDyeColor.MAGENTA, 0x821E82, 0xB82AB8, 0xC598C8 ),
2015-06-16 02:44:59 +02:00
LightBlue( "gui.appliedenergistics2.LightBlue", EnumDyeColor.LIGHT_BLUE, 0x628DCB, 0x82ACE7, 0xD8F6FF ),
2015-06-16 02:44:59 +02:00
Yellow( "gui.appliedenergistics2.Yellow", EnumDyeColor.YELLOW, 0xFFF7AA, 0xF8FF4A, 0xFFFFE8 ),
2015-06-16 02:44:59 +02:00
Lime( "gui.appliedenergistics2.Lime", EnumDyeColor.LIME, 0x7CFF4A, 0xBBFF51, 0xE7F7D7 ),
2015-06-16 02:44:59 +02:00
Pink( "gui.appliedenergistics2.Pink", EnumDyeColor.PINK, 0xDC8DB5, 0xF8B5D7, 0xF7DEEB ),
2015-06-16 02:44:59 +02:00
Gray( "gui.appliedenergistics2.Gray", EnumDyeColor.GRAY, 0x7C7C7C, 0xA0A0A0, 0xC9C9C9 ),
2015-06-16 02:44:59 +02:00
LightGray( "gui.appliedenergistics2.LightGray", EnumDyeColor.SILVER, 0x9D9D9D, 0xCDCDCD, 0xEFEFEF ),
2015-06-16 02:44:59 +02:00
Cyan( "gui.appliedenergistics2.Cyan", EnumDyeColor.CYAN, 0x2F9BA5, 0x51AAC6, 0xAEDDF4 ),
2015-06-16 02:44:59 +02:00
Purple( "gui.appliedenergistics2.Purple", EnumDyeColor.PURPLE, 0x8230B2, 0xA453CE, 0xC7A3CC ),
2015-06-16 02:44:59 +02:00
Blue( "gui.appliedenergistics2.Blue", EnumDyeColor.BLUE, 0x2D29A0, 0x514AFF, 0xDDE6FF ),
2015-06-16 02:44:59 +02:00
Brown( "gui.appliedenergistics2.Brown", EnumDyeColor.BROWN, 0x724E35, 0xB7967F, 0xE0D2C8 ),
2015-06-16 02:44:59 +02:00
Green( "gui.appliedenergistics2.Green", EnumDyeColor.GREEN, 0x45A021, 0x60E32E, 0xE3F2E3 ),
2015-06-16 02:44:59 +02:00
Red( "gui.appliedenergistics2.Red", EnumDyeColor.RED, 0xA50029, 0xFF003C, 0xFFE6ED ),
2015-06-16 02:44:59 +02:00
Black( "gui.appliedenergistics2.Black", EnumDyeColor.BLACK, 0x2B2B2B, 0x565656, 0x848484 ),
2015-06-16 02:44:59 +02:00
Transparent( "gui.appliedenergistics2.Fluix", null, 0x1B2344, 0x895CA8, 0xD7BBEC );
public static final List<AEColor> VALID_COLORS = Arrays.asList( White, Orange, Magenta, LightBlue, Yellow, Lime, Pink, Gray, LightGray, Cyan, Purple, Blue, Brown, Green, Red, Black );
/**
* Unlocalized name for color.
*/
public final String unlocalizedName;
/**
* Darkest Variant of the color, nearly black; as a RGB HEX Integer
*/
public final int blackVariant;
/**
* The Variant of the color that is used to represent the color normally; as a RGB HEX Integer
*/
public final int mediumVariant;
/**
* Lightest Variant of the color, nearly white; as a RGB HEX Integer
*/
public final int whiteVariant;
2015-06-16 02:44:59 +02:00
/**
* Vanilla Dye Equivilient
*/
public final EnumDyeColor dye;
AEColor( String unlocalizedName, EnumDyeColor dye, int blackHex, int medHex, int whiteHex )
{
this.unlocalizedName = unlocalizedName;
2015-01-01 21:17:00 +01:00
this.blackVariant = blackHex;
this.mediumVariant = medHex;
this.whiteVariant = whiteHex;
2015-06-16 02:44:59 +02:00
this.dye = dye;
}
/**
* Logic to see which colors match each other.. special handle for Transparent
*/
public boolean matches( AEColor color )
{
2015-01-02 00:01:34 +01:00
return this == Transparent || color == Transparent || this == color;
}
@Override
public String toString()
{
2015-01-01 21:17:00 +01:00
return StatCollector.translateToLocal( this.unlocalizedName );
}
}