/apidemos-15/apidemos-15-app/src/main/java/com/example/android/apis/graphics/kube/GLColor.java

https://github.com/gentooist/maven-android-plugin-samples · Java · 48 lines · 27 code · 6 blank · 15 comment · 7 complexity · a7ebf6f56ba9bc363159546351b0472e MD5 · raw file

  1. /*
  2. * Copyright (C) 2008 The Android Open Source Project
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. package com.example.android.apis.graphics.kube;
  17. public class GLColor {
  18. public final int red;
  19. public final int green;
  20. public final int blue;
  21. public final int alpha;
  22. public GLColor(int red, int green, int blue, int alpha) {
  23. this.red = red;
  24. this.green = green;
  25. this.blue = blue;
  26. this.alpha = alpha;
  27. }
  28. public GLColor(int red, int green, int blue) {
  29. this.red = red;
  30. this.green = green;
  31. this.blue = blue;
  32. this.alpha = 0x10000;
  33. }
  34. public boolean equals(Object other) {
  35. if (other instanceof GLColor) {
  36. GLColor color = (GLColor)other;
  37. return (red == color.red && green == color.green &&
  38. blue == color.blue && alpha == color.alpha);
  39. }
  40. return false;
  41. }
  42. }