Package transientlibs.preui.objects.gui.elements

Source Code of transientlibs.preui.objects.gui.elements.TransientColour

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package transientlibs.preui.objects.gui.elements;

import transientlibs.preui.objects.gui.interfaces.IColour;
//import org.newdawn.slick.Color;
import com.badlogic.gdx.graphics.Color;
import transientlibs.slick2d.util.Log;

/**
*
** @author kibertoad
*/
public class TransientColour implements IColour {

    float a;
    float b;
    float g;
    float r;
    //public org.newdawn.slick.Color color;
    public com.badlogic.gdx.graphics.Color GDXColor;

    public TransientColour() {
    }

    /*
    public void copy(org.newdawn.slick.Color c) {
        a = c.a;
        b = c.b;
        g = c.g;
        r = c.r;
    }
    */

    public TransientColour(float alpha, float setR, float setG, float setB) {
        a = alpha;
        r = setR;
        g = setG;
        b = setB;
       
        //Log.info("r: "+r);
        //Log.info("g: "+g);
        //Log.info("b: "+b);

        //color = new org.newdawn.slick.Color(r, g, b, a);

        float aF;
        float rF;
        float gF;
        float bF;

        aF = a / 255.0f;
        rF = r / 255.0f;
        gF = g / 255.0f;
        bF = b / 255.0f;


        GDXColor = new Color(rF, gF, bF, aF);
    }

    /*
    public TransientColour(org.newdawn.slick.Color c) {
        a = c.a;
        b = c.b;
        g = c.g;
        r = c.r;

        color = c;
    }
    */

    @Override
    public float a() {
        return a;
    }

    @Override
    public float b() {
        return b;
    }
   
    @Override
    public float g() {
        return g;
    }
   
    @Override
    public float r() {
        return r;
    }   

    //@Override
    //public org.newdawn.slick.Color getSlickColor() {
    //    return color;
    //}

    @Override
    public com.badlogic.gdx.graphics.Color getGDXColour() {
        return GDXColor;
    }

    @Override
    public String toString() {
        return "Colour: " + r + "/" + g + "/" + b;
    }
}
TOP

Related Classes of transientlibs.preui.objects.gui.elements.TransientColour

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.