Package com.myscript.iink.graphics
Class Color
- java.lang.Object
-
- com.myscript.iink.graphics.Color
-
public class Color extends java.lang.ObjectRed green blue alpha color representation.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description inta()Returns the alpha channel value.floata_f()Returns the normalised aslpha channel value.intb()Returns the blue channel value.floatb_f()Returns the normalised blue channel value.booleanequals(@Nullable java.lang.Object obj)intg()Returns the green channel value.floatg_f()Returns the normalised green channel value.inthashCode()intr()Returns the red channel value.floatr_f()Returns the normalised red channel value.@NotNull java.lang.StringtoString()
-
-
-
Constructor Detail
-
Color
public Color(@NotNull @NotNull Color other)Copy constructor.- Parameters:
other- copied object.
-
Color
public Color(int rgba)
Constructor.- Parameters:
rgba- the color value packed as 32bit.
-
Color
public Color(int r, int g, int b, int a)Constructor.- Parameters:
r- the red channel value (= 0..255).g- the green channel value (= 0..255).b- the blue channel value (= 0..255).a- the alpha channel value (= 0..255).
-
Color
public Color(int r, int g, int b, float a)Constructor.- Parameters:
r- the red channel value (= 0..255).g- the green channel value (= 0..255).b- the blue channel value (= 0..255).a- the alpha channel value (= 0..1).
-
-
Method Detail
-
r
public final int r()
Returns the red channel value.- Returns:
- the red channel value.
-
g
public final int g()
Returns the green channel value.- Returns:
- the green channel value.
-
b
public final int b()
Returns the blue channel value.- Returns:
- the blue channel value.
-
a
public final int a()
Returns the alpha channel value.- Returns:
- the alpha channel value.
-
r_f
public final float r_f()
Returns the normalised red channel value.- Returns:
- the ref channel value.
-
g_f
public final float g_f()
Returns the normalised green channel value.- Returns:
- the green channel value.
-
b_f
public final float b_f()
Returns the normalised blue channel value.- Returns:
- the blue channel value.
-
a_f
public final float a_f()
Returns the normalised aslpha channel value.- Returns:
- the alpha channel value.
-
equals
public boolean equals(@Nullable @Nullable java.lang.Object obj)- Overrides:
equalsin classjava.lang.Object
-
hashCode
public final int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
@NotNull public final @NotNull java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-