Package gwt.g2d.client.graphics

Examples of gwt.g2d.client.graphics.Color


    particles.clear();
    for (int i = 0; i < NUM_PARTICLES; i++) {
      particles.add(new Particle(
          new Vector2(Random.nextInt(WIDTH), Random.nextInt(HEIGHT)),
          new Vector2(Math.random(), Math.random()).normalize(),
          new Color(Random.nextInt(256),
              Random.nextInt(256),
              Random.nextInt(256),
              Math.random())));
    }
  }
View Full Code Here


    getPrimarySurface().setFillStyle(gradient)
   
        // Now let's draw a rectangle with a black shadow.
        .setShadowOffset(new Vector2(5, 5))
        .setShadowBlur(4)
        .setShadowColor(new Color(0, 0, 0, .5))
        .fillRectangle(5, 5, 200, 100)
       
        // For effect, let's also draw some text: "Hello world!".
        .setFont("bold 36px sans-serif")
        .setTextBaseline(TextBaseline.TOP)
View Full Code Here

    public final void draw(Surface surface, DirectShapeRenderer shapeRenderer) {
      int padding = 2;
      int fluff = 10;
      int size = 10;
      surface.setFillStyle(new Color(color[0], color[1], color[2], .5));
      for (int x = -padding; x <= padding; x++) {
        for (int y = -padding; y <= padding; y++) {
          shapeRenderer.beginPath()
              .drawCircle(pos.add(new Vector2(
                    x * getRandomInt(1, fluff),
View Full Code Here

       
        ImageDataAdapter imageData = getPrimarySurface()
            .getImageData(0, 0, image.getWidth(), image.getHeight());
        for (int r = 0; r < image.getWidth(); r++) {
          for (int c = 0; c < image.getHeight(); c++) {
            Color color = imageData.getColor(r, c);
            imageData.setColor(r, c, new Color(
                255 - color.getR(),
                255 - color.getG(),
                255 - color.getB()));
          }
        }
        getPrimarySurface().putImageData(imageData, image.getWidth(), 0);
      }
     
View Full Code Here

    surface.fillRectangle(0, 0, size, size)
        .setTransform(matrix.mutableTranslate(size / 2, size / 2))
        .clipShape(new CircleShape(0, 0, size / 2.0 * .8));

    Gradient gradient = new LinearGradient(0, -size / 2, 0, size / 2)
        .addColorStop(0, new Color(35, 34, 86))
        .addColorStop(1, new Color(20, 55, 120));
   
    surface.setFillStyle(gradient)
        .fillRectangle(-size / 2, -size / 2, size, size);

    // draw stars
View Full Code Here

  public void initialize() {
    add(new Label("Shadow is not supported under IE or Opera (Will be included in Opera 10.5)."));
    super.initialize();
    getPrimarySurface().setShadowOffset(new Vector2(5, 5))
        .setShadowBlur(4)
        .setShadowColor(new Color(255, 0, 0, .5))
        .setFillStyle(KnownColor.BLUE)
        .fillRectangle(20, 20, 150, 100);
  }
View Full Code Here

TOP

Related Classes of gwt.g2d.client.graphics.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.