package net.mostlyoriginal.api.component.graphics;

import com.artemis.Component;

/**
 * Color for animations, labels.
 *
 * Optional, convention is to assume white if not set.
 *
 * @author Daan van Yperen
 */
public class Color extends Component {

    public float r;
    public float g;
    public float b;
    public float a;

    public Color() {
    }

    public Color(Color color) {
        this.r = color.r;
        this.g = color.g;
        this.b = color.b;
        this.a = color.a;
    }

    public Color(float r, float g, float b, float a) {
        this.r = r;
        this.g = g;
        this.b = b;
        this.a = a;
    }

    public void set(float r, float g, float b, float a) {
        this.r = r;
        this.g = g;
        this.b = b;
        this.a = a;
    }

    public void set(Color color)
    {
        this.r = color.r;
        this.g = color.g;
        this.b = color.b;
        this.a = color.a;
    }
}

@@ -489,32 +489,386 @@
 color.a;%0A    %7D%0A%0A
+%09/** Color component by hex, RRGGBBAA. */%0A%09public Color(String hex) %7B%0A%09%09this((float)Integer.valueOf(hex.substring(0, 2), 16) / 255.0F,%0A%09%09%09 (float)Integer.valueOf(hex.substring(2, 4), 16) / 255.0F,%0A%09%09%09 (float)Integer.valueOf(hex.substring(4, 6), 16) / 255.0F,%0A%09%09%09 (float)(hex.length() != 8 ? 255 : Integer.valueOf(hex.substring(6, 8), 16)) / 255.0F);%0A%09%7D%0A%0A
     public Color

Add hex constructor to color.