chore: Update discovery artifacts (#1291)

* chore: update docs/dyn/index.md
* chore(abusiveexperiencereport): update the api
* chore(acceleratedmobilepageurl): update the api
* chore(accessapproval): update the api
* chore(accesscontextmanager): update the api
* chore(adexchangebuyer2): update the api
* chore(adexperiencereport): update the api
* chore(admob): update the api
* chore(analytics): update the api
* chore(analyticsreporting): update the api
* chore(androiddeviceprovisioning): update the api
* chore(androidenterprise): update the api
* chore(androidpublisher): update the api
* chore(apigateway): update the api
* chore(artifactregistry): update the api
* chore(bigqueryconnection): update the api
* chore(bigquerydatatransfer): update the api
* chore(billingbudgets): update the api
* chore(binaryauthorization): update the api
* chore(blogger): update the api
* chore(books): update the api
* chore(calendar): update the api
* chore(chat): update the api
* chore(chromeuxreport): update the api
* chore(civicinfo): update the api
* chore(classroom): update the api
* chore(cloudbilling): update the api
* chore(cloudbuild): update the api
* chore(clouddebugger): update the api
* chore(clouderrorreporting): update the api
* chore(cloudfunctions): update the api
* chore(cloudidentity): update the api
* chore(cloudiot): update the api
* chore(cloudkms): update the api
* chore(cloudprofiler): update the api
* chore(cloudresourcemanager): update the api
* chore(cloudscheduler): update the api
* chore(cloudshell): update the api
* chore(cloudtasks): update the api
* chore(cloudtrace): update the api
* chore(composer): update the api
* chore(containeranalysis): update the api
* chore(content): update the api
* chore(customsearch): update the api
* chore(datacatalog): update the api
* chore(datafusion): update the api
* chore(datamigration): update the api
* chore(datastore): update the api
* chore(deploymentmanager): update the api
* chore(digitalassetlinks): update the api
* chore(displayvideo): update the api
* chore(dlp): update the api
* chore(dns): update the api
* chore(docs): update the api
* chore(domains): update the api
* chore(domainsrdap): update the api
* chore(doubleclickbidmanager): update the api
* chore(doubleclicksearch): update the api
* chore(drive): update the api
* chore(driveactivity): update the api
* chore(eventarc): update the api
* chore(factchecktools): update the api
* chore(fcm): update the api
* chore(file): update the api
* chore(firebase): update the api
* chore(firebasedatabase): update the api
* chore(firebasedynamiclinks): update the api
* chore(firebasehosting): update the api
* chore(firebaseml): update the api
* chore(firebaserules): update the api
* chore(firestore): update the api
* chore(fitness): update the api
* chore(gamesConfiguration): update the api
* chore(gamesManagement): update the api
* chore(gameservices): update the api
* chore(genomics): update the api
* chore(gmail): update the api
* chore(gmailpostmastertools): update the api
* chore(groupsmigration): update the api
* chore(groupssettings): update the api
* chore(healthcare): update the api
* chore(iam): update the api
* chore(iamcredentials): update the api
* chore(iap): update the api
* chore(identitytoolkit): update the api
* chore(indexing): update the api
* chore(jobs): update the api
* chore(kgsearch): update the api
* chore(language): update the api
* chore(libraryagent): update the api
* chore(licensing): update the api
* chore(lifesciences): update the api
* chore(logging): update the api
* chore(managedidentities): update the api
* chore(manufacturers): update the api
* chore(memcache): update the api
* chore(ml): update the api
* chore(monitoring): update the api
* chore(networkmanagement): update the api
* chore(osconfig): update the api
* chore(pagespeedonline): update the api
* chore(playablelocations): update the api
* chore(playcustomapp): update the api
* chore(policytroubleshooter): update the api
* chore(poly): update the api
* chore(privateca): update the api
* chore(prod_tt_sasportal): update the api
* chore(pubsub): update the api
* chore(pubsublite): update the api
* chore(realtimebidding): update the api
* chore(recommendationengine): update the api
* chore(recommender): update the api
* chore(redis): update the api
* chore(remotebuildexecution): update the api
* chore(reseller): update the api
* chore(runtimeconfig): update the api
* chore(safebrowsing): update the api
* chore(sasportal): update the api
* chore(script): update the api
* chore(searchconsole): update the api
* chore(secretmanager): update the api
* chore(servicecontrol): update the api
* chore(servicedirectory): update the api
* chore(siteVerification): update the api
* chore(slides): update the api
* chore(smartdevicemanagement): update the api
* chore(sourcerepo): update the api
* chore(sqladmin): update the api
* chore(storage): update the api
* chore(storagetransfer): update the api
* chore(streetviewpublish): update the api
* chore(sts): update the api
* chore(tagmanager): update the api
* chore(tasks): update the api
* chore(testing): update the api
* chore(texttospeech): update the api
* chore(toolresults): update the api
* chore(trafficdirector): update the api
* chore(transcoder): update the api
* chore(translate): update the api
* chore(vault): update the api
* chore(vectortile): update the api
* chore(verifiedaccess): update the api
* chore(videointelligence): update the api
* chore(vision): update the api
* chore(webfonts): update the api
* chore(webmasters): update the api
* chore(websecurityscanner): update the api
* chore(workflowexecutions): update the api
* chore(workflows): update the api
* chore(youtubeAnalytics): update the api
* chore(youtubereporting): update the api
* chore(docs): Add new discovery artifacts and reference documents
diff --git a/docs/dyn/documentai_v1beta2.projects.documents.html b/docs/dyn/documentai_v1beta2.projects.documents.html
index 1fbbdef..b621158 100644
--- a/docs/dyn/documentai_v1beta2.projects.documents.html
+++ b/docs/dyn/documentai_v1beta2.projects.documents.html
@@ -147,13 +147,13 @@
               "normalizedVertices": [ # The bounding polygon normalized vertices.
                 { # A vertex represents a 2D point in the image. NOTE: the normalized vertex coordinates are relative to the original image and range from 0 to 1.
                   "x": 3.14, # X coordinate.
-                  "y": 3.14, # Y coordinate.
+                  "y": 3.14, # Y coordinate (starts from the top of the image).
                 },
               ],
               "vertices": [ # The bounding polygon vertices.
                 { # A vertex represents a 2D point in the image. NOTE: the vertex coordinates are in the same scale as the original image.
                   "x": 42, # X coordinate.
-                  "y": 42, # Y coordinate.
+                  "y": 42, # Y coordinate (starts from the top of the image).
                 },
               ],
             },
