@Override public int hashCode() { // NB: this is the same as Objects.hashCode( getA(), getR(), getG(), getB() ) but faster, no boxing, no memory allocation int result = 31 + Double.hashCode( getA() ); result = 31 * result + Double.hashCode( getR() ); result = 31 * result + Double.hashCode( getG() ); result = 31 * result + Double.hashCode( getB() ); return result; } }
@Override public int hashCode() { // NB: this is the same as Objects.hashCode( getA(), getR(), getG(), getB() ) but faster, no boxing, no memory allocation int result = 31 + Double.hashCode( getA() ); result = 31 * result + Double.hashCode( getR() ); result = 31 * result + Double.hashCode( getG() ); result = 31 * result + Double.hashCode( getB() ); return result; } }
/** * Create and integer packed representation of this ARGB value. Crop */ public int toARGBInt() { final int a = ( int ) Math.max( 0, Math.min( 255, Util.round( getA() * 255 ) ) ); final int r = ( int ) Math.max( 0, Math.min( 255, Util.round( getR() * 255 ) ) ); final int g = ( int ) Math.max( 0, Math.min( 255, Util.round( getG() * 255 ) ) ); final int b = ( int ) Math.max( 0, Math.min( 255, Util.round( getB() * 255 ) ) ); return ( ( ( ( ( a << 8 ) | r ) << 8 ) | g ) << 8 ) | b; }
/** * Create and integer packed representation of this ARGB value. Crop */ public int toARGBInt() { final int a = ( int ) Math.max( 0, Math.min( 255, Util.round( getA() * 255 ) ) ); final int r = ( int ) Math.max( 0, Math.min( 255, Util.round( getR() * 255 ) ) ); final int g = ( int ) Math.max( 0, Math.min( 255, Util.round( getG() * 255 ) ) ); final int b = ( int ) Math.max( 0, Math.min( 255, Util.round( getB() * 255 ) ) ); return ( ( ( ( ( a << 8 ) | r ) << 8 ) | g ) << 8 ) | b; }
@Override public void mul( final double c ) { set( getA() * c, getR() * c, getG() * c, getB() * c ); }
@Override public void mul( final float c ) { set( getA() * c, getR() * c, getG() * c, getB() * c ); }
@Override public void set( final T c ) { set( c.getA(), c.getR(), c.getG(), c.getB() ); }
@Override public void set( final T c ) { set( c.getA(), c.getR(), c.getG(), c.getB() ); }
@Override public void mul( final double c ) { set( getA() * c, getR() * c, getG() * c, getB() * c ); }
@Override public void mul( final float c ) { set( getA() * c, getR() * c, getG() * c, getB() * c ); }