Package com.myscript.iink.graphics
Class Color
- java.lang.Object
-
- com.myscript.iink.graphics.Color
-
public class Color extends java.lang.Object
Red green blue alpha color representation.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
a()
Returns the alpha channel value.float
a_f()
Returns the normalised aslpha channel value.int
b()
Returns the blue channel value.float
b_f()
Returns the normalised blue channel value.boolean
equals(@Nullable java.lang.Object obj)
int
g()
Returns the green channel value.float
g_f()
Returns the normalised green channel value.int
hashCode()
int
r()
Returns the red channel value.float
r_f()
Returns the normalised red channel value.@NotNull java.lang.String
toString()
-
-
-
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:
equals
in classjava.lang.Object
-
hashCode
public final int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
@NotNull public final @NotNull java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-