@@ -260,13 +260,13 @@
           "normalizedVertices": [ # The bounding polygon normalized vertices.
             { # A vertex represents a 2D point in the image. NOTE: the normalized vertex coordinates are relative to the original image and range from 0 to 1.
               "x": 3.14, # X coordinate.
-              "y": 3.14, # Y coordinate.
+              "y": 3.14, # Y coordinate (starts from the top of the image).
             },
           ],
           "vertices": [ # The bounding polygon vertices.
             { # A vertex represents a 2D point in the image. NOTE: the vertex coordinates are in the same scale as the original image.
               "x": 42, # X coordinate.
-              "y": 42, # Y coordinate.
+              "y": 42, # Y coordinate (starts from the top of the image).
             },
           ],
         },
@@ -344,13 +344,13 @@
               "normalizedVertices": [ # The bounding polygon normalized vertices.
                 { # A vertex represents a 2D point in the image. NOTE: the normalized vertex coordinates are relative to the original image and range from 0 to 1.
                   "x": 3.14, # X coordinate.
-                  "y": 3.14, # Y coordinate.
+                  "y": 3.14, # Y coordinate (starts from the top of the image).
                 },
               ],
               "vertices": [ # The bounding polygon vertices.
                 { # A vertex represents a 2D point in the image. NOTE: the vertex coordinates are in the same scale as the original image.
                   "x": 42, # X coordinate.
-                  "y": 42, # Y coordinate.
+                  "y": 42, # Y coordinate (starts from the top of the image).
                 },
               ],
             },
