Class AxeColor
- java.lang.Object
-
- com.deque.axe.android.colorcontrast.AxeColor
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intblue()Return the blue component of a color int.intcompareTo(AxeColor o)doublecontrast(AxeColor otherColor)Calculate contrast between this color and another color.booleanequals(java.lang.Object other)intgreen()Return the green component of a color int.inthashCode()booleanisAlmostVisiblySameColor(AxeColor axeColor)Calculates if two colors are visibly same colors.intred()Return the red component of a color int.java.lang.StringtoHex()java.lang.StringtoString()
-
-
-
Method Detail
-
contrast
public double contrast(AxeColor otherColor)
Calculate contrast between this color and another color.
-
isAlmostVisiblySameColor
public boolean isAlmostVisiblySameColor(AxeColor axeColor)
Calculates if two colors are visibly same colors.- Parameters:
axeColor- the color to check against.- Returns:
- true if visibly same by 90 percent.
-
red
@IntRange(from=0L, to=255L) public int red()Return the red component of a color int. This is the same as saying (color > > 16) & 0xFF
-
green
@IntRange(from=0L, to=255L) public int green()Return the green component of a color int. This is the same as saying (color > > 8) & 0xFF
-
blue
@IntRange(from=0L, to=255L) public int blue()Return the blue component of a color int. This is the same as saying color & 0xFF
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
compareTo
public int compareTo(@NonNull AxeColor o)- Specified by:
compareToin interfacejava.lang.Comparable<AxeColor>
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
toHex
public java.lang.String toHex()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-