Class ColorInfo.Builder (2.0.29) 
  
      
     
  
  
  
   
  
    
  
  
    
    
    
  Version 2.0.29keyboard_arrow_down  
  
 
    
    
     
    
    
    
    
    
      
  
  
  
    
public   static   final   class  ColorInfo . Builder   extends   GeneratedMessageV3 . Builder<ColorInfo . Builder >  implements   ColorInfoOrBuilder  
   
   Color information consists of RGB channels, score, and the fraction of
 the image that the color occupies in the image.
 Protobuf type google.cloud.vision.v1p2beta1.ColorInfo
 
  
  
  
  Static Methods
   
   
  getDescriptor() 
  
    
public   static   final   Descriptors . Descriptor   getDescriptor ()  
   
  Returns 
  
  Methods
   
   
  addRepeatedField(Descriptors.FieldDescriptor field, Object value) 
  
    
public   ColorInfo . Builder   addRepeatedField ( Descriptors . FieldDescriptor   field ,   Object   value )  
   
  Parameters 
  
  Returns 
  
  Overrides 
  
   
  build() 
  
  Returns 
  
   
  buildPartial() 
  
    
public   ColorInfo   buildPartial ()  
   
  Returns 
  
   
  clear() 
  
    
public   ColorInfo . Builder   clear ()  
   
  Returns 
  
  Overrides 
  
   
  clearColor() 
  
    
public   ColorInfo . Builder   clearColor ()  
   
   RGB components of the color.
 .google.type.Color color = 1;
 
  Returns 
  
   
  clearField(Descriptors.FieldDescriptor field) 
  
    
public   ColorInfo . Builder   clearField ( Descriptors . FieldDescriptor   field )  
   
  Parameter 
  
  Returns 
  
  Overrides 
  
   
  clearOneof(Descriptors.OneofDescriptor oneof) 
  
    
public   ColorInfo . Builder   clearOneof ( Descriptors . OneofDescriptor   oneof )  
   
  Parameter 
  
  Returns 
  
  Overrides 
  
   
  clearPixelFraction() 
  
    
public   ColorInfo . Builder   clearPixelFraction ()  
   
   The fraction of pixels the color occupies in the image.
 Value in range [0, 1].
 float pixel_fraction = 3;
 
  Returns 
  
   
  clearScore() 
  
    
public   ColorInfo . Builder   clearScore ()  
   
   Image-specific score for this color. Value in range [0, 1].
 float score = 2;
 
  Returns 
  
   
  clone() 
  
    
public   ColorInfo . Builder   clone ()  
   
  Returns 
  
  Overrides 
  
   
  getColor() 
  
   RGB components of the color.
 .google.type.Color color = 1;
 
  Returns 
  
    
      
        Type  
        Description  
       
      
        com.google.type.Color  
        The color.
 
       
     
  
   
  getColorBuilder() 
  
    
public   Color . Builder   getColorBuilder ()  
   
   RGB components of the color.
 .google.type.Color color = 1;
 
  Returns 
  
    
      
        Type  
        Description  
       
      
        com.google.type.Color.Builder  
         
       
     
  
   
  getColorOrBuilder() 
  
    
public   ColorOrBuilder   getColorOrBuilder ()  
   
   RGB components of the color.
 .google.type.Color color = 1;
 
  Returns 
  
    
      
        Type  
        Description  
       
      
        com.google.type.ColorOrBuilder  
         
       
     
  
   
  getDefaultInstanceForType() 
  
    
public   ColorInfo   getDefaultInstanceForType ()  
   
  Returns 
  
   
  getDescriptorForType() 
  
    
public   Descriptors . Descriptor   getDescriptorForType ()  
   
  Returns 
  
  Overrides 
  
   
  getPixelFraction() 
  
    
public   float   getPixelFraction ()  
   
   The fraction of pixels the color occupies in the image.
 Value in range [0, 1].
 float pixel_fraction = 3;
 
  Returns 
  
    
      
        Type  
        Description  
       
      
        float  
        The pixelFraction.
 
       
     
  
   
  getScore() 
  
   Image-specific score for this color. Value in range [0, 1].
 float score = 2;
 
  Returns 
  
    
      
        Type  
        Description  
       
      
        float  
        The score.
 
       
     
  
   
  hasColor() 
  
    