@@ -426,13 +426,13 @@
               "normalizedVertices": [ # The bounding polygon normalized vertices.
                 { # A vertex represents a 2D point in the image. NOTE: the normalized vertex coordinates are relative to the original image and range from 0 to 1.
                   "x": 3.14, # X coordinate.
-                  "y": 3.14, # Y coordinate.
+                  "y": 3.14, # Y coordinate (starts from the top of the image).
                 },
               ],
               "vertices": [ # The bounding polygon vertices.
                 { # A vertex represents a 2D point in the image. NOTE: the vertex coordinates are in the same scale as the original image.
                   "x": 42, # X coordinate.
-                  "y": 42, # Y coordinate.
+                  "y": 42, # Y coordinate (starts from the top of the image).
                 },
               ],
             },
@@ -479,13 +479,13 @@
               "normalizedVertices": [ # The bounding polygon normalized vertices.
                 { # A vertex represents a 2D point in the image. NOTE: the normalized vertex coordinates are relative to the original image and range from 0 to 1.
                   "x": 3.14, # X coordinate.
-                  "y": 3.14, # Y coordinate.
+                  "y": 3.14, # Y coordinate (starts from the top of the image).
                 },
               ],
               "vertices": [ # The bounding polygon vertices.
                 { # A vertex represents a 2D point in the image. NOTE: the vertex coordinates are in the same scale as the original image.
                   "x": 42, # X coordinate.
-                  "y": 42, # Y coordinate.
+                  "y": 42, # Y coordinate (starts from the top of the image).
                 },
               ],
             },
@@ -506,13 +506,13 @@
               "normalizedVertices": [ # The bounding polygon normalized vertices.
                 { # A vertex represents a 2D point in the image. NOTE: the normalized vertex coordinates are relative to the original image and range from 0 to 1.
                   "x": 3.14, # X coordinate.
-                  "y": 3.14, # Y coordinate.
+                  "y": 3.14, # Y coordinate (starts from the top of the image).
                 },
               ],
               "vertices": [ # The bounding polygon vertices.
                 { # A vertex represents a 2D point in the image. NOTE: the vertex coordinates are in the same scale as the original image.
                   "x": 42, # X coordinate.
-                  "y": 42, # Y coordinate.
+                  "y": 42, # Y coordinate (starts from the top of the image).
                 },
               ],
             },
@@ -554,13 +554,13 @@
           "normalizedVertices": [ # The bounding polygon normalized vertices.
             { # A vertex represents a 2D point in the image. NOTE: the normalized vertex coordinates are relative to the original image and range from 0 to 1.
               "x": 3.14, # X coordinate.
-              "y": 3.14, # Y coordinate.
+              "y": 3.14, # Y coordinate (starts from the top of the image).
             },
           ],
           "vertices": [ # The bounding polygon vertices.
             { # A vertex represents a 2D point in the image. NOTE: the vertex coordinates are in the same scale as the original image.
               "x": 42, # X coordinate.
-              "y": 42, # Y coordinate.
+              "y": 42, # Y coordinate (starts from the top of the image).
             },
           ],
         },
@@ -589,13 +589,13 @@
               "normalizedVertices": [ # The bounding polygon normalized vertices.
                 { # A vertex represents a 2D point in the image. NOTE: the normalized vertex coordinates are relative to the original image and range from 0 to 1.
                   "x": 3.14, # X coordinate.
-                  "y": 3.14, # Y coordinate.
+                  "y": 3.14, # Y coordinate (starts from the top of the image).
                 },
               ],
               "vertices": [ # The bounding polygon vertices.
                 { # A vertex represents a 2D point in the image. NOTE: the vertex coordinates are in the same scale as the original image.
                   "x": 42, # X coordinate.
-                  "y": 42, # Y coordinate.
+                  "y": 42, # Y coordinate (starts from the top of the image).
                 },
               ],
             },
