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

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

Introduction

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

Prototype

@Override
    public boolean equals(Object o) 

Source Link

Usage

From source file:com.kotcrab.vis.editor.ui.scene.entityproperties.BasicEntityPropertiesTable.java

License:Apache License

private void setTintUIForEntities() {
    ImmutableArray<EntityProxy> entities = properties.getSelectedEntities();

    Color firstColor = entities.first().getColor();
    for (EntityProxy entity : entities) {
        if (!firstColor.equals(entity.getColor())) {
            tint.setUnknown(true);//from   w  ww  .  ja  v  a2  s  . com
            return;
        }
    }

    tint.setUnknown(false);
    tint.setColor(firstColor);
}

From source file:com.longarmx.color.Enemy.java

License:Apache License

public boolean acceptableColor(Color color) {
    for (Color tmp : Colors.list) {
        if (color.equals(tmp) && !color.equals(game.lastEnemyColor))
            return true;
    }/* w  w w  .ja  v  a 2  s .c  o  m*/
    return false;
}

From source file:com.longarmx.color.Enemy.java

License:Apache License

public String getColorString() {
    Color temp = new Color(red, green, blue, 1);
    if (temp.equals(Colors.BRIGHT_RED)) {
        return "Bright Red";
    } else if (temp.equals(Colors.BRIGHT_GREEN)) {
        return "Bright Green";
    } else if (temp.equals(Colors.BRIGHT_BLUE)) {
        return "Bright Blue";
    } else if (temp.equals(Colors.BRIGHT_YELLOW)) {
        return "Bright Yellow";
    } else if (temp.equals(Colors.BRIGHT_MAGENTA)) {
        return "Bright Magenta";
    } else if (temp.equals(Colors.BRIGHT_CYAN)) {
        return "Bright Cyan";
    } else if (temp.equals(Colors.WHITE)) {
        return "White";
    } else if (temp.equals(Colors.BLACK)) {
        return "Black";
    } else if (temp.equals(Colors.DARK_RED)) {
        return "Dark Red";
    } else if (temp.equals(Colors.DARK_GREEN)) {
        return "Dark Green";
    } else if (temp.equals(Colors.DARK_BLUE)) {
        return "Dark Blue";
    } else if (temp.equals(Colors.DARK_YELLOW)) {
        return "Dark Yellow";
    } else if (temp.equals(Colors.DARK_MAGENTA)) {
        return "Dark Magenta";
    } else if (temp.equals(Colors.DARK_CYAN)) {
        return "Dark Cyan";
    } else if (temp.equals(Colors.GRAY)) {
        return "Gray";
    } else if (temp.equals(Colors.PURPLE)) {
        return "Purple";
    } else if (temp.equals(Colors.SKY_BLUE)) {
        return "Sky Blue";
    } else if (temp.equals(Colors.ORANGE)) {
        return "Orange";
    } else if (temp.equals(Colors.LIME_GREEN)) {
        return "Lime Green";
    } else if (temp.equals(Colors.PINK)) {
        return "Pink";
    } else if (temp.equals(Colors.PALE_BLUE)) {
        return "Pale Blue";
    } else if (temp.equals(Colors.SALMON)) {
        return "Salmon";
    } else {/*from  w w w. j  av  a2  s  . c  o  m*/
        return "Unknown";
    }
}

From source file:org.ams.testapps.paintandphysics.cardhouse.CardHouseWithGUI.java

License:Open Source License

/**
 * Get first card with given color. Only works on the cards
 * returned by {@link CardHouse#getColoredCards()}.
 *//*from w  w w. j  ava  2s .  c o m*/
private PPPolygon getCard(Color color) {
    Array<PPPolygon> cards = cardHouse.getColoredCards();
    PPPolygon card = null;

    for (PPPolygon card1 : cards) {
        Color color1 = card1.getOutlinePolygons().first().getColor();
        if (color1.equals(color)) {
            card = card1;
            break;
        }
    }
    return card;
}

From source file:org.shadebob.skineditor.ColorPickerDialog.java

License:Apache License

/**
 * Check if the color is already in use somewhere else in the skin
 *//*  w ww. j a va2  s.co  m*/
public boolean isColorInUse(Color color) {

    try {
        // Check if it is already in use somewhere!
        for (String widget : SkinEditorGame.widgets) {
            String widgetStyle = "com.badlogic.gdx.scenes.scene2d.ui." + widget + "$" + widget + "Style";
            Class<?> style = Class.forName(widgetStyle);
            ObjectMap<String, ?> styles = game.skinProject.getAll(style);
            Iterator<String> it = styles.keys().iterator();
            while (it.hasNext()) {
                Object item = styles.get((String) it.next());
                Field[] fields = ClassReflection.getFields(item.getClass());
                for (Field field : fields) {

                    if (field.getType() == Color.class) {

                        Color c = (Color) field.get(item);
                        if (color.equals(c)) {
                            return true;
                        }

                    }

                }

            }

        }
    } catch (Exception e) {
        e.printStackTrace();

    }

    return false;
}