Class AxeColor
java.lang.Object
com.deque.axe.android.colorcontrast.AxeColor
- All Implemented Interfaces:
Comparable<AxeColor>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintblue()Return the blue component of a color int.intdoubleCalculate contrast between this color and another color.booleanintgreen()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.toHex()toString()
-
Field Details
-
WHITE
-
BLACK
-
-
Constructor Details
-
AxeColor
public AxeColor(@IntRange(from=0L,to=255L) int alpha, @IntRange(from=0L,to=255L) int red, @IntRange(from=0L,to=255L) int green, @IntRange(from=0L,to=255L) int blue) -
AxeColor
-
AxeColor
public AxeColor(int colorInt)
-
-
Method Details
-
contrast
Calculate contrast between this color and another color. -
isAlmostVisiblySameColor
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() -
compareTo
- Specified by:
compareToin interfaceComparable<AxeColor>
-
equals
-
toHex
-
toString
-