Class DominantColorsAnnotation.Builder (2.1.4) 
  
      
     
  
  
  
   
  
    
  
  
    
    
    
  Version 2.1.4keyboard_arrow_down  
  
 
    
    
     
    
    
    
    
    
      
  
  
  
    
public   static   final   class  DominantColorsAnnotation . Builder   extends   GeneratedMessageV3 . Builder<DominantColorsAnnotation . Builder >  implements   DominantColorsAnnotationOrBuilder  
   
   Set of dominant colors and their corresponding scores.
 Protobuf type google.cloud.vision.v1p2beta1.DominantColorsAnnotation
 
  
  
  
  Static Methods
   
   
  getDescriptor() 
  
    
public   static   final   Descriptors . Descriptor   getDescriptor ()  
   
  Returns 
  
  Methods
   
   
  addAllColors(Iterable<? extends ColorInfo> values) 
  
    
public   DominantColorsAnnotation . Builder   addAllColors ( Iterable <?   extends   ColorInfo >  values )  
   
   RGB color values with their score and pixel fraction.
 repeated .google.cloud.vision.v1p2beta1.ColorInfo colors = 1;
 
  Parameter 
  
    
      
        Name  
        Description  
       
      
        values  
        Iterable <? extends com.google.cloud.vision.v1p2beta1.ColorInfo > 
       
     
  
  Returns 
  
   
  addColors(ColorInfo value) 
  
    
public   DominantColorsAnnotation . Builder   addColors ( ColorInfo   value )  
   
   RGB color values with their score and pixel fraction.
 repeated .google.cloud.vision.v1p2beta1.ColorInfo colors = 1;
 
  Parameter 
  
  Returns 
  
   
  addColors(ColorInfo.Builder builderForValue) 
  
    
public   DominantColorsAnnotation . Builder   addColors ( ColorInfo . Builder   builderForValue )  
   
   RGB color values with their score and pixel fraction.
 repeated .google.cloud.vision.v1p2beta1.ColorInfo colors = 1;
 
  Parameter 
  
  Returns 
  
   
  addColors(int index, ColorInfo value) 
  
    
public   DominantColorsAnnotation . Builder   addColors ( int   index ,   ColorInfo   value )  
   
   RGB color values with their score and pixel fraction.
 repeated .google.cloud.vision.v1p2beta1.ColorInfo colors = 1;
 
  Parameters 
  
  Returns 
  
   
  addColors(int index, ColorInfo.Builder builderForValue) 
  
    
public   DominantColorsAnnotation . Builder   addColors ( int   index ,   ColorInfo . Builder   builderForValue )  
   
   RGB color values with their score and pixel fraction.
 repeated .google.cloud.vision.v1p2beta1.ColorInfo colors = 1;
 
  Parameters 
  
  Returns 
  
   
  addColorsBuilder() 
  
    
public   ColorInfo . Builder   addColorsBuilder ()  
   
   RGB color values with their score and pixel fraction.
 repeated .google.cloud.vision.v1p2beta1.ColorInfo colors = 1;
 
  Returns 
  
   
  addColorsBuilder(int index) 
  
    
public   ColorInfo . Builder   addColorsBuilder ( int   index )  
   
   RGB color values with their score and pixel fraction.
 repeated .google.cloud.vision.v1p2beta1.ColorInfo colors = 1;
 
  Parameter 
  
    
      
        Name  
        Description  
       
      
        index  
        int  
       
     
  
  Returns 
  
   
  addRepeatedField(Descriptors.FieldDescriptor field, Object value) 
  
    
public   DominantColorsAnnotation . Builder   addRepeatedField ( Descriptors . FieldDescriptor   field ,   Object   value )  
   
  Parameters 
  
  Returns 
  
  Overrides 
  
   
  build() 
  
    
public   DominantColorsAnnotation   build ()  
   
  Returns 
  
   
  buildPartial() 
  
    
public   DominantColorsAnnotation   buildPartial ()  
   
  Returns 
  
   
  clear() 
  
    
public   DominantColorsAnnotation . Builder   clear ()  
   
  Returns 
  
  Overrides 
  
   
  clearColors() 
  
    
public   DominantColorsAnnotation . Builder   clearColors ()  
   
   RGB color values with their score and pixel fraction.
 repeated .google.cloud.vision.v1p2beta1.ColorInfo colors = 1;
 
  Returns 
  
   
  clearField(Descriptors.FieldDescriptor field) 
  
    
public   DominantColorsAnnotation . Builder   clearField ( Descriptors . FieldDescriptor   field )  
   
  Parameter 
  
  Returns 
  
  Overrides 
  
   
  clearOneof(Descriptors.OneofDescriptor oneof) 
  
    
public   DominantColorsAnnotation . Builder   clearOneof ( Descriptors . OneofDescriptor   oneof )  
   
  Parameter 
  
  Returns 
  
  Overrides 
  
   
  clone() 
  
    
public   DominantColorsAnnotation . Builder   clone ()  
   
  Returns 
  
  Overrides 
  
   
  getColors(int index) 
  
    
public   ColorInfo   getColors ( int   index )  
   
   RGB color values with their score and pixel fraction.
 repeated .google.cloud.vision.v1p2beta1.ColorInfo colors = 1;
 
  Parameter 
  
    
      
        Name  
        Description  
       
      
        index  
        int  
       
     
  
  Returns 
  
   
  getColorsBuilder(int index) 
  
    
