/** * <pre> * The fraction of this color that should be applied to the pixel. That is, * the final pixel color is defined by the equation: * pixel color = alpha * (this color) + (1.0 - alpha) * (background color) * This means that a value of 1.0 corresponds to a solid color, whereas * a value of 0.0 corresponds to a completely transparent color. This * uses a wrapper message rather than a simple float scalar so that it is * possible to distinguish between a default value and the value being unset. * If omitted, this color object is to be rendered as a solid color * (as if the alpha value had been explicitly given with a value of 1.0). * </pre> * * <code>.google.protobuf.FloatValue alpha = 4;</code> */ public com.google.protobuf.FloatValueOrBuilder getAlphaOrBuilder() { return getAlpha(); }
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (red_ != 0F) { output.writeFloat(1, red_); } if (green_ != 0F) { output.writeFloat(2, green_); } if (blue_ != 0F) { output.writeFloat(3, blue_); } if (alpha_ != null) { output.writeMessage(4, getAlpha()); } }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + RED_FIELD_NUMBER; hash = (53 * hash) + java.lang.Float.floatToIntBits( getRed()); hash = (37 * hash) + GREEN_FIELD_NUMBER; hash = (53 * hash) + java.lang.Float.floatToIntBits( getGreen()); hash = (37 * hash) + BLUE_FIELD_NUMBER; hash = (53 * hash) + java.lang.Float.floatToIntBits( getBlue()); if (hasAlpha()) { hash = (37 * hash) + ALPHA_FIELD_NUMBER; hash = (53 * hash) + getAlpha().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.type.Color)) { return super.equals(obj); } com.google.type.Color other = (com.google.type.Color) obj; boolean result = true; result = result && ( java.lang.Float.floatToIntBits(getRed()) == java.lang.Float.floatToIntBits( other.getRed())); result = result && ( java.lang.Float.floatToIntBits(getGreen()) == java.lang.Float.floatToIntBits( other.getGreen())); result = result && ( java.lang.Float.floatToIntBits(getBlue()) == java.lang.Float.floatToIntBits( other.getBlue())); result = result && (hasAlpha() == other.hasAlpha()); if (hasAlpha()) { result = result && getAlpha() .equals(other.getAlpha()); } return result; }
public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (red_ != 0F) { size += com.google.protobuf.CodedOutputStream .computeFloatSize(1, red_); } if (green_ != 0F) { size += com.google.protobuf.CodedOutputStream .computeFloatSize(2, green_); } if (blue_ != 0F) { size += com.google.protobuf.CodedOutputStream .computeFloatSize(3, blue_); } if (alpha_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(4, getAlpha()); } memoizedSize = size; return size; }
public Builder mergeFrom(com.google.type.Color other) { if (other == com.google.type.Color.getDefaultInstance()) return this; if (other.getRed() != 0F) { setRed(other.getRed()); } if (other.getGreen() != 0F) { setGreen(other.getGreen()); } if (other.getBlue() != 0F) { setBlue(other.getBlue()); } if (other.hasAlpha()) { mergeAlpha(other.getAlpha()); } onChanged(); return this; }