Package aspect.util

Examples of aspect.util.Color


    public Force cohesion;
    public Force alignment;
    public Force separation;
   
    public Boid() {
        Color color = Color.random(false);
       
        float[] vertices = {
            0, 0, 50, 0
        };
       
View Full Code Here


                    HashMap<Color, Entity> key = new HashMap<>();

                    if (isButtonDown(0)) {
                        ShaderProgram.lock(ShaderProgram.COLOR);
                        for (Entity entity : World.main) {
                            Color c = Color.random();
                            key.put(c, entity);
                            ShaderProgram.COLOR.setVar("color", c);
                            entity.render();
                        }
                        ShaderProgram.unlock();

                        Color c = getPixelColor(new Vector2(getCanvasWidth() / 2, getCanvasHeight() / 2));
                        Entity hit = key.get(c);

                        if (hit instanceof Fighter) {
                            Fighter f = (Fighter) hit;
                            if (f.health > 0) {
View Full Code Here

                    m.texture = loadTexture(args[1], new File(args[1]));
                    break;
                }

                case "ambient:": {
                    m.ambient = new Color(Float.parseFloat(args[1]), Float.parseFloat(args[2]), Float.parseFloat(args[3]));
                    break;
                }

                case "diffuse:": {
                    m.diffuse = new Color(Float.parseFloat(args[1]), Float.parseFloat(args[2]), Float.parseFloat(args[3]));
                    break;
                }

                case "specular:": {
                    m.specular = new Color(Float.parseFloat(args[1]), Float.parseFloat(args[2]), Float.parseFloat(args[3]));
                    break;
                }
               
                case "emissive:": {
                    m.emissive = new Color(Float.parseFloat(args[1]), Float.parseFloat(args[2]), Float.parseFloat(args[3]));
                }
               
                case "shininess:": {
                    m.shininess = Float.parseFloat(args[1]);
                    break;
View Full Code Here

                }
                case "Ka": {
                    float red = Float.parseFloat(parts[1]);
                    float green = Float.parseFloat(parts[2]);
                    float blue = Float.parseFloat(parts[3]);
                    current.emissive = new Color(red, green, blue);
                    break;
                }
                case "Kd": {
                    float red = Float.parseFloat(parts[1]);
                    float green = Float.parseFloat(parts[2]);
                    float blue = Float.parseFloat(parts[3]);
                    current.diffuse = new Color(red, green, blue);
                    current.ambient = new Color(red, green, blue);
                    break;
                }
                case "Ks": {/*
                    float red = Float.parseFloat(parts[1]);
                    float green = Float.parseFloat(parts[2]);
View Full Code Here

       
        FloatBuffer color = BufferUtils.createFloatBuffer(16);
        glGetFloat(GL_COLOR_CLEAR_VALUE, color);
        //color.flip();
       
        color(new Color(color));
        glPolygonOffset(1f, 1f);
        triangles.render();
        glLineWidth(1.0f);
        glDisable(GL_POLYGON_OFFSET_FILL);
        glEnable(GL_POLYGON_OFFSET_LINE);
View Full Code Here

    }

    public static Color getPixelColor(Vector2 p) {
        FloatBuffer buff = BufferUtils.createFloatBuffer(3);
        glReadPixels((int)p.x, (int)p.y, 1, 1, GL_RGB, GL_FLOAT, buff);
        return new Color(buff.get(), buff.get(), buff.get());
    }
View Full Code Here

        this.shader = shader;
        this.material = material;
        this.min = min;
        this.max = max;

        Color c;
        do {
            c = Color.random(false);
        } while (blocks.containsKey(c));

        this.color = c;
View Full Code Here

        if (evt.button == 0 && evt.type) {
            EditorBlock.selectionMode = true;
            world.draw();
            FloatBuffer buff = BufferUtils.createFloatBuffer(3);
            GL11.glReadPixels(evt.x, evt.y, 1, 1, GL11.GL_RGB, GL11.GL_FLOAT, buff);
            Color c = new Color(buff.get(), buff.get(), buff.get());
            EditorBlock block = EditorBlock.select(c);
            if (block != null) {
                items.setSelectedValue((block), false);
            } else {
                items.setSelectedIndices(new int[0]);
View Full Code Here

    }

    public void drawGrid() {
        pen.setStroke(new BasicStroke(1));

        pen.setColor(new Color(0.5f, 0.5f, 0.5f).toAWT());
        int numx = (int) scaleToWorld(getWidth());
        int numy = (int) scaleToWorld(getHeight());

        for (int i = -numx / 2; i <= numx / 2; i++) {
            int x = centerX() + scaleToView(i);
View Full Code Here

TOP

Related Classes of aspect.util.Color

Copyright © 2018 www.massapicom. 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.