コード例 #1
0
 /**
  * Test is a color is darker than {@code this}
  *
  * @param other A color
  * @return {@code true} if {@code other} is darker than {@code this}, else {@code false}
  */
 public boolean isDarker(int other) {
   return getLuminance() < ColorUtils.calculateLuminance(other);
 }
コード例 #2
0
 /**
  * Test is a color is lighter than {@code this}
  *
  * @param other A color
  * @return {@code true} if {@code other} is lighter than {@code this}, else {@code false}
  */
 public boolean isLighter(int other) {
   return getLuminance() > ColorUtils.calculateLuminance(other);
 }
コード例 #3
0
 @Override
 public double getLuminance() {
   return ColorUtils.calculateLuminance(mColor);
 }