@@ -638,13 +638,13 @@
               "normalizedVertices": [ # The bounding polygon normalized vertices.
                 { # A vertex represents a 2D point in the image. NOTE: the normalized vertex coordinates are relative to the original image and range from 0 to 1.
                   "x": 3.14, # X coordinate.
-                  "y": 3.14, # Y coordinate.
+                  "y": 3.14, # Y coordinate (starts from the top of the image).
                 },
               ],
               "vertices": [ # The bounding polygon vertices.
                 { # A vertex represents a 2D point in the image. NOTE: the vertex coordinates are in the same scale as the original image.
                   "x": 42, # X coordinate.
-                  "y": 42, # Y coordinate.
+                  "y": 42, # Y coordinate (starts from the top of the image).
                 },
               ],
             },
@@ -691,13 +691,13 @@
                       "normalizedVertices": [ # The bounding polygon normalized vertices.
                         { # A vertex represents a 2D point in the image. NOTE: the normalized vertex coordinates are relative to the original image and range from 0 to 1.
                           "x": 3.14, # X coordinate.
-                          "y": 3.14, # Y coordinate.
+                          "y": 3.14, # Y coordinate (starts from the top of the image).
                         },
                       ],
                       "vertices": [ # The bounding polygon vertices.
                         { # A vertex represents a 2D point in the image. NOTE: the vertex coordinates are in the same scale as the original image.
                           "x": 42, # X coordinate.
-                          "y": 42, # Y coordinate.
+                          "y": 42, # Y coordinate (starts from the top of the image).
                         },
                       ],
                     },
@@ -740,13 +740,13 @@
                       "normalizedVertices": [ # The bounding polygon normalized vertices.
                         { # A vertex represents a 2D point in the image. NOTE: the normalized vertex coordinates are relative to the original image and range from 0 to 1.
                           "x": 3.14, # X coordinate.
-                          "y": 3.14, # Y coordinate.
+                          "y": 3.14, # Y coordinate (starts from the top of the image).
                         },
                       ],
                       "vertices": [ # The bounding polygon vertices.
                         { # A vertex represents a 2D point in the image. NOTE: the vertex coordinates are in the same scale as the original image.
                           "x": 42, # X coordinate.
-                          "y": 42, # Y coordinate.
+                          "y": 42, # Y coordinate (starts from the top of the image).
                         },
                       ],
                     },
@@ -772,13 +772,13 @@
               "normalizedVertices": [ # The bounding polygon normalized vertices.
                 { # A vertex represents a 2D point in the image. NOTE: the normalized vertex coordinates are relative to the original image and range from 0 to 1.
                   "x": 3.14, # X coordinate.
-                  "y": 3.14, # Y coordinate.
+                  "y": 3.14, # Y coordinate (starts from the top of the image).
                 },
               ],
               "vertices": [ # The bounding polygon vertices.
                 { # A vertex represents a 2D point in the image. NOTE: the vertex coordinates are in the same scale as the original image.
                   "x": 42, # X coordinate.
-                  "y": 42, # Y coordinate.
+                  "y": 42, # Y coordinate (starts from the top of the image).
                 },
               ],
             },
@@ -812,13 +812,13 @@
               "normalizedVertices": [ # The bounding polygon normalized vertices.
                 { # A vertex represents a 2D point in the image. NOTE: the normalized vertex coordinates are relative to the original image and range from 0 to 1.
                   "x": 3.14, # X coordinate.
-                  "y": 3.14, # Y coordinate.
+                  "y": 3.14, # Y coordinate (starts from the top of the image).
                 },
               ],
               "vertices": [ # The bounding polygon vertices.
                 { # A vertex represents a 2D point in the image. NOTE: the vertex coordinates are in the same scale as the original image.
                   "x": 42, # X coordinate.
-                  "y": 42, # Y coordinate.
+                  "y": 42, # Y coordinate (starts from the top of the image).
                 },
               ],
             },
@@ -868,13 +868,13 @@
               "normalizedVertices": [ # The bounding polygon normalized vertices.
                 { # A vertex represents a 2D point in the image. NOTE: the normalized vertex coordinates are relative to the original image and range from 0 to 1.
                   "x": 3.14, # X coordinate.
-                  "y": 3.14, # Y coordinate.
+                  "y": 3.14, # Y coordinate (starts from the top of the image).
                 },
               ],
               "vertices": [ # The bounding polygon vertices.
                 { # A vertex represents a 2D point in the image. NOTE: the vertex coordinates are in the same scale as the original image.
                   "x": 42, # X coordinate.
-                  "y": 42, # Y coordinate.
+                  "y": 42, # Y coordinate (starts from the top of the image).
                 },
               ],
             },
