Android Open Source - jmini3d Color4






From Project

Back to project page jmini3d.

License

The source code is released under:

Copyright 2012 Mobialia http://www.mobialia.com/ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to ...

If you think the Android project jmini3d listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package jmini3d;
/*from  w ww. ja  v a  2 s.c  om*/
public class Color4 {

  public float r;
  public float g;
  public float b;
  public float a;

  public static Color4 fromFloat(float r, float g, float b, float a) {
    Color4 color4 = new Color4();
    color4.r = r;
    color4.g = g;
    color4.b = b;
    color4.a = a;
    return color4;
  }

  public Color4() {
  }

  public Color4(int r, int g, int b) {
    this.r = r / 255f;
    this.g = g / 255f;
    this.b = b / 255f;
    this.a = 1;
  }

  public Color4(int r, int g, int b, int a) {
    this.r = r / 255f;
    this.g = g / 255f;
    this.b = b / 255f;
    this.a = a / 255f;
  }

  public void setAll(long argb32) {
    a = ((argb32 >> 24) & 0x000000FF) / 255f;
    r = ((argb32 >> 16) & 0x000000FF) / 255f;
    g = ((argb32 >> 8) & 0x000000FF) / 255f;
    b = ((argb32) & 0x000000FF) / 255f;
  }

  public void setAll(int r, int g, int b, int a) {
    this.r = r / 255f;
    this.g = g / 255f;
    this.b = b / 255f;
    this.a = a / 255f;
  }

  public void setAllFrom(Color4 color) {
    this.r = color.r;
    this.g = color.g;
    this.b = color.b;
    this.a = color.a;
  }

  public boolean equals(Object o) {
    if (o == null) {
      return false;
    }
    if (!(o instanceof Color4)) {
      return false;
    }
    return (r == ((Color4) o).r) && (g == ((Color4) o).g) && (b == ((Color4) o).b) && (a == ((Color4) o).a);
  }
}




Java Source Code List

cocoonjs.CocoonJsLinker.java
jmini3d.Blending.java
jmini3d.Camera.java
jmini3d.Color4.java
jmini3d.CubeMapTexture.java
jmini3d.Font.java
jmini3d.GpuObjectStatus.java
jmini3d.MatrixUtils.java
jmini3d.Object3d.java
jmini3d.Rect.java
jmini3d.SceneController.java
jmini3d.Scene.java
jmini3d.Texture.java
jmini3d.Utils.java
jmini3d.Vector3.java
jmini3d.android.Activity3d.java
jmini3d.android.GeometryBuffers.java
jmini3d.android.GlSurfaceView3d.java
jmini3d.android.GpuUploader.java
jmini3d.android.Program.java
jmini3d.android.Renderer3d.java
jmini3d.android.ResourceLoader.java
jmini3d.android.compat.CompatibilityWrapper5.java
jmini3d.android.demo.DemoActivity.java
jmini3d.android.input.InputController.java
jmini3d.demo.ArialFont.java
jmini3d.demo.CubeScene.java
jmini3d.demo.CubesScene.java
jmini3d.demo.DemoSceneController.java
jmini3d.demo.EnvMapCubeScene.java
jmini3d.demo.NormalMapScene.java
jmini3d.demo.ParentScene.java
jmini3d.demo.TeapotGeometry.java
jmini3d.demo.TeapotScene.java
jmini3d.geometry.BoxGeometry.java
jmini3d.geometry.Geometry.java
jmini3d.geometry.PlaneGeometry.java
jmini3d.geometry.SkyboxGeometry.java
jmini3d.geometry.SpriteGeometry.java
jmini3d.geometry.VariableGeometry.java
jmini3d.gwt.Canvas3d.java
jmini3d.gwt.EngineResources.java
jmini3d.gwt.EntryPoint3d.java
jmini3d.gwt.GeometryBuffers.java
jmini3d.gwt.GpuUploader.java
jmini3d.gwt.MyInt16Array.java
jmini3d.gwt.Program.java
jmini3d.gwt.Renderer3d.java
jmini3d.gwt.ResourceLoader.java
jmini3d.gwt.TextureLoadedListener.java
jmini3d.gwt.demo.DemoEntryPoint.java
jmini3d.gwt.input.InputController.java
jmini3d.input.KeyListener.java
jmini3d.input.TouchListener.java
jmini3d.input.TouchPointer.java
jmini3d.light.AmbientLight.java
jmini3d.light.DirectionalLight.java
jmini3d.light.Light.java
jmini3d.light.PointLight.java
jmini3d.material.Material.java
jmini3d.material.PhongMaterial.java
jmini3d.material.SpriteMaterial.java
jmini3d.utils.Fnt2Class.java
jmini3d.utils.Obj2Class.java