public   ColorInfo . Builder   getColorsBuilder ( int   index )  
   
   RGB color values with their score and pixel fraction.
 repeated .google.cloud.vision.v1p2beta1.ColorInfo colors = 1;
 
  Parameter 
  
    
      
        Name  
        Description  
       
      
        index  
        int  
       
     
  
  Returns 
  
   
  getColorsBuilderList() 
  
    
public   List<ColorInfo . Builder >  getColorsBuilderList ()  
   
   RGB color values with their score and pixel fraction.
 repeated .google.cloud.vision.v1p2beta1.ColorInfo colors = 1;
 
  Returns 
  
   
  getColorsCount() 
  
    
public   int   getColorsCount ()  
   
   RGB color values with their score and pixel fraction.
 repeated .google.cloud.vision.v1p2beta1.ColorInfo colors = 1;
 
  Returns 
  
   
  getColorsList() 
  
    
public   List<ColorInfo>   getColorsList ()  
   
   RGB color values with their score and pixel fraction.
 repeated .google.cloud.vision.v1p2beta1.ColorInfo colors = 1;
 
  Returns 
  
   
  getColorsOrBuilder(int index) 
  
    
public   ColorInfoOrBuilder   getColorsOrBuilder ( int   index )  
   
   RGB color values with their score and pixel fraction.
 repeated .google.cloud.vision.v1p2beta1.ColorInfo colors = 1;
 
  Parameter 
  
    
      
        Name  
        Description  
       
      
        index  
        int  
       
     
  
  Returns 
  
   
  getColorsOrBuilderList() 
  
    
public   List <?   extends   ColorInfoOrBuilder >  getColorsOrBuilderList ()  
   
   RGB color values with their score and pixel fraction.
 repeated .google.cloud.vision.v1p2beta1.ColorInfo colors = 1;
 
  Returns 
  
    
      
        Type  
        Description  
       
      
        List <? extends com.google.cloud.vision.v1p2beta1.ColorInfoOrBuilder > 
         
       
     
  
   
  getDefaultInstanceForType() 
  
    
public   DominantColorsAnnotation   getDefaultInstanceForType ()  
   
  Returns 
  
   
  getDescriptorForType() 
  
    
public   Descriptors . Descriptor   getDescriptorForType ()  
   
  Returns 
  
  Overrides 
  
   
  internalGetFieldAccessorTable() 
  
    
protected   GeneratedMessageV3 . FieldAccessorTable   internalGetFieldAccessorTable ()  
   
  Returns 
  
  Overrides 
  
   
  isInitialized() 
  
    
public   final   boolean   isInitialized ()  
   
  Returns 
  
  Overrides 
  
   
  mergeFrom(DominantColorsAnnotation other) 
  
    
public   DominantColorsAnnotation . Builder   mergeFrom ( DominantColorsAnnotation   other )  
   
  Parameter 
  
  Returns 
  
   
  
  
    
public   DominantColorsAnnotation . Builder   mergeFrom ( CodedInputStream   input ,   ExtensionRegistryLite   extensionRegistry )  
   
  Parameters 
  
  Returns 
  
  Overrides 
  
  Exceptions 
  
   
  mergeFrom(Message other) 
  
    
public   DominantColorsAnnotation . Builder   mergeFrom ( Message   other )  
   
  Parameter 
  
  Returns 
  
  Overrides 
  
   
  mergeUnknownFields(UnknownFieldSet unknownFields) 
  
    
public   final   DominantColorsAnnotation . Builder   mergeUnknownFields ( UnknownFieldSet   unknownFields )  
   
  Parameter 
  
  Returns 
  
  Overrides 
  
   
  removeColors(int index) 
  
    
public   DominantColorsAnnotation . Builder   removeColors ( int   index )  
   
   RGB color values with their score and pixel fraction.
 repeated .google.cloud.vision.v1p2beta1.ColorInfo colors = 1;
 
  Parameter 
  
    
      
        Name  
        Description  
       
      
        index  
        int  
       
     
  
  Returns 
  
   
  setColors(int index, ColorInfo value) 
  
    
public   DominantColorsAnnotation . Builder   setColors ( int   index ,   ColorInfo   value )  
   
   RGB color values with their score and pixel fraction.
 repeated .google.cloud.vision.v1p2beta1.ColorInfo colors = 1;
 
  Parameters 
  
  Returns 
  
   
  setColors(int index, ColorInfo.Builder builderForValue) 
  
    
public   DominantColorsAnnotation . Builder   setColors ( int   index ,   ColorInfo . Builder   builderForValue )  
   
   RGB color values with their score and pixel fraction.
 repeated .google.cloud.vision.v1p2beta1.ColorInfo colors = 1;
 
  Parameters 
  
  Returns 
  
   
  setField(Descriptors.FieldDescriptor field, Object value) 
  
    
public   DominantColorsAnnotation . Builder   setField ( Descriptors . FieldDescriptor   field ,   Object   value )  
   
  Parameters 
  
  Returns 
  
  Overrides 
  
   
  setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value) 
  
    
public   DominantColorsAnnotation . Builder   setRepeatedField ( Descriptors . FieldDescriptor   field ,   int   index ,   Object   value )  
   
  Parameters 
  
  Returns 
  
  Overrides 
  
   
  setUnknownFields(UnknownFieldSet unknownFields) 
  
    
public   final   DominantColorsAnnotation . 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."],[],[]]