Example usage for com.badlogic.gdx.graphics Color argb8888ToColor

List of usage examples for com.badlogic.gdx.graphics Color argb8888ToColor

Introduction

In this page you can find the example usage for com.badlogic.gdx.graphics Color argb8888ToColor.

Prototype

public static void argb8888ToColor(Color color, int value) 

Source Link

Document

Sets the Color components using the specified integer value in the format ARGB8888.

Usage

From source file:org.catrobat.catroid.content.actions.SetPenColorAction.java

License:Open Source License

@Override
protected void update(float delta) {
    try {/*  w w w.  ja va 2 s.c  o m*/
        int newRed = red == null ? 0 : red.interpretInteger(sprite);
        int newGreen = green == null ? 0 : green.interpretInteger(sprite);
        int newBlue = blue == null ? 0 : blue.interpretInteger(sprite);
        Color color = new Color();
        Color.argb8888ToColor(color, android.graphics.Color.argb(0xFF, newRed, newGreen, newBlue));
        sprite.penConfiguration.penColor = color;
    } catch (InterpretationException interpretationException) {
        Log.d(getClass().getSimpleName(), "Formula interpretation for this specific Brick failed.",
                interpretationException);
    }
}