@@ -945,14 +945,14 @@
   ],
   "textStyles": [ # Styles for the Document.text.
     { # Annotation for common text style attributes. This adheres to CSS conventions as much as possible.
-      "backgroundColor": { # Represents a color in the RGBA color space. This representation is designed for simplicity of conversion to/from color representations in various languages over compactness; for example, the fields of this representation can be trivially provided to the constructor of "java.awt.Color" in Java; it can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha" method in iOS; and, with just a little work, it can be easily formatted into a CSS "rgba()" string in JavaScript, as well. Note: this proto does not carry information about the absolute color space that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB, DCI-P3, BT.2020, etc.). By default, applications SHOULD assume the sRGB color space. Note: when color equality needs to be decided, implementations, unless documented otherwise, will treat two colors to be equal if all their red, green, blue and alpha values each differ by at most 1e-5. Example (Java): import com.google.type.Color; // ... public static java.awt.Color fromProto(Color protocolor) { float alpha = protocolor.hasAlpha() ? protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( protocolor.getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); } public static Color toProto(java.awt.Color color) { float red = (float) color.getRed(); float green = (float) color.getGreen(); float blue = (float) color.getBlue(); float denominator = 255.0; Color.Builder resultBuilder = Color .newBuilder() .setRed(red / denominator) .setGreen(green / denominator) .setBlue(blue / denominator); int alpha = color.getAlpha(); if (alpha != 255) { result.setAlpha( FloatValue .newBuilder() .setValue(((float) alpha) / denominator) .build()); } return resultBuilder.build(); } // ... Example (iOS / Obj-C): // ... static UIColor* fromProto(Color* protocolor) { float red = [protocolor red]; float green = [protocolor green]; float blue = [protocolor blue]; FloatValue* alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper != nil) { alpha = [alpha_wrapper value]; } return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; } static Color* toProto(UIColor* color) { CGFloat red, green, blue, alpha; if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) { return nil; } Color* result = [[Color alloc] init]; [result setRed:red]; [result setGreen:green]; [result setBlue:blue]; if (alpha <= 0.9999) { [result setAlpha:floatWrapperWithValue(alpha)]; } [result autorelease]; return result; } // ... Example (JavaScript): // ... var protoToCssColor = function(rgb_color) { var redFrac = rgb_color.red || 0.0; var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue || 0.0; var red = Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255); var blue = Math.floor(blueFrac * 255); if (!('alpha' in rgb_color)) { return rgbToCssColor_(red, green, blue); } var alphaFrac = rgb_color.alpha.value || 0.0; var rgbParams = [red, green, blue].join(','); return ['rgba(', rgbParams, ',', alphaFrac, ')'].join(''); }; var rgbToCssColor_ = function(red, green, blue) { var rgbNumber = new Number((red << 16) | (green << 8) | blue); var hexString = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var resultBuilder = ['#']; for (var i = 0; i < missingZeros; i++) { resultBuilder.push('0'); } resultBuilder.push(hexString); return resultBuilder.join(''); }; // ... # Text background color.
-        "alpha": 3.14, # 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).
+      "backgroundColor": { # Represents a color in the RGBA color space. This representation is designed for simplicity of conversion to/from color representations in various languages over compactness. For example, the fields of this representation can be trivially provided to the constructor of `java.awt.Color` in Java; it can also be trivially provided to UIColor's `+colorWithRed:green:blue:alpha` method in iOS; and, with just a little work, it can be easily formatted into a CSS `rgba()` string in JavaScript. This reference page doesn't carry information about the absolute color space that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB, DCI-P3, BT.2020, etc.). By default, applications should assume the sRGB color space. When color equality needs to be decided, implementations, unless documented otherwise, treat two colors as equal if all their red, green, blue, and alpha values each differ by at most 1e-5. Example (Java): import com.google.type.Color; // ... public static java.awt.Color fromProto(Color protocolor) { float alpha = protocolor.hasAlpha() ? protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( protocolor.getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); } public static Color toProto(java.awt.Color color) { float red = (float) color.getRed(); float green = (float) color.getGreen(); float blue = (float) color.getBlue(); float denominator = 255.0; Color.Builder resultBuilder = Color .newBuilder() .setRed(red / denominator) .setGreen(green / denominator) .setBlue(blue / denominator); int alpha = color.getAlpha(); if (alpha != 255) { result.setAlpha( FloatValue .newBuilder() .setValue(((float) alpha) / denominator) .build()); } return resultBuilder.build(); } // ... Example (iOS / Obj-C): // ... static UIColor* fromProto(Color* protocolor) { float red = [protocolor red]; float green = [protocolor green]; float blue = [protocolor blue]; FloatValue* alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper != nil) { alpha = [alpha_wrapper value]; } return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; } static Color* toProto(UIColor* color) { CGFloat red, green, blue, alpha; if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) { return nil; } Color* result = [[Color alloc] init]; [result setRed:red]; [result setGreen:green]; [result setBlue:blue]; if (alpha <= 0.9999) { [result setAlpha:floatWrapperWithValue(alpha)]; } [result autorelease]; return result; } // ... Example (JavaScript): // ... var protoToCssColor = function(rgb_color) { var redFrac = rgb_color.red || 0.0; var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue || 0.0; var red = Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255); var blue = Math.floor(blueFrac * 255); if (!('alpha' in rgb_color)) { return rgbToCssColor(red, green, blue); } var alphaFrac = rgb_color.alpha.value || 0.0; var rgbParams = [red, green, blue].join(','); return ['rgba(', rgbParams, ',', alphaFrac, ')'].join(''); }; var rgbToCssColor = function(red, green, blue) { var rgbNumber = new Number((red << 16) | (green << 8) | blue); var hexString = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var resultBuilder = ['#']; for (var i = 0; i < missingZeros; i++) { resultBuilder.push('0'); } resultBuilder.push(hexString); return resultBuilder.join(''); }; // ... # Text background color.
+        "alpha": 3.14, # 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 rendered as a solid color (as if the alpha value had been explicitly given a value of 1.0).
         "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
         "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
         "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
       },
-      "color": { # Represents a color in the RGBA color space. This representation is designed for simplicity of conversion to/from color representations in various languages over compactness; for example, the fields of this representation can be trivially provided to the constructor of "java.awt.Color" in Java; it can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha" method in iOS; and, with just a little work, it can be easily formatted into a CSS "rgba()" string in JavaScript, as well. Note: this proto does not carry information about the absolute color space that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB, DCI-P3, BT.2020, etc.). By default, applications SHOULD assume the sRGB color space. Note: when color equality needs to be decided, implementations, unless documented otherwise, will treat two colors to be equal if all their red, green, blue and alpha values each differ by at most 1e-5. Example (Java): import com.google.type.Color; // ... public static java.awt.Color fromProto(Color protocolor) { float alpha = protocolor.hasAlpha() ? protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( protocolor.getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); } public static Color toProto(java.awt.Color color) { float red = (float) color.getRed(); float green = (float) color.getGreen(); float blue = (float) color.getBlue(); float denominator = 255.0; Color.Builder resultBuilder = Color .newBuilder() .setRed(red / denominator) .setGreen(green / denominator) .setBlue(blue / denominator); int alpha = color.getAlpha(); if (alpha != 255) { result.setAlpha( FloatValue .newBuilder() .setValue(((float) alpha) / denominator) .build()); } return resultBuilder.build(); } // ... Example (iOS / Obj-C): // ... static UIColor* fromProto(Color* protocolor) { float red = [protocolor red]; float green = [protocolor green]; float blue = [protocolor blue]; FloatValue* alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper != nil) { alpha = [alpha_wrapper value]; } return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; } static Color* toProto(UIColor* color) { CGFloat red, green, blue, alpha; if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) { return nil; } Color* result = [[Color alloc] init]; [result setRed:red]; [result setGreen:green]; [result setBlue:blue]; if (alpha <= 0.9999) { [result setAlpha:floatWrapperWithValue(alpha)]; } [result autorelease]; return result; } // ... Example (JavaScript): // ... var protoToCssColor = function(rgb_color) { var redFrac = rgb_color.red || 0.0; var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue || 0.0; var red = Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255); var blue = Math.floor(blueFrac * 255); if (!('alpha' in rgb_color)) { return rgbToCssColor_(red, green, blue); } var alphaFrac = rgb_color.alpha.value || 0.0; var rgbParams = [red, green, blue].join(','); return ['rgba(', rgbParams, ',', alphaFrac, ')'].join(''); }; var rgbToCssColor_ = function(red, green, blue) { var rgbNumber = new Number((red << 16) | (green << 8) | blue); var hexString = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var resultBuilder = ['#']; for (var i = 0; i < missingZeros; i++) { resultBuilder.push('0'); } resultBuilder.push(hexString); return resultBuilder.join(''); }; // ... # Text color.
-        "alpha": 3.14, # 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).
+      "color": { # Represents a color in the RGBA color space. This representation is designed for simplicity of conversion to/from color representations in various languages over compactness. For example, the fields of this representation can be trivially provided to the constructor of `java.awt.Color` in Java; it can also be trivially provided to UIColor's `+colorWithRed:green:blue:alpha` method in iOS; and, with just a little work, it can be easily formatted into a CSS `rgba()` string in JavaScript. This reference page doesn't carry information about the absolute color space that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB, DCI-P3, BT.2020, etc.). By default, applications should assume the sRGB color space. When color equality needs to be decided, implementations, unless documented otherwise, treat two colors as equal if all their red, green, blue, and alpha values each differ by at most 1e-5. Example (Java): import com.google.type.Color; // ... public static java.awt.Color fromProto(Color protocolor) { float alpha = protocolor.hasAlpha() ? protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( protocolor.getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); } public static Color toProto(java.awt.Color color) { float red = (float) color.getRed(); float green = (float) color.getGreen(); float blue = (float) color.getBlue(); float denominator = 255.0; Color.Builder resultBuilder = Color .newBuilder() .setRed(red / denominator) .setGreen(green / denominator) .setBlue(blue / denominator); int alpha = color.getAlpha(); if (alpha != 255) { result.setAlpha( FloatValue .newBuilder() .setValue(((float) alpha) / denominator) .build()); } return resultBuilder.build(); } // ... Example (iOS / Obj-C): // ... static UIColor* fromProto(Color* protocolor) { float red = [protocolor red]; float green = [protocolor green]; float blue = [protocolor blue]; FloatValue* alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper != nil) { alpha = [alpha_wrapper value]; } return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; } static Color* toProto(UIColor* color) { CGFloat red, green, blue, alpha; if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) { return nil; } Color* result = [[Color alloc] init]; [result setRed:red]; [result setGreen:green]; [result setBlue:blue]; if (alpha <= 0.9999) { [result setAlpha:floatWrapperWithValue(alpha)]; } [result autorelease]; return result; } // ... Example (JavaScript): // ... var protoToCssColor = function(rgb_color) { var redFrac = rgb_color.red || 0.0; var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue || 0.0; var red = Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255); var blue = Math.floor(blueFrac * 255); if (!('alpha' in rgb_color)) { return rgbToCssColor(red, green, blue); } var alphaFrac = rgb_color.alpha.value || 0.0; var rgbParams = [red, green, blue].join(','); return ['rgba(', rgbParams, ',', alphaFrac, ')'].join(''); }; var rgbToCssColor = function(red, green, blue) { var rgbNumber = new Number((red << 16) | (green << 8) | blue); var hexString = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var resultBuilder = ['#']; for (var i = 0; i < missingZeros; i++) { resultBuilder.push('0'); } resultBuilder.push(hexString); return resultBuilder.join(''); }; // ... # Text color.
+        "alpha": 3.14, # 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 rendered as a solid color (as if the alpha value had been explicitly given a value of 1.0).
         "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
         "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
         "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].