public   boolean   hasColor ()  
   
   RGB components of the color.
 .google.type.Color color = 1;
 
  Returns 
  
    
      
        Type  
        Description  
       
      
        boolean  
        Whether the color field is set.
 
       
     
  
   
  internalGetFieldAccessorTable() 
  
    
protected   GeneratedMessageV3 . FieldAccessorTable   internalGetFieldAccessorTable ()  
   
  Returns 
  
  Overrides 
  
   
  isInitialized() 
  
    
public   final   boolean   isInitialized ()  
   
  Returns 
  
  Overrides 
  
   
  mergeColor(Color value) 
  
    
public   ColorInfo . Builder   mergeColor ( Color   value )  
   
   RGB components of the color.
 .google.type.Color color = 1;
 
  Parameter 
  
    
      
        Name  
        Description  
       
      
        value  
        com.google.type.Color  
       
     
  
  Returns 
  
   
  mergeFrom(ColorInfo other) 
  
    
public   ColorInfo . Builder   mergeFrom ( ColorInfo   other )  
   
  Parameter 
  
  Returns 
  
   
  
  
    
public   ColorInfo . Builder   mergeFrom ( CodedInputStream   input ,   ExtensionRegistryLite   extensionRegistry )  
   
  Parameters 
  
  Returns 
  
  Overrides 
  
  Exceptions 
  
   
  mergeFrom(Message other) 
  
    
public   ColorInfo . Builder   mergeFrom ( Message   other )  
   
  Parameter 
  
  Returns 
  
  Overrides 
  
   
  mergeUnknownFields(UnknownFieldSet unknownFields) 
  
    
public   final   ColorInfo . Builder   mergeUnknownFields ( UnknownFieldSet   unknownFields )  
   
  Parameter 
  
  Returns 
  
  Overrides 
  
   
  setColor(Color value) 
  
    
public   ColorInfo . Builder   setColor ( Color   value )  
   
   RGB components of the color.
 .google.type.Color color = 1;
 
  Parameter 
  
    
      
        Name  
        Description  
       
      
        value  
        com.google.type.Color  
       
     
  
  Returns 
  
   
  setColor(Color.Builder builderForValue) 
  
    
public   ColorInfo . Builder   setColor ( Color . Builder   builderForValue )  
   
   RGB components of the color.
 .google.type.Color color = 1;
 
  Parameter 
  
    
      
        Name  
        Description  
       
      
        builderForValue  
        com.google.type.Color.Builder  
       
     
  
  Returns 
  
   
  setField(Descriptors.FieldDescriptor field, Object value) 
  
    
public   ColorInfo . Builder   setField ( Descriptors . FieldDescriptor   field ,   Object   value )  
   
  Parameters 
  
  Returns 
  
  Overrides 
  
   
  setPixelFraction(float value) 
  
    
public   ColorInfo . Builder   setPixelFraction ( float   value )  
   
   The fraction of pixels the color occupies in the image.
 Value in range [0, 1].
 float pixel_fraction = 3;
 
  Parameter 
  
    
      
        Name  
        Description  
       
      
        value  
        float The pixelFraction to set.
 
       
     
  
  Returns 
  
   
  setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value) 
  
    
public   ColorInfo . Builder   setRepeatedField ( Descriptors . FieldDescriptor   field ,   int   index ,   Object   value )  
   
  Parameters 
  
  Returns 
  
  Overrides 
  
   
  setScore(float value) 
  
    
public   ColorInfo . Builder   setScore ( float   value )  
   
   Image-specific score for this color. Value in range [0, 1].
 float score = 2;
 
  Parameter 
  
    
      
        Name  
        Description  
       
      
        value  
        float The score to set.
 
       
     
  
  Returns 
  
   
  setUnknownFields(UnknownFieldSet unknownFields) 
  
    
public   final   ColorInfo . Builder   setUnknownFields ( UnknownFieldSet   unknownFields )  
   
  Parameter 
  
  Returns 
  
  Overrides 
  
 
     
    
  
  
  
     
  
 
  
    
    
      
       
    
    
  
  
 
  Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
  Last updated 2025-10-30 UTC.
 
 
  
  
  
    
      [[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-10-30 UTC."],[],[]]