blob: 9aee20ae4cf2841e6f65c0315cb273658ba40731 [file] [log] [blame]
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
75<h1><a href="sheets_v4.html">Google Sheets API</a> . <a href="sheets_v4.spreadsheets.html">spreadsheets</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
78 <code><a href="sheets_v4.spreadsheets.sheets.html">sheets()</a></code>
79</p>
80<p class="firstline">Returns the sheets Resource.</p>
81
82<p class="toc_element">
83 <code><a href="sheets_v4.spreadsheets.values.html">values()</a></code>
84</p>
85<p class="firstline">Returns the values Resource.</p>
86
87<p class="toc_element">
88 <code><a href="#batchUpdate">batchUpdate(spreadsheetId, body, x__xgafv=None)</a></code></p>
89<p class="firstline">Applies one or more updates to the spreadsheet.</p>
90<p class="toc_element">
91 <code><a href="#create">create(body, x__xgafv=None)</a></code></p>
92<p class="firstline">Creates a spreadsheet, returning the newly created spreadsheet.</p>
93<p class="toc_element">
94 <code><a href="#get">get(spreadsheetId, ranges=None, x__xgafv=None, includeGridData=None)</a></code></p>
95<p class="firstline">Returns the spreadsheet at the given id.</p>
96<h3>Method Details</h3>
97<div class="method">
98 <code class="details" id="batchUpdate">batchUpdate(spreadsheetId, body, x__xgafv=None)</code>
99 <pre>Applies one or more updates to the spreadsheet.
100
101Each request is validated before
102being applied. If any request is not valid then the entire request will
103fail and nothing will be applied.
104
105Some requests have replies to
106give you some information about how
107they applied. The replies will mirror the requests. For example,
108if you applied 4 updates and the 3rd one had a reply, then the
109response will have 2 empty replies, the actual reply, and another empty
110reply, in that order.
111
112Due to the collaborative nature of spreadsheets, it is not guaranteed that
113the spreadsheet will reflect exactly your changes after this completes,
114however it is guaranteed that all the updates in the request will be
115applied atomically. Your changes may be altered with respect to
116collaborator changes. If there are no collaborators, the spreadsheet
117should reflect your changes.
118
119Args:
120 spreadsheetId: string, The spreadsheet to apply the updates to. (required)
121 body: object, The request body. (required)
122 The object takes the form of:
123
124{ # The request for updating any aspect of a spreadsheet.
125 "requests": [ # A list of updates to apply to the spreadsheet.
126 { # A single kind of update to apply to a spreadsheet.
127 "duplicateFilterView": { # Duplicates a particular filter view. # Duplicates a filter view.
128 "filterId": 42, # The ID of the filter being duplicated.
129 },
130 "sortRange": { # Sorts data in rows based on a sort order per column. # Sorts data in a range.
131 "range": { # A range on a sheet. # The range to sort.
132 # All indexes are zero-based.
133 # Indexes are half open, e.g the start index is inclusive
134 # and the end index is exclusive -- [start_index, end_index).
135 # Missing indexes indicate the range is unbounded on that side.
136 #
137 # For example, if "Sheet1" is grid ID 0, then:
138 #
139 # Sheet1!A1:A1 == sheet_id: 0,
140 # start_row_index: 0, end_row_index: 1,
141 # start_column_index: 0, end_column_index: 1
142 #
143 # Sheet1!A3:B4 == sheet_id: 0,
144 # start_row_index: 2, end_row_index: 4,
145 # start_column_index: 0, end_column_index: 2
146 #
147 # Sheet1!A:B == sheet_id: 0,
148 # start_column_index: 0, end_column_index: 2
149 #
150 # Sheet1!A5:B == sheet_id: 0,
151 # start_row_index: 4,
152 # start_column_index: 0, end_column_index: 2
153 #
154 # Sheet1 == sheet_id:0
155 #
156 # The start index must always be less than or equal to the end index.
157 # If the start index equals the end index, then the range is empty.
158 # Empty ranges are typically not meaningful and are usually rendered in the
159 # UI as `#REF!`.
160 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
161 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
162 "sheetId": 42, # The sheet this range is on.
163 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
164 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
165 },
166 "sortSpecs": [ # The sort order per column. Later specifications are used when values
167 # are equal in the earlier specifications.
168 { # A sort order associated with a specific column or row.
169 "sortOrder": "A String", # The order data should be sorted.
170 "dimensionIndex": 42, # The dimension the sort should be applied to.
171 },
172 ],
173 },
174 "updateEmbeddedObjectPosition": { # Update an embedded object's position (such as a moving or resizing a # Updates an embedded object's (e.g. chart, image) position.
175 # chart or image).
176 "newPosition": { # The position of an embedded object such as a chart. # An explicit position to move the embedded object to.
177 # If newPosition.sheetId is set,
178 # a new sheet with that ID will be created.
179 # If newPosition.newSheet is set to true,
180 # a new sheet will be created with an ID that will be chosen for you.
181 "newSheet": True or False, # If true, the embedded object will be put on a new sheet whose ID
182 # is chosen for you. Used only when writing.
183 "sheetId": 42, # The sheet this is on. Set only if the embedded object
184 # is on its own sheet. Must be non-negative.
185 "overlayPosition": { # The location an object is overlaid on top of a grid. # The position the object is overlaid on top of a grid.
186 "anchorCell": { # A coordinate in a sheet. # The cell the object is anchored to.
187 # All indexes are zero-based.
188 "rowIndex": 42, # The row index of the coordinate.
189 "columnIndex": 42, # The column index of the coordinate.
190 "sheetId": 42, # The sheet this coordinate is on.
191 },
192 "offsetYPixels": 42, # The vertical offset, in pixels, that the object is offset
193 # from the anchor cell.
194 "widthPixels": 42, # The width of the object, in pixels. Defaults to 600.
195 "offsetXPixels": 42, # The horizontal offset, in pixels, that the object is offset
196 # from the anchor cell.
197 "heightPixels": 42, # The height of the object, in pixels. Defaults to 371.
198 },
199 },
200 "fields": "A String", # The fields of OverlayPosition that should be updated when
201 # setting a new position. Used only if
202 # newPosition.overlayPosition
203 # is set, in which case at least one field must
204 # be specified. The root `newPosition.overlayPosition` is implied and
205 # should not be specified.
206 # A single `"*"` can be used as short-hand for listing every field.
207 "objectId": 42, # The id of the object to moved.
208 },
209 "updateConditionalFormatRule": { # Updates a conditional format rule at the given index, # Updates an existing conditional format rule.
210 # or moves a conditional format rule to another index.
211 "index": 42, # The zero-based index of the rule that should be replaced or moved.
212 "newIndex": 42, # The zero-based new index the rule should end up at.
213 "sheetId": 42, # The sheet of the rule to move. Required if newIndex is set,
214 # unused otherwise.
215 "rule": { # A rule describing a conditional format. # The rule that should replace the rule at the given index.
216 "ranges": [ # The ranges that will be formatted if the condition is true.
217 # All the ranges must be on the same grid.
218 { # A range on a sheet.
219 # All indexes are zero-based.
220 # Indexes are half open, e.g the start index is inclusive
221 # and the end index is exclusive -- [start_index, end_index).
222 # Missing indexes indicate the range is unbounded on that side.
223 #
224 # For example, if "Sheet1" is grid ID 0, then:
225 #
226 # Sheet1!A1:A1 == sheet_id: 0,
227 # start_row_index: 0, end_row_index: 1,
228 # start_column_index: 0, end_column_index: 1
229 #
230 # Sheet1!A3:B4 == sheet_id: 0,
231 # start_row_index: 2, end_row_index: 4,
232 # start_column_index: 0, end_column_index: 2
233 #
234 # Sheet1!A:B == sheet_id: 0,
235 # start_column_index: 0, end_column_index: 2
236 #
237 # Sheet1!A5:B == sheet_id: 0,
238 # start_row_index: 4,
239 # start_column_index: 0, end_column_index: 2
240 #
241 # Sheet1 == sheet_id:0
242 #
243 # The start index must always be less than or equal to the end index.
244 # If the start index equals the end index, then the range is empty.
245 # Empty ranges are typically not meaningful and are usually rendered in the
246 # UI as `#REF!`.
247 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
248 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
249 "sheetId": 42, # The sheet this range is on.
250 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
251 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
252 },
253 ],
254 "booleanRule": { # A rule that may or may not match, depending on the condition. # The formatting is either "on" or "off" according to the rule.
255 "condition": { # A condition that can evaluate to true or false. # The condition of the rule. If the condition evaluates to true,
256 # the format will be applied.
257 # BooleanConditions are used by conditional formatting,
258 # data validation, and the criteria in filters.
259 "type": "A String", # The type of condition.
260 "values": [ # The values of the condition. The number of supported values depends
261 # on the condition type. Some support zero values,
262 # others one or two values,
263 # and ConditionType.ONE_OF_LIST supports an arbitrary number of values.
264 { # The value of the condition.
265 "relativeDate": "A String", # A relative date (based on the current date).
266 # Valid only if the type is
267 # DATE_BEFORE,
268 # DATE_AFTER,
269 # DATE_ON_OR_BEFORE or
270 # DATE_ON_OR_AFTER.
271 #
272 # Relative dates are not supported in data validation.
273 # They are supported only in conditional formatting and
274 # conditional filters.
275 "userEnteredValue": "A String", # A value the condition is based on.
276 # The value will be parsed as if the user typed into a cell.
277 # Formulas are supported (and must begin with an `=`).
278 },
279 ],
280 },
281 "format": { # The format of a cell. # The format to apply.
282 # Conditional formatting can only apply a subset of formatting:
283 # bold, italic,
284 # strikethrough,
285 # foreground color &
286 # background color.
287 "numberFormat": { # The number format of a cell. # A format describing how number values should be represented to the user.
288 # When updating, all fields must be set.
289 "pattern": "A String", # Pattern string used for formatting.
290 "type": "A String", # The type of the number format.
291 },
292 "textDirection": "A String", # The direction of the text in the cell.
293 "padding": { # The amount of padding around the cell, in pixels. # The padding of the cell.
294 # When updating padding, every field must be specified.
295 "top": 42, # The top padding of the cell.
296 "right": 42, # The right padding of the cell.
297 "bottom": 42, # The bottom padding of the cell.
298 "left": 42, # The left padding of the cell.
299 },
300 "horizontalAlignment": "A String", # The horizontal alignment of the value in cell.
301 "backgroundColor": { # Represents a color in the RGBA color space. This representation is designed # The background color of the cell.
302 # for simplicity of conversion to/from color representations in various
303 # languages over compactness; for example, the fields of this representation
304 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
305 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
306 # method in iOS; and, with just a little work, it can be easily formatted into
307 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
308 #
309 # Example (Java):
310 #
311 # import com.google.type.Color;
312 #
313 # // ...
314 # public static java.awt.Color fromProto(Color protocolor) {
315 # float alpha = protocolor.hasAlpha()
316 # ? protocolor.getAlpha().getValue()
317 # : 1.0;
318 #
319 # return new java.awt.Color(
320 # protocolor.getRed(),
321 # protocolor.getGreen(),
322 # protocolor.getBlue(),
323 # alpha);
324 # }
325 #
326 # public static Color toProto(java.awt.Color color) {
327 # float red = (float) color.getRed();
328 # float green = (float) color.getGreen();
329 # float blue = (float) color.getBlue();
330 # float denominator = 255.0;
331 # Color.Builder resultBuilder =
332 # Color
333 # .newBuilder()
334 # .setRed(red / denominator)
335 # .setGreen(green / denominator)
336 # .setBlue(blue / denominator);
337 # int alpha = color.getAlpha();
338 # if (alpha != 255) {
339 # result.setAlpha(
340 # FloatValue
341 # .newBuilder()
342 # .setValue(((float) alpha) / denominator)
343 # .build());
344 # }
345 # return resultBuilder.build();
346 # }
347 # // ...
348 #
349 # Example (iOS / Obj-C):
350 #
351 # // ...
352 # static UIColor* fromProto(Color* protocolor) {
353 # float red = [protocolor red];
354 # float green = [protocolor green];
355 # float blue = [protocolor blue];
356 # FloatValue* alpha_wrapper = [protocolor alpha];
357 # float alpha = 1.0;
358 # if (alpha_wrapper != nil) {
359 # alpha = [alpha_wrapper value];
360 # }
361 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
362 # }
363 #
364 # static Color* toProto(UIColor* color) {
365 # CGFloat red, green, blue, alpha;
366 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
367 # return nil;
368 # }
369 # Color* result = [Color alloc] init];
370 # [result setRed:red];
371 # [result setGreen:green];
372 # [result setBlue:blue];
373 # if (alpha <= 0.9999) {
374 # [result setAlpha:floatWrapperWithValue(alpha)];
375 # }
376 # [result autorelease];
377 # return result;
378 # }
379 # // ...
380 #
381 # Example (JavaScript):
382 #
383 # // ...
384 #
385 # var protoToCssColor = function(rgb_color) {
386 # var redFrac = rgb_color.red || 0.0;
387 # var greenFrac = rgb_color.green || 0.0;
388 # var blueFrac = rgb_color.blue || 0.0;
389 # var red = Math.floor(redFrac * 255);
390 # var green = Math.floor(greenFrac * 255);
391 # var blue = Math.floor(blueFrac * 255);
392 #
393 # if (!('alpha' in rgb_color)) {
394 # return rgbToCssColor_(red, green, blue);
395 # }
396 #
397 # var alphaFrac = rgb_color.alpha.value || 0.0;
398 # var rgbParams = [red, green, blue].join(',');
399 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
400 # };
401 #
402 # var rgbToCssColor_ = function(red, green, blue) {
403 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
404 # var hexString = rgbNumber.toString(16);
405 # var missingZeros = 6 - hexString.length;
406 # var resultBuilder = ['#'];
407 # for (var i = 0; i < missingZeros; i++) {
408 # resultBuilder.push('0');
409 # }
410 # resultBuilder.push(hexString);
411 # return resultBuilder.join('');
412 # };
413 #
414 # // ...
415 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
416 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
417 # the final pixel color is defined by the equation:
418 #
419 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
420 #
421 # This means that a value of 1.0 corresponds to a solid color, whereas
422 # a value of 0.0 corresponds to a completely transparent color. This
423 # uses a wrapper message rather than a simple float scalar so that it is
424 # possible to distinguish between a default value and the value being unset.
425 # If omitted, this color object is to be rendered as a solid color
426 # (as if the alpha value had been explicitly given with a value of 1.0).
427 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
428 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
429 },
430 "verticalAlignment": "A String", # The vertical alignment of the value in cell.
431 "textFormat": { # The format of a run of text in a cell. # The format of the text in the cell (unless overridden by a format run).
432 # Absent values indicate that the field isn't specified.
433 "foregroundColor": { # Represents a color in the RGBA color space. This representation is designed # The foreground color of the text.
434 # for simplicity of conversion to/from color representations in various
435 # languages over compactness; for example, the fields of this representation
436 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
437 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
438 # method in iOS; and, with just a little work, it can be easily formatted into
439 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
440 #
441 # Example (Java):
442 #
443 # import com.google.type.Color;
444 #
445 # // ...
446 # public static java.awt.Color fromProto(Color protocolor) {
447 # float alpha = protocolor.hasAlpha()
448 # ? protocolor.getAlpha().getValue()
449 # : 1.0;
450 #
451 # return new java.awt.Color(
452 # protocolor.getRed(),
453 # protocolor.getGreen(),
454 # protocolor.getBlue(),
455 # alpha);
456 # }
457 #
458 # public static Color toProto(java.awt.Color color) {
459 # float red = (float) color.getRed();
460 # float green = (float) color.getGreen();
461 # float blue = (float) color.getBlue();
462 # float denominator = 255.0;
463 # Color.Builder resultBuilder =
464 # Color
465 # .newBuilder()
466 # .setRed(red / denominator)
467 # .setGreen(green / denominator)
468 # .setBlue(blue / denominator);
469 # int alpha = color.getAlpha();
470 # if (alpha != 255) {
471 # result.setAlpha(
472 # FloatValue
473 # .newBuilder()
474 # .setValue(((float) alpha) / denominator)
475 # .build());
476 # }
477 # return resultBuilder.build();
478 # }
479 # // ...
480 #
481 # Example (iOS / Obj-C):
482 #
483 # // ...
484 # static UIColor* fromProto(Color* protocolor) {
485 # float red = [protocolor red];
486 # float green = [protocolor green];
487 # float blue = [protocolor blue];
488 # FloatValue* alpha_wrapper = [protocolor alpha];
489 # float alpha = 1.0;
490 # if (alpha_wrapper != nil) {
491 # alpha = [alpha_wrapper value];
492 # }
493 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
494 # }
495 #
496 # static Color* toProto(UIColor* color) {
497 # CGFloat red, green, blue, alpha;
498 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
499 # return nil;
500 # }
501 # Color* result = [Color alloc] init];
502 # [result setRed:red];
503 # [result setGreen:green];
504 # [result setBlue:blue];
505 # if (alpha <= 0.9999) {
506 # [result setAlpha:floatWrapperWithValue(alpha)];
507 # }
508 # [result autorelease];
509 # return result;
510 # }
511 # // ...
512 #
513 # Example (JavaScript):
514 #
515 # // ...
516 #
517 # var protoToCssColor = function(rgb_color) {
518 # var redFrac = rgb_color.red || 0.0;
519 # var greenFrac = rgb_color.green || 0.0;
520 # var blueFrac = rgb_color.blue || 0.0;
521 # var red = Math.floor(redFrac * 255);
522 # var green = Math.floor(greenFrac * 255);
523 # var blue = Math.floor(blueFrac * 255);
524 #
525 # if (!('alpha' in rgb_color)) {
526 # return rgbToCssColor_(red, green, blue);
527 # }
528 #
529 # var alphaFrac = rgb_color.alpha.value || 0.0;
530 # var rgbParams = [red, green, blue].join(',');
531 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
532 # };
533 #
534 # var rgbToCssColor_ = function(red, green, blue) {
535 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
536 # var hexString = rgbNumber.toString(16);
537 # var missingZeros = 6 - hexString.length;
538 # var resultBuilder = ['#'];
539 # for (var i = 0; i < missingZeros; i++) {
540 # resultBuilder.push('0');
541 # }
542 # resultBuilder.push(hexString);
543 # return resultBuilder.join('');
544 # };
545 #
546 # // ...
547 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
548 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
549 # the final pixel color is defined by the equation:
550 #
551 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
552 #
553 # This means that a value of 1.0 corresponds to a solid color, whereas
554 # a value of 0.0 corresponds to a completely transparent color. This
555 # uses a wrapper message rather than a simple float scalar so that it is
556 # possible to distinguish between a default value and the value being unset.
557 # If omitted, this color object is to be rendered as a solid color
558 # (as if the alpha value had been explicitly given with a value of 1.0).
559 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
560 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
561 },
562 "bold": True or False, # True if the text is bold.
563 "strikethrough": True or False, # True if the text has a strikethrough.
564 "fontFamily": "A String", # The font family.
565 "fontSize": 42, # The size of the font.
566 "italic": True or False, # True if the text is italicized.
567 "underline": True or False, # True if the text is underlined.
568 },
569 "hyperlinkDisplayType": "A String", # How a hyperlink, if it exists, should be displayed in the cell.
570 "borders": { # The borders of the cell. # The borders of the cell.
571 "top": { # A border along a cell. # The top border of the cell.
572 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
573 # for simplicity of conversion to/from color representations in various
574 # languages over compactness; for example, the fields of this representation
575 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
576 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
577 # method in iOS; and, with just a little work, it can be easily formatted into
578 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
579 #
580 # Example (Java):
581 #
582 # import com.google.type.Color;
583 #
584 # // ...
585 # public static java.awt.Color fromProto(Color protocolor) {
586 # float alpha = protocolor.hasAlpha()
587 # ? protocolor.getAlpha().getValue()
588 # : 1.0;
589 #
590 # return new java.awt.Color(
591 # protocolor.getRed(),
592 # protocolor.getGreen(),
593 # protocolor.getBlue(),
594 # alpha);
595 # }
596 #
597 # public static Color toProto(java.awt.Color color) {
598 # float red = (float) color.getRed();
599 # float green = (float) color.getGreen();
600 # float blue = (float) color.getBlue();
601 # float denominator = 255.0;
602 # Color.Builder resultBuilder =
603 # Color
604 # .newBuilder()
605 # .setRed(red / denominator)
606 # .setGreen(green / denominator)
607 # .setBlue(blue / denominator);
608 # int alpha = color.getAlpha();
609 # if (alpha != 255) {
610 # result.setAlpha(
611 # FloatValue
612 # .newBuilder()
613 # .setValue(((float) alpha) / denominator)
614 # .build());
615 # }
616 # return resultBuilder.build();
617 # }
618 # // ...
619 #
620 # Example (iOS / Obj-C):
621 #
622 # // ...
623 # static UIColor* fromProto(Color* protocolor) {
624 # float red = [protocolor red];
625 # float green = [protocolor green];
626 # float blue = [protocolor blue];
627 # FloatValue* alpha_wrapper = [protocolor alpha];
628 # float alpha = 1.0;
629 # if (alpha_wrapper != nil) {
630 # alpha = [alpha_wrapper value];
631 # }
632 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
633 # }
634 #
635 # static Color* toProto(UIColor* color) {
636 # CGFloat red, green, blue, alpha;
637 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
638 # return nil;
639 # }
640 # Color* result = [Color alloc] init];
641 # [result setRed:red];
642 # [result setGreen:green];
643 # [result setBlue:blue];
644 # if (alpha <= 0.9999) {
645 # [result setAlpha:floatWrapperWithValue(alpha)];
646 # }
647 # [result autorelease];
648 # return result;
649 # }
650 # // ...
651 #
652 # Example (JavaScript):
653 #
654 # // ...
655 #
656 # var protoToCssColor = function(rgb_color) {
657 # var redFrac = rgb_color.red || 0.0;
658 # var greenFrac = rgb_color.green || 0.0;
659 # var blueFrac = rgb_color.blue || 0.0;
660 # var red = Math.floor(redFrac * 255);
661 # var green = Math.floor(greenFrac * 255);
662 # var blue = Math.floor(blueFrac * 255);
663 #
664 # if (!('alpha' in rgb_color)) {
665 # return rgbToCssColor_(red, green, blue);
666 # }
667 #
668 # var alphaFrac = rgb_color.alpha.value || 0.0;
669 # var rgbParams = [red, green, blue].join(',');
670 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
671 # };
672 #
673 # var rgbToCssColor_ = function(red, green, blue) {
674 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
675 # var hexString = rgbNumber.toString(16);
676 # var missingZeros = 6 - hexString.length;
677 # var resultBuilder = ['#'];
678 # for (var i = 0; i < missingZeros; i++) {
679 # resultBuilder.push('0');
680 # }
681 # resultBuilder.push(hexString);
682 # return resultBuilder.join('');
683 # };
684 #
685 # // ...
686 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
687 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
688 # the final pixel color is defined by the equation:
689 #
690 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
691 #
692 # This means that a value of 1.0 corresponds to a solid color, whereas
693 # a value of 0.0 corresponds to a completely transparent color. This
694 # uses a wrapper message rather than a simple float scalar so that it is
695 # possible to distinguish between a default value and the value being unset.
696 # If omitted, this color object is to be rendered as a solid color
697 # (as if the alpha value had been explicitly given with a value of 1.0).
698 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
699 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
700 },
701 "width": 42, # The width of the border, in pixels.
702 # Border widths must be between 0 and 3 pixels.
703 "style": "A String", # The style of the border.
704 },
705 "right": { # A border along a cell. # The right border of the cell.
706 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
707 # for simplicity of conversion to/from color representations in various
708 # languages over compactness; for example, the fields of this representation
709 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
710 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
711 # method in iOS; and, with just a little work, it can be easily formatted into
712 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
713 #
714 # Example (Java):
715 #
716 # import com.google.type.Color;
717 #
718 # // ...
719 # public static java.awt.Color fromProto(Color protocolor) {
720 # float alpha = protocolor.hasAlpha()
721 # ? protocolor.getAlpha().getValue()
722 # : 1.0;
723 #
724 # return new java.awt.Color(
725 # protocolor.getRed(),
726 # protocolor.getGreen(),
727 # protocolor.getBlue(),
728 # alpha);
729 # }
730 #
731 # public static Color toProto(java.awt.Color color) {
732 # float red = (float) color.getRed();
733 # float green = (float) color.getGreen();
734 # float blue = (float) color.getBlue();
735 # float denominator = 255.0;
736 # Color.Builder resultBuilder =
737 # Color
738 # .newBuilder()
739 # .setRed(red / denominator)
740 # .setGreen(green / denominator)
741 # .setBlue(blue / denominator);
742 # int alpha = color.getAlpha();
743 # if (alpha != 255) {
744 # result.setAlpha(
745 # FloatValue
746 # .newBuilder()
747 # .setValue(((float) alpha) / denominator)
748 # .build());
749 # }
750 # return resultBuilder.build();
751 # }
752 # // ...
753 #
754 # Example (iOS / Obj-C):
755 #
756 # // ...
757 # static UIColor* fromProto(Color* protocolor) {
758 # float red = [protocolor red];
759 # float green = [protocolor green];
760 # float blue = [protocolor blue];
761 # FloatValue* alpha_wrapper = [protocolor alpha];
762 # float alpha = 1.0;
763 # if (alpha_wrapper != nil) {
764 # alpha = [alpha_wrapper value];
765 # }
766 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
767 # }
768 #
769 # static Color* toProto(UIColor* color) {
770 # CGFloat red, green, blue, alpha;
771 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
772 # return nil;
773 # }
774 # Color* result = [Color alloc] init];
775 # [result setRed:red];
776 # [result setGreen:green];
777 # [result setBlue:blue];
778 # if (alpha <= 0.9999) {
779 # [result setAlpha:floatWrapperWithValue(alpha)];
780 # }
781 # [result autorelease];
782 # return result;
783 # }
784 # // ...
785 #
786 # Example (JavaScript):
787 #
788 # // ...
789 #
790 # var protoToCssColor = function(rgb_color) {
791 # var redFrac = rgb_color.red || 0.0;
792 # var greenFrac = rgb_color.green || 0.0;
793 # var blueFrac = rgb_color.blue || 0.0;
794 # var red = Math.floor(redFrac * 255);
795 # var green = Math.floor(greenFrac * 255);
796 # var blue = Math.floor(blueFrac * 255);
797 #
798 # if (!('alpha' in rgb_color)) {
799 # return rgbToCssColor_(red, green, blue);
800 # }
801 #
802 # var alphaFrac = rgb_color.alpha.value || 0.0;
803 # var rgbParams = [red, green, blue].join(',');
804 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
805 # };
806 #
807 # var rgbToCssColor_ = function(red, green, blue) {
808 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
809 # var hexString = rgbNumber.toString(16);
810 # var missingZeros = 6 - hexString.length;
811 # var resultBuilder = ['#'];
812 # for (var i = 0; i < missingZeros; i++) {
813 # resultBuilder.push('0');
814 # }
815 # resultBuilder.push(hexString);
816 # return resultBuilder.join('');
817 # };
818 #
819 # // ...
820 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
821 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
822 # the final pixel color is defined by the equation:
823 #
824 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
825 #
826 # This means that a value of 1.0 corresponds to a solid color, whereas
827 # a value of 0.0 corresponds to a completely transparent color. This
828 # uses a wrapper message rather than a simple float scalar so that it is
829 # possible to distinguish between a default value and the value being unset.
830 # If omitted, this color object is to be rendered as a solid color
831 # (as if the alpha value had been explicitly given with a value of 1.0).
832 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
833 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
834 },
835 "width": 42, # The width of the border, in pixels.
836 # Border widths must be between 0 and 3 pixels.
837 "style": "A String", # The style of the border.
838 },
839 "bottom": { # A border along a cell. # The bottom border of the cell.
840 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
841 # for simplicity of conversion to/from color representations in various
842 # languages over compactness; for example, the fields of this representation
843 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
844 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
845 # method in iOS; and, with just a little work, it can be easily formatted into
846 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
847 #
848 # Example (Java):
849 #
850 # import com.google.type.Color;
851 #
852 # // ...
853 # public static java.awt.Color fromProto(Color protocolor) {
854 # float alpha = protocolor.hasAlpha()
855 # ? protocolor.getAlpha().getValue()
856 # : 1.0;
857 #
858 # return new java.awt.Color(
859 # protocolor.getRed(),
860 # protocolor.getGreen(),
861 # protocolor.getBlue(),
862 # alpha);
863 # }
864 #
865 # public static Color toProto(java.awt.Color color) {
866 # float red = (float) color.getRed();
867 # float green = (float) color.getGreen();
868 # float blue = (float) color.getBlue();
869 # float denominator = 255.0;
870 # Color.Builder resultBuilder =
871 # Color
872 # .newBuilder()
873 # .setRed(red / denominator)
874 # .setGreen(green / denominator)
875 # .setBlue(blue / denominator);
876 # int alpha = color.getAlpha();
877 # if (alpha != 255) {
878 # result.setAlpha(
879 # FloatValue
880 # .newBuilder()
881 # .setValue(((float) alpha) / denominator)
882 # .build());
883 # }
884 # return resultBuilder.build();
885 # }
886 # // ...
887 #
888 # Example (iOS / Obj-C):
889 #
890 # // ...
891 # static UIColor* fromProto(Color* protocolor) {
892 # float red = [protocolor red];
893 # float green = [protocolor green];
894 # float blue = [protocolor blue];
895 # FloatValue* alpha_wrapper = [protocolor alpha];
896 # float alpha = 1.0;
897 # if (alpha_wrapper != nil) {
898 # alpha = [alpha_wrapper value];
899 # }
900 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
901 # }
902 #
903 # static Color* toProto(UIColor* color) {
904 # CGFloat red, green, blue, alpha;
905 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
906 # return nil;
907 # }
908 # Color* result = [Color alloc] init];
909 # [result setRed:red];
910 # [result setGreen:green];
911 # [result setBlue:blue];
912 # if (alpha <= 0.9999) {
913 # [result setAlpha:floatWrapperWithValue(alpha)];
914 # }
915 # [result autorelease];
916 # return result;
917 # }
918 # // ...
919 #
920 # Example (JavaScript):
921 #
922 # // ...
923 #
924 # var protoToCssColor = function(rgb_color) {
925 # var redFrac = rgb_color.red || 0.0;
926 # var greenFrac = rgb_color.green || 0.0;
927 # var blueFrac = rgb_color.blue || 0.0;
928 # var red = Math.floor(redFrac * 255);
929 # var green = Math.floor(greenFrac * 255);
930 # var blue = Math.floor(blueFrac * 255);
931 #
932 # if (!('alpha' in rgb_color)) {
933 # return rgbToCssColor_(red, green, blue);
934 # }
935 #
936 # var alphaFrac = rgb_color.alpha.value || 0.0;
937 # var rgbParams = [red, green, blue].join(',');
938 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
939 # };
940 #
941 # var rgbToCssColor_ = function(red, green, blue) {
942 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
943 # var hexString = rgbNumber.toString(16);
944 # var missingZeros = 6 - hexString.length;
945 # var resultBuilder = ['#'];
946 # for (var i = 0; i < missingZeros; i++) {
947 # resultBuilder.push('0');
948 # }
949 # resultBuilder.push(hexString);
950 # return resultBuilder.join('');
951 # };
952 #
953 # // ...
954 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
955 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
956 # the final pixel color is defined by the equation:
957 #
958 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
959 #
960 # This means that a value of 1.0 corresponds to a solid color, whereas
961 # a value of 0.0 corresponds to a completely transparent color. This
962 # uses a wrapper message rather than a simple float scalar so that it is
963 # possible to distinguish between a default value and the value being unset.
964 # If omitted, this color object is to be rendered as a solid color
965 # (as if the alpha value had been explicitly given with a value of 1.0).
966 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
967 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
968 },
969 "width": 42, # The width of the border, in pixels.
970 # Border widths must be between 0 and 3 pixels.
971 "style": "A String", # The style of the border.
972 },
973 "left": { # A border along a cell. # The left border of the cell.
974 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
975 # for simplicity of conversion to/from color representations in various
976 # languages over compactness; for example, the fields of this representation
977 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
978 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
979 # method in iOS; and, with just a little work, it can be easily formatted into
980 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
981 #
982 # Example (Java):
983 #
984 # import com.google.type.Color;
985 #
986 # // ...
987 # public static java.awt.Color fromProto(Color protocolor) {
988 # float alpha = protocolor.hasAlpha()
989 # ? protocolor.getAlpha().getValue()
990 # : 1.0;
991 #
992 # return new java.awt.Color(
993 # protocolor.getRed(),
994 # protocolor.getGreen(),
995 # protocolor.getBlue(),
996 # alpha);
997 # }
998 #
999 # public static Color toProto(java.awt.Color color) {
1000 # float red = (float) color.getRed();
1001 # float green = (float) color.getGreen();
1002 # float blue = (float) color.getBlue();
1003 # float denominator = 255.0;
1004 # Color.Builder resultBuilder =
1005 # Color
1006 # .newBuilder()
1007 # .setRed(red / denominator)
1008 # .setGreen(green / denominator)
1009 # .setBlue(blue / denominator);
1010 # int alpha = color.getAlpha();
1011 # if (alpha != 255) {
1012 # result.setAlpha(
1013 # FloatValue
1014 # .newBuilder()
1015 # .setValue(((float) alpha) / denominator)
1016 # .build());
1017 # }
1018 # return resultBuilder.build();
1019 # }
1020 # // ...
1021 #
1022 # Example (iOS / Obj-C):
1023 #
1024 # // ...
1025 # static UIColor* fromProto(Color* protocolor) {
1026 # float red = [protocolor red];
1027 # float green = [protocolor green];
1028 # float blue = [protocolor blue];
1029 # FloatValue* alpha_wrapper = [protocolor alpha];
1030 # float alpha = 1.0;
1031 # if (alpha_wrapper != nil) {
1032 # alpha = [alpha_wrapper value];
1033 # }
1034 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
1035 # }
1036 #
1037 # static Color* toProto(UIColor* color) {
1038 # CGFloat red, green, blue, alpha;
1039 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
1040 # return nil;
1041 # }
1042 # Color* result = [Color alloc] init];
1043 # [result setRed:red];
1044 # [result setGreen:green];
1045 # [result setBlue:blue];
1046 # if (alpha <= 0.9999) {
1047 # [result setAlpha:floatWrapperWithValue(alpha)];
1048 # }
1049 # [result autorelease];
1050 # return result;
1051 # }
1052 # // ...
1053 #
1054 # Example (JavaScript):
1055 #
1056 # // ...
1057 #
1058 # var protoToCssColor = function(rgb_color) {
1059 # var redFrac = rgb_color.red || 0.0;
1060 # var greenFrac = rgb_color.green || 0.0;
1061 # var blueFrac = rgb_color.blue || 0.0;
1062 # var red = Math.floor(redFrac * 255);
1063 # var green = Math.floor(greenFrac * 255);
1064 # var blue = Math.floor(blueFrac * 255);
1065 #
1066 # if (!('alpha' in rgb_color)) {
1067 # return rgbToCssColor_(red, green, blue);
1068 # }
1069 #
1070 # var alphaFrac = rgb_color.alpha.value || 0.0;
1071 # var rgbParams = [red, green, blue].join(',');
1072 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
1073 # };
1074 #
1075 # var rgbToCssColor_ = function(red, green, blue) {
1076 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
1077 # var hexString = rgbNumber.toString(16);
1078 # var missingZeros = 6 - hexString.length;
1079 # var resultBuilder = ['#'];
1080 # for (var i = 0; i < missingZeros; i++) {
1081 # resultBuilder.push('0');
1082 # }
1083 # resultBuilder.push(hexString);
1084 # return resultBuilder.join('');
1085 # };
1086 #
1087 # // ...
1088 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
1089 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
1090 # the final pixel color is defined by the equation:
1091 #
1092 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
1093 #
1094 # This means that a value of 1.0 corresponds to a solid color, whereas
1095 # a value of 0.0 corresponds to a completely transparent color. This
1096 # uses a wrapper message rather than a simple float scalar so that it is
1097 # possible to distinguish between a default value and the value being unset.
1098 # If omitted, this color object is to be rendered as a solid color
1099 # (as if the alpha value had been explicitly given with a value of 1.0).
1100 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
1101 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
1102 },
1103 "width": 42, # The width of the border, in pixels.
1104 # Border widths must be between 0 and 3 pixels.
1105 "style": "A String", # The style of the border.
1106 },
1107 },
1108 "wrapStrategy": "A String", # The wrap strategy for the value in the cell.
1109 },
1110 },
1111 "gradientRule": { # A rule that applies a gradient color scale format, based on # The formatting will vary based on the gradients in the rule.
1112 # the interpolation points listed. The format of a cell will vary
1113 # based on its contents as compared to the values of the interpolation
1114 # points.
1115 "maxpoint": { # A single interpolation point a gradient conditional format. # The final interpolation point.
1116 # These pin the gradient color scale according to the color,
1117 # type and value chosen.
1118 "color": { # Represents a color in the RGBA color space. This representation is designed # The color this interpolation point should use.
1119 # for simplicity of conversion to/from color representations in various
1120 # languages over compactness; for example, the fields of this representation
1121 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
1122 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
1123 # method in iOS; and, with just a little work, it can be easily formatted into
1124 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
1125 #
1126 # Example (Java):
1127 #
1128 # import com.google.type.Color;
1129 #
1130 # // ...
1131 # public static java.awt.Color fromProto(Color protocolor) {
1132 # float alpha = protocolor.hasAlpha()
1133 # ? protocolor.getAlpha().getValue()
1134 # : 1.0;
1135 #
1136 # return new java.awt.Color(
1137 # protocolor.getRed(),
1138 # protocolor.getGreen(),
1139 # protocolor.getBlue(),
1140 # alpha);
1141 # }
1142 #
1143 # public static Color toProto(java.awt.Color color) {
1144 # float red = (float) color.getRed();
1145 # float green = (float) color.getGreen();
1146 # float blue = (float) color.getBlue();
1147 # float denominator = 255.0;
1148 # Color.Builder resultBuilder =
1149 # Color
1150 # .newBuilder()
1151 # .setRed(red / denominator)
1152 # .setGreen(green / denominator)
1153 # .setBlue(blue / denominator);
1154 # int alpha = color.getAlpha();
1155 # if (alpha != 255) {
1156 # result.setAlpha(
1157 # FloatValue
1158 # .newBuilder()
1159 # .setValue(((float) alpha) / denominator)
1160 # .build());
1161 # }
1162 # return resultBuilder.build();
1163 # }
1164 # // ...
1165 #
1166 # Example (iOS / Obj-C):
1167 #
1168 # // ...
1169 # static UIColor* fromProto(Color* protocolor) {
1170 # float red = [protocolor red];
1171 # float green = [protocolor green];
1172 # float blue = [protocolor blue];
1173 # FloatValue* alpha_wrapper = [protocolor alpha];
1174 # float alpha = 1.0;
1175 # if (alpha_wrapper != nil) {
1176 # alpha = [alpha_wrapper value];
1177 # }
1178 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
1179 # }
1180 #
1181 # static Color* toProto(UIColor* color) {
1182 # CGFloat red, green, blue, alpha;
1183 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
1184 # return nil;
1185 # }
1186 # Color* result = [Color alloc] init];
1187 # [result setRed:red];
1188 # [result setGreen:green];
1189 # [result setBlue:blue];
1190 # if (alpha <= 0.9999) {
1191 # [result setAlpha:floatWrapperWithValue(alpha)];
1192 # }
1193 # [result autorelease];
1194 # return result;
1195 # }
1196 # // ...
1197 #
1198 # Example (JavaScript):
1199 #
1200 # // ...
1201 #
1202 # var protoToCssColor = function(rgb_color) {
1203 # var redFrac = rgb_color.red || 0.0;
1204 # var greenFrac = rgb_color.green || 0.0;
1205 # var blueFrac = rgb_color.blue || 0.0;
1206 # var red = Math.floor(redFrac * 255);
1207 # var green = Math.floor(greenFrac * 255);
1208 # var blue = Math.floor(blueFrac * 255);
1209 #
1210 # if (!('alpha' in rgb_color)) {
1211 # return rgbToCssColor_(red, green, blue);
1212 # }
1213 #
1214 # var alphaFrac = rgb_color.alpha.value || 0.0;
1215 # var rgbParams = [red, green, blue].join(',');
1216 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
1217 # };
1218 #
1219 # var rgbToCssColor_ = function(red, green, blue) {
1220 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
1221 # var hexString = rgbNumber.toString(16);
1222 # var missingZeros = 6 - hexString.length;
1223 # var resultBuilder = ['#'];
1224 # for (var i = 0; i < missingZeros; i++) {
1225 # resultBuilder.push('0');
1226 # }
1227 # resultBuilder.push(hexString);
1228 # return resultBuilder.join('');
1229 # };
1230 #
1231 # // ...
1232 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
1233 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
1234 # the final pixel color is defined by the equation:
1235 #
1236 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
1237 #
1238 # This means that a value of 1.0 corresponds to a solid color, whereas
1239 # a value of 0.0 corresponds to a completely transparent color. This
1240 # uses a wrapper message rather than a simple float scalar so that it is
1241 # possible to distinguish between a default value and the value being unset.
1242 # If omitted, this color object is to be rendered as a solid color
1243 # (as if the alpha value had been explicitly given with a value of 1.0).
1244 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
1245 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
1246 },
1247 "type": "A String", # How the value should be interpreted.
1248 "value": "A String", # The value this interpolation point uses. May be a formula.
1249 # Unused if type is MIN or
1250 # MAX.
1251 },
1252 "midpoint": { # A single interpolation point a gradient conditional format. # An optional midway interpolation point.
1253 # These pin the gradient color scale according to the color,
1254 # type and value chosen.
1255 "color": { # Represents a color in the RGBA color space. This representation is designed # The color this interpolation point should use.
1256 # for simplicity of conversion to/from color representations in various
1257 # languages over compactness; for example, the fields of this representation
1258 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
1259 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
1260 # method in iOS; and, with just a little work, it can be easily formatted into
1261 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
1262 #
1263 # Example (Java):
1264 #
1265 # import com.google.type.Color;
1266 #
1267 # // ...
1268 # public static java.awt.Color fromProto(Color protocolor) {
1269 # float alpha = protocolor.hasAlpha()
1270 # ? protocolor.getAlpha().getValue()
1271 # : 1.0;
1272 #
1273 # return new java.awt.Color(
1274 # protocolor.getRed(),
1275 # protocolor.getGreen(),
1276 # protocolor.getBlue(),
1277 # alpha);
1278 # }
1279 #
1280 # public static Color toProto(java.awt.Color color) {
1281 # float red = (float) color.getRed();
1282 # float green = (float) color.getGreen();
1283 # float blue = (float) color.getBlue();
1284 # float denominator = 255.0;
1285 # Color.Builder resultBuilder =
1286 # Color
1287 # .newBuilder()
1288 # .setRed(red / denominator)
1289 # .setGreen(green / denominator)
1290 # .setBlue(blue / denominator);
1291 # int alpha = color.getAlpha();
1292 # if (alpha != 255) {
1293 # result.setAlpha(
1294 # FloatValue
1295 # .newBuilder()
1296 # .setValue(((float) alpha) / denominator)
1297 # .build());
1298 # }
1299 # return resultBuilder.build();
1300 # }
1301 # // ...
1302 #
1303 # Example (iOS / Obj-C):
1304 #
1305 # // ...
1306 # static UIColor* fromProto(Color* protocolor) {
1307 # float red = [protocolor red];
1308 # float green = [protocolor green];
1309 # float blue = [protocolor blue];
1310 # FloatValue* alpha_wrapper = [protocolor alpha];
1311 # float alpha = 1.0;
1312 # if (alpha_wrapper != nil) {
1313 # alpha = [alpha_wrapper value];
1314 # }
1315 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
1316 # }
1317 #
1318 # static Color* toProto(UIColor* color) {
1319 # CGFloat red, green, blue, alpha;
1320 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
1321 # return nil;
1322 # }
1323 # Color* result = [Color alloc] init];
1324 # [result setRed:red];
1325 # [result setGreen:green];
1326 # [result setBlue:blue];
1327 # if (alpha <= 0.9999) {
1328 # [result setAlpha:floatWrapperWithValue(alpha)];
1329 # }
1330 # [result autorelease];
1331 # return result;
1332 # }
1333 # // ...
1334 #
1335 # Example (JavaScript):
1336 #
1337 # // ...
1338 #
1339 # var protoToCssColor = function(rgb_color) {
1340 # var redFrac = rgb_color.red || 0.0;
1341 # var greenFrac = rgb_color.green || 0.0;
1342 # var blueFrac = rgb_color.blue || 0.0;
1343 # var red = Math.floor(redFrac * 255);
1344 # var green = Math.floor(greenFrac * 255);
1345 # var blue = Math.floor(blueFrac * 255);
1346 #
1347 # if (!('alpha' in rgb_color)) {
1348 # return rgbToCssColor_(red, green, blue);
1349 # }
1350 #
1351 # var alphaFrac = rgb_color.alpha.value || 0.0;
1352 # var rgbParams = [red, green, blue].join(',');
1353 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
1354 # };
1355 #
1356 # var rgbToCssColor_ = function(red, green, blue) {
1357 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
1358 # var hexString = rgbNumber.toString(16);
1359 # var missingZeros = 6 - hexString.length;
1360 # var resultBuilder = ['#'];
1361 # for (var i = 0; i < missingZeros; i++) {
1362 # resultBuilder.push('0');
1363 # }
1364 # resultBuilder.push(hexString);
1365 # return resultBuilder.join('');
1366 # };
1367 #
1368 # // ...
1369 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
1370 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
1371 # the final pixel color is defined by the equation:
1372 #
1373 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
1374 #
1375 # This means that a value of 1.0 corresponds to a solid color, whereas
1376 # a value of 0.0 corresponds to a completely transparent color. This
1377 # uses a wrapper message rather than a simple float scalar so that it is
1378 # possible to distinguish between a default value and the value being unset.
1379 # If omitted, this color object is to be rendered as a solid color
1380 # (as if the alpha value had been explicitly given with a value of 1.0).
1381 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
1382 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
1383 },
1384 "type": "A String", # How the value should be interpreted.
1385 "value": "A String", # The value this interpolation point uses. May be a formula.
1386 # Unused if type is MIN or
1387 # MAX.
1388 },
1389 "minpoint": { # A single interpolation point a gradient conditional format. # The starting interpolation point.
1390 # These pin the gradient color scale according to the color,
1391 # type and value chosen.
1392 "color": { # Represents a color in the RGBA color space. This representation is designed # The color this interpolation point should use.
1393 # for simplicity of conversion to/from color representations in various
1394 # languages over compactness; for example, the fields of this representation
1395 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
1396 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
1397 # method in iOS; and, with just a little work, it can be easily formatted into
1398 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
1399 #
1400 # Example (Java):
1401 #
1402 # import com.google.type.Color;
1403 #
1404 # // ...
1405 # public static java.awt.Color fromProto(Color protocolor) {
1406 # float alpha = protocolor.hasAlpha()
1407 # ? protocolor.getAlpha().getValue()
1408 # : 1.0;
1409 #
1410 # return new java.awt.Color(
1411 # protocolor.getRed(),
1412 # protocolor.getGreen(),
1413 # protocolor.getBlue(),
1414 # alpha);
1415 # }
1416 #
1417 # public static Color toProto(java.awt.Color color) {
1418 # float red = (float) color.getRed();
1419 # float green = (float) color.getGreen();
1420 # float blue = (float) color.getBlue();
1421 # float denominator = 255.0;
1422 # Color.Builder resultBuilder =
1423 # Color
1424 # .newBuilder()
1425 # .setRed(red / denominator)
1426 # .setGreen(green / denominator)
1427 # .setBlue(blue / denominator);
1428 # int alpha = color.getAlpha();
1429 # if (alpha != 255) {
1430 # result.setAlpha(
1431 # FloatValue
1432 # .newBuilder()
1433 # .setValue(((float) alpha) / denominator)
1434 # .build());
1435 # }
1436 # return resultBuilder.build();
1437 # }
1438 # // ...
1439 #
1440 # Example (iOS / Obj-C):
1441 #
1442 # // ...
1443 # static UIColor* fromProto(Color* protocolor) {
1444 # float red = [protocolor red];
1445 # float green = [protocolor green];
1446 # float blue = [protocolor blue];
1447 # FloatValue* alpha_wrapper = [protocolor alpha];
1448 # float alpha = 1.0;
1449 # if (alpha_wrapper != nil) {
1450 # alpha = [alpha_wrapper value];
1451 # }
1452 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
1453 # }
1454 #
1455 # static Color* toProto(UIColor* color) {
1456 # CGFloat red, green, blue, alpha;
1457 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
1458 # return nil;
1459 # }
1460 # Color* result = [Color alloc] init];
1461 # [result setRed:red];
1462 # [result setGreen:green];
1463 # [result setBlue:blue];
1464 # if (alpha <= 0.9999) {
1465 # [result setAlpha:floatWrapperWithValue(alpha)];
1466 # }
1467 # [result autorelease];
1468 # return result;
1469 # }
1470 # // ...
1471 #
1472 # Example (JavaScript):
1473 #
1474 # // ...
1475 #
1476 # var protoToCssColor = function(rgb_color) {
1477 # var redFrac = rgb_color.red || 0.0;
1478 # var greenFrac = rgb_color.green || 0.0;
1479 # var blueFrac = rgb_color.blue || 0.0;
1480 # var red = Math.floor(redFrac * 255);
1481 # var green = Math.floor(greenFrac * 255);
1482 # var blue = Math.floor(blueFrac * 255);
1483 #
1484 # if (!('alpha' in rgb_color)) {
1485 # return rgbToCssColor_(red, green, blue);
1486 # }
1487 #
1488 # var alphaFrac = rgb_color.alpha.value || 0.0;
1489 # var rgbParams = [red, green, blue].join(',');
1490 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
1491 # };
1492 #
1493 # var rgbToCssColor_ = function(red, green, blue) {
1494 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
1495 # var hexString = rgbNumber.toString(16);
1496 # var missingZeros = 6 - hexString.length;
1497 # var resultBuilder = ['#'];
1498 # for (var i = 0; i < missingZeros; i++) {
1499 # resultBuilder.push('0');
1500 # }
1501 # resultBuilder.push(hexString);
1502 # return resultBuilder.join('');
1503 # };
1504 #
1505 # // ...
1506 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
1507 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
1508 # the final pixel color is defined by the equation:
1509 #
1510 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
1511 #
1512 # This means that a value of 1.0 corresponds to a solid color, whereas
1513 # a value of 0.0 corresponds to a completely transparent color. This
1514 # uses a wrapper message rather than a simple float scalar so that it is
1515 # possible to distinguish between a default value and the value being unset.
1516 # If omitted, this color object is to be rendered as a solid color
1517 # (as if the alpha value had been explicitly given with a value of 1.0).
1518 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
1519 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
1520 },
1521 "type": "A String", # How the value should be interpreted.
1522 "value": "A String", # The value this interpolation point uses. May be a formula.
1523 # Unused if type is MIN or
1524 # MAX.
1525 },
1526 },
1527 },
1528 },
1529 "updateProtectedRange": { # Updates an existing protected range with the specified # Updates a protected range.
1530 # protectedRangeId.
1531 "fields": "A String", # The fields that should be updated. At least one field must be specified.
1532 # The root `protectedRange` is implied and should not be specified.
1533 # A single `"*"` can be used as short-hand for listing every field.
1534 "protectedRange": { # A protected range. # The protected range to update with the new properties. If a nonzero
1535 # protectedRangeId is
1536 # specified, the protected range will use that ID. (It is an error to
1537 # specify the ID of a protected range that already exists.)
1538 "unprotectedRanges": [ # The list of unprotected ranges within a protected sheet.
1539 # Unprotected ranges are only supported on protected sheets.
1540 { # A range on a sheet.
1541 # All indexes are zero-based.
1542 # Indexes are half open, e.g the start index is inclusive
1543 # and the end index is exclusive -- [start_index, end_index).
1544 # Missing indexes indicate the range is unbounded on that side.
1545 #
1546 # For example, if "Sheet1" is grid ID 0, then:
1547 #
1548 # Sheet1!A1:A1 == sheet_id: 0,
1549 # start_row_index: 0, end_row_index: 1,
1550 # start_column_index: 0, end_column_index: 1
1551 #
1552 # Sheet1!A3:B4 == sheet_id: 0,
1553 # start_row_index: 2, end_row_index: 4,
1554 # start_column_index: 0, end_column_index: 2
1555 #
1556 # Sheet1!A:B == sheet_id: 0,
1557 # start_column_index: 0, end_column_index: 2
1558 #
1559 # Sheet1!A5:B == sheet_id: 0,
1560 # start_row_index: 4,
1561 # start_column_index: 0, end_column_index: 2
1562 #
1563 # Sheet1 == sheet_id:0
1564 #
1565 # The start index must always be less than or equal to the end index.
1566 # If the start index equals the end index, then the range is empty.
1567 # Empty ranges are typically not meaningful and are usually rendered in the
1568 # UI as `#REF!`.
1569 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
1570 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
1571 "sheetId": 42, # The sheet this range is on.
1572 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
1573 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
1574 },
1575 ],
1576 "requestingUserCanEdit": True or False, # True if the user who requested this protected range can edit the
1577 # protected area.
1578 # This field is read-only.
1579 "description": "A String", # The description of this protected range.
1580 "namedRangeId": "A String", # The named range this protected range is backed by, if any.
1581 #
1582 # When writing, only one of range or namedRangeId
1583 # may be set.
1584 "editors": { # The editors of a protected range. # The users and groups with edit access to the protected range.
1585 # This field is only visible to users with edit access to the protected
1586 # range and the document.
1587 # Editors are not supported with warningOnly protection.
1588 "domainUsersCanEdit": True or False, # True if anyone in the document's domain has edit access to the protected
1589 # range. Domain protection is only supported on documents within a domain.
1590 "users": [ # The email addresses of users with edit access to the protected range.
1591 "A String",
1592 ],
1593 "groups": [ # The email addresses of groups with edit access to the protected range.
1594 "A String",
1595 ],
1596 },
1597 "protectedRangeId": 42, # The ID of the protected range.
1598 # This field is read-only.
1599 "warningOnly": True or False, # True if this this protected range will show a warning when editing.
1600 # Warning-based protection means that every user can edit data in the
1601 # protected range, except editing will prompt a warning asking the user
1602 # to confirm the edit.
1603 #
1604 # When warning: if this field is true, then editors is ignored.
1605 # Additionally, if this field is changed from true to false and the
1606 # `editors` field is not set (nor included in the field mask), then
1607 # the editors will be set to all the editors in the document.
1608 "range": { # A range on a sheet. # The range that is being protected.
1609 # The range may be fully unbounded, in which case this is considered
1610 # a protected sheet.
1611 #
1612 # When writing, only one of range or namedRangeId
1613 # may be set.
1614 # All indexes are zero-based.
1615 # Indexes are half open, e.g the start index is inclusive
1616 # and the end index is exclusive -- [start_index, end_index).
1617 # Missing indexes indicate the range is unbounded on that side.
1618 #
1619 # For example, if "Sheet1" is grid ID 0, then:
1620 #
1621 # Sheet1!A1:A1 == sheet_id: 0,
1622 # start_row_index: 0, end_row_index: 1,
1623 # start_column_index: 0, end_column_index: 1
1624 #
1625 # Sheet1!A3:B4 == sheet_id: 0,
1626 # start_row_index: 2, end_row_index: 4,
1627 # start_column_index: 0, end_column_index: 2
1628 #
1629 # Sheet1!A:B == sheet_id: 0,
1630 # start_column_index: 0, end_column_index: 2
1631 #
1632 # Sheet1!A5:B == sheet_id: 0,
1633 # start_row_index: 4,
1634 # start_column_index: 0, end_column_index: 2
1635 #
1636 # Sheet1 == sheet_id:0
1637 #
1638 # The start index must always be less than or equal to the end index.
1639 # If the start index equals the end index, then the range is empty.
1640 # Empty ranges are typically not meaningful and are usually rendered in the
1641 # UI as `#REF!`.
1642 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
1643 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
1644 "sheetId": 42, # The sheet this range is on.
1645 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
1646 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
1647 },
1648 },
1649 },
1650 "deleteDimension": { # Deletes the dimensions from the sheet. # Deletes rows or columns in a sheet.
1651 "range": { # A range along a single dimension on a sheet. # The dimensions to delete from the sheet.
1652 # All indexes are zero-based.
1653 # Indexes are half open: the start index is inclusive
1654 # and the end index is exclusive.
1655 # Missing indexes indicate the range is unbounded on that side.
1656 "endIndex": 42, # The end (exclusive) of the span, or not set if unbounded.
1657 "startIndex": 42, # The start (inclusive) of the span, or not set if unbounded.
1658 "sheetId": 42, # The sheet this span is on.
1659 "dimension": "A String", # The dimension of the span.
1660 },
1661 },
1662 "addProtectedRange": { # Adds a new protected range. # Adds a protected range.
1663 "protectedRange": { # A protected range. # The protected range to be added.
1664 "unprotectedRanges": [ # The list of unprotected ranges within a protected sheet.
1665 # Unprotected ranges are only supported on protected sheets.
1666 { # A range on a sheet.
1667 # All indexes are zero-based.
1668 # Indexes are half open, e.g the start index is inclusive
1669 # and the end index is exclusive -- [start_index, end_index).
1670 # Missing indexes indicate the range is unbounded on that side.
1671 #
1672 # For example, if "Sheet1" is grid ID 0, then:
1673 #
1674 # Sheet1!A1:A1 == sheet_id: 0,
1675 # start_row_index: 0, end_row_index: 1,
1676 # start_column_index: 0, end_column_index: 1
1677 #
1678 # Sheet1!A3:B4 == sheet_id: 0,
1679 # start_row_index: 2, end_row_index: 4,
1680 # start_column_index: 0, end_column_index: 2
1681 #
1682 # Sheet1!A:B == sheet_id: 0,
1683 # start_column_index: 0, end_column_index: 2
1684 #
1685 # Sheet1!A5:B == sheet_id: 0,
1686 # start_row_index: 4,
1687 # start_column_index: 0, end_column_index: 2
1688 #
1689 # Sheet1 == sheet_id:0
1690 #
1691 # The start index must always be less than or equal to the end index.
1692 # If the start index equals the end index, then the range is empty.
1693 # Empty ranges are typically not meaningful and are usually rendered in the
1694 # UI as `#REF!`.
1695 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
1696 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
1697 "sheetId": 42, # The sheet this range is on.
1698 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
1699 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
1700 },
1701 ],
1702 "requestingUserCanEdit": True or False, # True if the user who requested this protected range can edit the
1703 # protected area.
1704 # This field is read-only.
1705 "description": "A String", # The description of this protected range.
1706 "namedRangeId": "A String", # The named range this protected range is backed by, if any.
1707 #
1708 # When writing, only one of range or namedRangeId
1709 # may be set.
1710 "editors": { # The editors of a protected range. # The users and groups with edit access to the protected range.
1711 # This field is only visible to users with edit access to the protected
1712 # range and the document.
1713 # Editors are not supported with warningOnly protection.
1714 "domainUsersCanEdit": True or False, # True if anyone in the document's domain has edit access to the protected
1715 # range. Domain protection is only supported on documents within a domain.
1716 "users": [ # The email addresses of users with edit access to the protected range.
1717 "A String",
1718 ],
1719 "groups": [ # The email addresses of groups with edit access to the protected range.
1720 "A String",
1721 ],
1722 },
1723 "protectedRangeId": 42, # The ID of the protected range.
1724 # This field is read-only.
1725 "warningOnly": True or False, # True if this this protected range will show a warning when editing.
1726 # Warning-based protection means that every user can edit data in the
1727 # protected range, except editing will prompt a warning asking the user
1728 # to confirm the edit.
1729 #
1730 # When warning: if this field is true, then editors is ignored.
1731 # Additionally, if this field is changed from true to false and the
1732 # `editors` field is not set (nor included in the field mask), then
1733 # the editors will be set to all the editors in the document.
1734 "range": { # A range on a sheet. # The range that is being protected.
1735 # The range may be fully unbounded, in which case this is considered
1736 # a protected sheet.
1737 #
1738 # When writing, only one of range or namedRangeId
1739 # may be set.
1740 # All indexes are zero-based.
1741 # Indexes are half open, e.g the start index is inclusive
1742 # and the end index is exclusive -- [start_index, end_index).
1743 # Missing indexes indicate the range is unbounded on that side.
1744 #
1745 # For example, if "Sheet1" is grid ID 0, then:
1746 #
1747 # Sheet1!A1:A1 == sheet_id: 0,
1748 # start_row_index: 0, end_row_index: 1,
1749 # start_column_index: 0, end_column_index: 1
1750 #
1751 # Sheet1!A3:B4 == sheet_id: 0,
1752 # start_row_index: 2, end_row_index: 4,
1753 # start_column_index: 0, end_column_index: 2
1754 #
1755 # Sheet1!A:B == sheet_id: 0,
1756 # start_column_index: 0, end_column_index: 2
1757 #
1758 # Sheet1!A5:B == sheet_id: 0,
1759 # start_row_index: 4,
1760 # start_column_index: 0, end_column_index: 2
1761 #
1762 # Sheet1 == sheet_id:0
1763 #
1764 # The start index must always be less than or equal to the end index.
1765 # If the start index equals the end index, then the range is empty.
1766 # Empty ranges are typically not meaningful and are usually rendered in the
1767 # UI as `#REF!`.
1768 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
1769 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
1770 "sheetId": 42, # The sheet this range is on.
1771 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
1772 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
1773 },
1774 },
1775 },
1776 "deleteEmbeddedObject": { # Deletes the embedded object with the given ID. # Deletes an embedded object (e.g, chart, image) in a sheet.
1777 "objectId": 42, # The ID of the embedded object to delete.
1778 },
1779 "pasteData": { # Inserts data into the spreadsheet starting at the specified coordinate. # Pastes data (HTML or delimited) into a sheet.
1780 "coordinate": { # A coordinate in a sheet. # The coordinate at which the data should start being inserted.
1781 # All indexes are zero-based.
1782 "rowIndex": 42, # The row index of the coordinate.
1783 "columnIndex": 42, # The column index of the coordinate.
1784 "sheetId": 42, # The sheet this coordinate is on.
1785 },
1786 "type": "A String", # How the data should be pasted.
1787 "delimiter": "A String", # The delimiter in the data.
1788 "html": True or False, # True if the data is HTML.
1789 "data": "A String", # The data to insert.
1790 },
1791 "appendCells": { # Adds new cells to the last row with data in a sheet, # Appends cells to the last row with data in a sheet.
1792 # inserting new rows into the sheet if necessary.
1793 "fields": "A String", # The fields of CellData that should be updated.
1794 # At least one field must be specified.
1795 # The root is the CellData; 'row.values.' should not be specified.
1796 # A single `"*"` can be used as short-hand for listing every field.
1797 "rows": [ # The data to append.
1798 { # Data about each cell in a row.
1799 "values": [ # The values in the row, one per column.
1800 { # Data about a specific cell.
1801 "pivotTable": { # A pivot table. # A pivot table anchored at this cell. The size of pivot table itself
1802 # is computed dynamically based on its data, grouping, filters, values,
1803 # etc... Only the top-left cell of the pivot table contains the pivot table
1804 # definition. The other cells will contain the calculated values of the
1805 # results of the pivot in their effectiveValue fields.
1806 "valueLayout": "A String", # Whether values should be listed horizontally (as columns)
1807 # or vertically (as rows).
1808 "rows": [ # Each row grouping in the pivot table.
1809 { # A single grouping (either row or column) in a pivot table.
1810 "showTotals": True or False, # True if the pivot table should include the totals for this grouping.
1811 "valueMetadata": [ # Metadata about values in the grouping.
1812 { # Metadata about a value in a pivot grouping.
1813 "collapsed": True or False, # True if the data corresponding to the value is collapsed.
1814 "value": { # The kinds of value that a cell in a spreadsheet can have. # The calculated value the metadata corresponds to.
1815 # (Note that formulaValue is not valid,
1816 # because the values will be calculated.)
1817 "numberValue": 3.14, # Represents a double value.
1818 # Note: Dates, Times and DateTimes are represented as doubles in
1819 # "serial number" format.
1820 "boolValue": True or False, # Represents a boolean value.
1821 "formulaValue": "A String", # Represents a formula.
1822 "stringValue": "A String", # Represents a string value.
1823 # Leading single quotes are not included. For example, if the user typed
1824 # `'123` into the UI, this would be represented as a `stringValue` of
1825 # `"123"`.
1826 "errorValue": { # An error in a cell. # Represents an error.
1827 # This field is read-only.
1828 "message": "A String", # A message with more information about the error
1829 # (in the spreadsheet's locale).
1830 "type": "A String", # The type of error.
1831 },
1832 },
1833 },
1834 ],
1835 "valueBucket": { # Information about which values in a pivot group should be used for sorting. # The bucket of the opposite pivot group to sort by.
1836 # If not specified, sorting is alphabetical by this group's values.
1837 "buckets": [ # Determines the bucket from which values are chosen to sort.
1838 #
1839 # For example, in a pivot table with one row group & two column groups,
1840 # the row group can list up to two values. The first value corresponds
1841 # to a value within the first column group, and the second value
1842 # corresponds to a value in the second column group. If no values
1843 # are listed, this would indicate that the row should be sorted according
1844 # to the "Grand Total" over the column groups. If a single value is listed,
1845 # this would correspond to using the "Total" of that bucket.
1846 { # The kinds of value that a cell in a spreadsheet can have.
1847 "numberValue": 3.14, # Represents a double value.
1848 # Note: Dates, Times and DateTimes are represented as doubles in
1849 # "serial number" format.
1850 "boolValue": True or False, # Represents a boolean value.
1851 "formulaValue": "A String", # Represents a formula.
1852 "stringValue": "A String", # Represents a string value.
1853 # Leading single quotes are not included. For example, if the user typed
1854 # `'123` into the UI, this would be represented as a `stringValue` of
1855 # `"123"`.
1856 "errorValue": { # An error in a cell. # Represents an error.
1857 # This field is read-only.
1858 "message": "A String", # A message with more information about the error
1859 # (in the spreadsheet's locale).
1860 "type": "A String", # The type of error.
1861 },
1862 },
1863 ],
1864 "valuesIndex": 42, # The offset in the [PivotTable.values] list which the values in this
1865 # grouping should be sorted by.
1866 },
1867 "sortOrder": "A String", # The order the values in this group should be sorted.
1868 "sourceColumnOffset": 42, # The column offset of the source range that this grouping is based on.
1869 #
1870 # For example, if the source was `C10:E15', a `sourceColumnOffset` of `0`
1871 # means this group refers to column `C`, whereas the offset `1` would refer
1872 # to column `D`.
1873 },
1874 ],
1875 "source": { # A range on a sheet. # The range the pivot table is reading data from.
1876 # All indexes are zero-based.
1877 # Indexes are half open, e.g the start index is inclusive
1878 # and the end index is exclusive -- [start_index, end_index).
1879 # Missing indexes indicate the range is unbounded on that side.
1880 #
1881 # For example, if "Sheet1" is grid ID 0, then:
1882 #
1883 # Sheet1!A1:A1 == sheet_id: 0,
1884 # start_row_index: 0, end_row_index: 1,
1885 # start_column_index: 0, end_column_index: 1
1886 #
1887 # Sheet1!A3:B4 == sheet_id: 0,
1888 # start_row_index: 2, end_row_index: 4,
1889 # start_column_index: 0, end_column_index: 2
1890 #
1891 # Sheet1!A:B == sheet_id: 0,
1892 # start_column_index: 0, end_column_index: 2
1893 #
1894 # Sheet1!A5:B == sheet_id: 0,
1895 # start_row_index: 4,
1896 # start_column_index: 0, end_column_index: 2
1897 #
1898 # Sheet1 == sheet_id:0
1899 #
1900 # The start index must always be less than or equal to the end index.
1901 # If the start index equals the end index, then the range is empty.
1902 # Empty ranges are typically not meaningful and are usually rendered in the
1903 # UI as `#REF!`.
1904 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
1905 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
1906 "sheetId": 42, # The sheet this range is on.
1907 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
1908 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
1909 },
1910 "values": [ # A list of values to include in the pivot table.
1911 { # The definition of how a value in a pivot table should be calculated.
1912 "formula": "A String", # A custom formula to calculate the value. The formula must start
1913 # with an `=` character.
1914 "summarizeFunction": "A String", # A function to summarize the value.
1915 # If formula is set, the only supported values are
1916 # SUM and
1917 # CUSTOM.
1918 # If sourceColumnOffset is set, then `CUSTOM`
1919 # is not supported.
1920 "sourceColumnOffset": 42, # The column offset of the source range that this value reads from.
1921 #
1922 # For example, if the source was `C10:E15', a `sourceColumnOffset` of `0`
1923 # means this value refers to column `C`, whereas the offset `1` would
1924 # refer to column `D`.
1925 "name": "A String", # A name to use for the value. This is only used if formula was set.
1926 # Otherwise, the column name is used.
1927 },
1928 ],
1929 "criteria": { # An optional mapping of filters per source column offset.
1930 #
1931 # The filters will be applied before aggregating data into the pivot table.
1932 # The map's key is the column offset of the source range that you want to
1933 # filter, and the value is the criteria for that column.
1934 #
1935 # For example, if the source was `C10:E15', a key of `0` will have the filter
1936 # for column `C`, whereas the key `1` is for column `D`.
1937 "a_key": { # Criteria for showing/hiding rows in a pivot table.
1938 "visibleValues": [ # Values that should be included. Values not listed here are excluded.
1939 "A String",
1940 ],
1941 },
1942 },
1943 "columns": [ # Each column grouping in the pivot table.
1944 { # A single grouping (either row or column) in a pivot table.
1945 "showTotals": True or False, # True if the pivot table should include the totals for this grouping.
1946 "valueMetadata": [ # Metadata about values in the grouping.
1947 { # Metadata about a value in a pivot grouping.
1948 "collapsed": True or False, # True if the data corresponding to the value is collapsed.
1949 "value": { # The kinds of value that a cell in a spreadsheet can have. # The calculated value the metadata corresponds to.
1950 # (Note that formulaValue is not valid,
1951 # because the values will be calculated.)
1952 "numberValue": 3.14, # Represents a double value.
1953 # Note: Dates, Times and DateTimes are represented as doubles in
1954 # "serial number" format.
1955 "boolValue": True or False, # Represents a boolean value.
1956 "formulaValue": "A String", # Represents a formula.
1957 "stringValue": "A String", # Represents a string value.
1958 # Leading single quotes are not included. For example, if the user typed
1959 # `'123` into the UI, this would be represented as a `stringValue` of
1960 # `"123"`.
1961 "errorValue": { # An error in a cell. # Represents an error.
1962 # This field is read-only.
1963 "message": "A String", # A message with more information about the error
1964 # (in the spreadsheet's locale).
1965 "type": "A String", # The type of error.
1966 },
1967 },
1968 },
1969 ],
1970 "valueBucket": { # Information about which values in a pivot group should be used for sorting. # The bucket of the opposite pivot group to sort by.
1971 # If not specified, sorting is alphabetical by this group's values.
1972 "buckets": [ # Determines the bucket from which values are chosen to sort.
1973 #
1974 # For example, in a pivot table with one row group & two column groups,
1975 # the row group can list up to two values. The first value corresponds
1976 # to a value within the first column group, and the second value
1977 # corresponds to a value in the second column group. If no values
1978 # are listed, this would indicate that the row should be sorted according
1979 # to the "Grand Total" over the column groups. If a single value is listed,
1980 # this would correspond to using the "Total" of that bucket.
1981 { # The kinds of value that a cell in a spreadsheet can have.
1982 "numberValue": 3.14, # Represents a double value.
1983 # Note: Dates, Times and DateTimes are represented as doubles in
1984 # "serial number" format.
1985 "boolValue": True or False, # Represents a boolean value.
1986 "formulaValue": "A String", # Represents a formula.
1987 "stringValue": "A String", # Represents a string value.
1988 # Leading single quotes are not included. For example, if the user typed
1989 # `'123` into the UI, this would be represented as a `stringValue` of
1990 # `"123"`.
1991 "errorValue": { # An error in a cell. # Represents an error.
1992 # This field is read-only.
1993 "message": "A String", # A message with more information about the error
1994 # (in the spreadsheet's locale).
1995 "type": "A String", # The type of error.
1996 },
1997 },
1998 ],
1999 "valuesIndex": 42, # The offset in the [PivotTable.values] list which the values in this
2000 # grouping should be sorted by.
2001 },
2002 "sortOrder": "A String", # The order the values in this group should be sorted.
2003 "sourceColumnOffset": 42, # The column offset of the source range that this grouping is based on.
2004 #
2005 # For example, if the source was `C10:E15', a `sourceColumnOffset` of `0`
2006 # means this group refers to column `C`, whereas the offset `1` would refer
2007 # to column `D`.
2008 },
2009 ],
2010 },
2011 "hyperlink": "A String", # A hyperlink this cell points to, if any.
2012 # This field is read-only. (To set it, use a `=HYPERLINK` formula.)
2013 "effectiveValue": { # The kinds of value that a cell in a spreadsheet can have. # The effective value of the cell. For cells with formulas, this will be
2014 # the calculated value. For cells with literals, this will be
2015 # the same as the user_entered_value.
2016 # This field is read-only.
2017 "numberValue": 3.14, # Represents a double value.
2018 # Note: Dates, Times and DateTimes are represented as doubles in
2019 # "serial number" format.
2020 "boolValue": True or False, # Represents a boolean value.
2021 "formulaValue": "A String", # Represents a formula.
2022 "stringValue": "A String", # Represents a string value.
2023 # Leading single quotes are not included. For example, if the user typed
2024 # `'123` into the UI, this would be represented as a `stringValue` of
2025 # `"123"`.
2026 "errorValue": { # An error in a cell. # Represents an error.
2027 # This field is read-only.
2028 "message": "A String", # A message with more information about the error
2029 # (in the spreadsheet's locale).
2030 "type": "A String", # The type of error.
2031 },
2032 },
2033 "formattedValue": "A String", # The formatted value of the cell.
2034 # This is the value as it's shown to the user.
2035 # This field is read-only.
2036 "userEnteredValue": { # The kinds of value that a cell in a spreadsheet can have. # The value the user entered in the cell. e.g, `1234`, `'Hello'`, or `=NOW()`
2037 # Note: Dates, Times and DateTimes are represented as doubles in
2038 # serial number format.
2039 "numberValue": 3.14, # Represents a double value.
2040 # Note: Dates, Times and DateTimes are represented as doubles in
2041 # "serial number" format.
2042 "boolValue": True or False, # Represents a boolean value.
2043 "formulaValue": "A String", # Represents a formula.
2044 "stringValue": "A String", # Represents a string value.
2045 # Leading single quotes are not included. For example, if the user typed
2046 # `'123` into the UI, this would be represented as a `stringValue` of
2047 # `"123"`.
2048 "errorValue": { # An error in a cell. # Represents an error.
2049 # This field is read-only.
2050 "message": "A String", # A message with more information about the error
2051 # (in the spreadsheet's locale).
2052 "type": "A String", # The type of error.
2053 },
2054 },
2055 "note": "A String", # Any note on the cell.
2056 "effectiveFormat": { # The format of a cell. # The effective format being used by the cell.
2057 # This includes the results of applying any conditional formatting and,
2058 # if the cell contains a formula, the computed number format.
2059 # If the effective format is the default format, effective format will
2060 # not be written.
2061 # This field is read-only.
2062 "numberFormat": { # The number format of a cell. # A format describing how number values should be represented to the user.
2063 # When updating, all fields must be set.
2064 "pattern": "A String", # Pattern string used for formatting.
2065 "type": "A String", # The type of the number format.
2066 },
2067 "textDirection": "A String", # The direction of the text in the cell.
2068 "padding": { # The amount of padding around the cell, in pixels. # The padding of the cell.
2069 # When updating padding, every field must be specified.
2070 "top": 42, # The top padding of the cell.
2071 "right": 42, # The right padding of the cell.
2072 "bottom": 42, # The bottom padding of the cell.
2073 "left": 42, # The left padding of the cell.
2074 },
2075 "horizontalAlignment": "A String", # The horizontal alignment of the value in cell.
2076 "backgroundColor": { # Represents a color in the RGBA color space. This representation is designed # The background color of the cell.
2077 # for simplicity of conversion to/from color representations in various
2078 # languages over compactness; for example, the fields of this representation
2079 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
2080 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
2081 # method in iOS; and, with just a little work, it can be easily formatted into
2082 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
2083 #
2084 # Example (Java):
2085 #
2086 # import com.google.type.Color;
2087 #
2088 # // ...
2089 # public static java.awt.Color fromProto(Color protocolor) {
2090 # float alpha = protocolor.hasAlpha()
2091 # ? protocolor.getAlpha().getValue()
2092 # : 1.0;
2093 #
2094 # return new java.awt.Color(
2095 # protocolor.getRed(),
2096 # protocolor.getGreen(),
2097 # protocolor.getBlue(),
2098 # alpha);
2099 # }
2100 #
2101 # public static Color toProto(java.awt.Color color) {
2102 # float red = (float) color.getRed();
2103 # float green = (float) color.getGreen();
2104 # float blue = (float) color.getBlue();
2105 # float denominator = 255.0;
2106 # Color.Builder resultBuilder =
2107 # Color
2108 # .newBuilder()
2109 # .setRed(red / denominator)
2110 # .setGreen(green / denominator)
2111 # .setBlue(blue / denominator);
2112 # int alpha = color.getAlpha();
2113 # if (alpha != 255) {
2114 # result.setAlpha(
2115 # FloatValue
2116 # .newBuilder()
2117 # .setValue(((float) alpha) / denominator)
2118 # .build());
2119 # }
2120 # return resultBuilder.build();
2121 # }
2122 # // ...
2123 #
2124 # Example (iOS / Obj-C):
2125 #
2126 # // ...
2127 # static UIColor* fromProto(Color* protocolor) {
2128 # float red = [protocolor red];
2129 # float green = [protocolor green];
2130 # float blue = [protocolor blue];
2131 # FloatValue* alpha_wrapper = [protocolor alpha];
2132 # float alpha = 1.0;
2133 # if (alpha_wrapper != nil) {
2134 # alpha = [alpha_wrapper value];
2135 # }
2136 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
2137 # }
2138 #
2139 # static Color* toProto(UIColor* color) {
2140 # CGFloat red, green, blue, alpha;
2141 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
2142 # return nil;
2143 # }
2144 # Color* result = [Color alloc] init];
2145 # [result setRed:red];
2146 # [result setGreen:green];
2147 # [result setBlue:blue];
2148 # if (alpha <= 0.9999) {
2149 # [result setAlpha:floatWrapperWithValue(alpha)];
2150 # }
2151 # [result autorelease];
2152 # return result;
2153 # }
2154 # // ...
2155 #
2156 # Example (JavaScript):
2157 #
2158 # // ...
2159 #
2160 # var protoToCssColor = function(rgb_color) {
2161 # var redFrac = rgb_color.red || 0.0;
2162 # var greenFrac = rgb_color.green || 0.0;
2163 # var blueFrac = rgb_color.blue || 0.0;
2164 # var red = Math.floor(redFrac * 255);
2165 # var green = Math.floor(greenFrac * 255);
2166 # var blue = Math.floor(blueFrac * 255);
2167 #
2168 # if (!('alpha' in rgb_color)) {
2169 # return rgbToCssColor_(red, green, blue);
2170 # }
2171 #
2172 # var alphaFrac = rgb_color.alpha.value || 0.0;
2173 # var rgbParams = [red, green, blue].join(',');
2174 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
2175 # };
2176 #
2177 # var rgbToCssColor_ = function(red, green, blue) {
2178 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
2179 # var hexString = rgbNumber.toString(16);
2180 # var missingZeros = 6 - hexString.length;
2181 # var resultBuilder = ['#'];
2182 # for (var i = 0; i < missingZeros; i++) {
2183 # resultBuilder.push('0');
2184 # }
2185 # resultBuilder.push(hexString);
2186 # return resultBuilder.join('');
2187 # };
2188 #
2189 # // ...
2190 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
2191 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
2192 # the final pixel color is defined by the equation:
2193 #
2194 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
2195 #
2196 # This means that a value of 1.0 corresponds to a solid color, whereas
2197 # a value of 0.0 corresponds to a completely transparent color. This
2198 # uses a wrapper message rather than a simple float scalar so that it is
2199 # possible to distinguish between a default value and the value being unset.
2200 # If omitted, this color object is to be rendered as a solid color
2201 # (as if the alpha value had been explicitly given with a value of 1.0).
2202 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
2203 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
2204 },
2205 "verticalAlignment": "A String", # The vertical alignment of the value in cell.
2206 "textFormat": { # The format of a run of text in a cell. # The format of the text in the cell (unless overridden by a format run).
2207 # Absent values indicate that the field isn't specified.
2208 "foregroundColor": { # Represents a color in the RGBA color space. This representation is designed # The foreground color of the text.
2209 # for simplicity of conversion to/from color representations in various
2210 # languages over compactness; for example, the fields of this representation
2211 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
2212 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
2213 # method in iOS; and, with just a little work, it can be easily formatted into
2214 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
2215 #
2216 # Example (Java):
2217 #
2218 # import com.google.type.Color;
2219 #
2220 # // ...
2221 # public static java.awt.Color fromProto(Color protocolor) {
2222 # float alpha = protocolor.hasAlpha()
2223 # ? protocolor.getAlpha().getValue()
2224 # : 1.0;
2225 #
2226 # return new java.awt.Color(
2227 # protocolor.getRed(),
2228 # protocolor.getGreen(),
2229 # protocolor.getBlue(),
2230 # alpha);
2231 # }
2232 #
2233 # public static Color toProto(java.awt.Color color) {
2234 # float red = (float) color.getRed();
2235 # float green = (float) color.getGreen();
2236 # float blue = (float) color.getBlue();
2237 # float denominator = 255.0;
2238 # Color.Builder resultBuilder =
2239 # Color
2240 # .newBuilder()
2241 # .setRed(red / denominator)
2242 # .setGreen(green / denominator)
2243 # .setBlue(blue / denominator);
2244 # int alpha = color.getAlpha();
2245 # if (alpha != 255) {
2246 # result.setAlpha(
2247 # FloatValue
2248 # .newBuilder()
2249 # .setValue(((float) alpha) / denominator)
2250 # .build());
2251 # }
2252 # return resultBuilder.build();
2253 # }
2254 # // ...
2255 #
2256 # Example (iOS / Obj-C):
2257 #
2258 # // ...
2259 # static UIColor* fromProto(Color* protocolor) {
2260 # float red = [protocolor red];
2261 # float green = [protocolor green];
2262 # float blue = [protocolor blue];
2263 # FloatValue* alpha_wrapper = [protocolor alpha];
2264 # float alpha = 1.0;
2265 # if (alpha_wrapper != nil) {
2266 # alpha = [alpha_wrapper value];
2267 # }
2268 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
2269 # }
2270 #
2271 # static Color* toProto(UIColor* color) {
2272 # CGFloat red, green, blue, alpha;
2273 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
2274 # return nil;
2275 # }
2276 # Color* result = [Color alloc] init];
2277 # [result setRed:red];
2278 # [result setGreen:green];
2279 # [result setBlue:blue];
2280 # if (alpha <= 0.9999) {
2281 # [result setAlpha:floatWrapperWithValue(alpha)];
2282 # }
2283 # [result autorelease];
2284 # return result;
2285 # }
2286 # // ...
2287 #
2288 # Example (JavaScript):
2289 #
2290 # // ...
2291 #
2292 # var protoToCssColor = function(rgb_color) {
2293 # var redFrac = rgb_color.red || 0.0;
2294 # var greenFrac = rgb_color.green || 0.0;
2295 # var blueFrac = rgb_color.blue || 0.0;
2296 # var red = Math.floor(redFrac * 255);
2297 # var green = Math.floor(greenFrac * 255);
2298 # var blue = Math.floor(blueFrac * 255);
2299 #
2300 # if (!('alpha' in rgb_color)) {
2301 # return rgbToCssColor_(red, green, blue);
2302 # }
2303 #
2304 # var alphaFrac = rgb_color.alpha.value || 0.0;
2305 # var rgbParams = [red, green, blue].join(',');
2306 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
2307 # };
2308 #
2309 # var rgbToCssColor_ = function(red, green, blue) {
2310 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
2311 # var hexString = rgbNumber.toString(16);
2312 # var missingZeros = 6 - hexString.length;
2313 # var resultBuilder = ['#'];
2314 # for (var i = 0; i < missingZeros; i++) {
2315 # resultBuilder.push('0');
2316 # }
2317 # resultBuilder.push(hexString);
2318 # return resultBuilder.join('');
2319 # };
2320 #
2321 # // ...
2322 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
2323 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
2324 # the final pixel color is defined by the equation:
2325 #
2326 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
2327 #
2328 # This means that a value of 1.0 corresponds to a solid color, whereas
2329 # a value of 0.0 corresponds to a completely transparent color. This
2330 # uses a wrapper message rather than a simple float scalar so that it is
2331 # possible to distinguish between a default value and the value being unset.
2332 # If omitted, this color object is to be rendered as a solid color
2333 # (as if the alpha value had been explicitly given with a value of 1.0).
2334 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
2335 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
2336 },
2337 "bold": True or False, # True if the text is bold.
2338 "strikethrough": True or False, # True if the text has a strikethrough.
2339 "fontFamily": "A String", # The font family.
2340 "fontSize": 42, # The size of the font.
2341 "italic": True or False, # True if the text is italicized.
2342 "underline": True or False, # True if the text is underlined.
2343 },
2344 "hyperlinkDisplayType": "A String", # How a hyperlink, if it exists, should be displayed in the cell.
2345 "borders": { # The borders of the cell. # The borders of the cell.
2346 "top": { # A border along a cell. # The top border of the cell.
2347 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
2348 # for simplicity of conversion to/from color representations in various
2349 # languages over compactness; for example, the fields of this representation
2350 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
2351 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
2352 # method in iOS; and, with just a little work, it can be easily formatted into
2353 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
2354 #
2355 # Example (Java):
2356 #
2357 # import com.google.type.Color;
2358 #
2359 # // ...
2360 # public static java.awt.Color fromProto(Color protocolor) {
2361 # float alpha = protocolor.hasAlpha()
2362 # ? protocolor.getAlpha().getValue()
2363 # : 1.0;
2364 #
2365 # return new java.awt.Color(
2366 # protocolor.getRed(),
2367 # protocolor.getGreen(),
2368 # protocolor.getBlue(),
2369 # alpha);
2370 # }
2371 #
2372 # public static Color toProto(java.awt.Color color) {
2373 # float red = (float) color.getRed();
2374 # float green = (float) color.getGreen();
2375 # float blue = (float) color.getBlue();
2376 # float denominator = 255.0;
2377 # Color.Builder resultBuilder =
2378 # Color
2379 # .newBuilder()
2380 # .setRed(red / denominator)
2381 # .setGreen(green / denominator)
2382 # .setBlue(blue / denominator);
2383 # int alpha = color.getAlpha();
2384 # if (alpha != 255) {
2385 # result.setAlpha(
2386 # FloatValue
2387 # .newBuilder()
2388 # .setValue(((float) alpha) / denominator)
2389 # .build());
2390 # }
2391 # return resultBuilder.build();
2392 # }
2393 # // ...
2394 #
2395 # Example (iOS / Obj-C):
2396 #
2397 # // ...
2398 # static UIColor* fromProto(Color* protocolor) {
2399 # float red = [protocolor red];
2400 # float green = [protocolor green];
2401 # float blue = [protocolor blue];
2402 # FloatValue* alpha_wrapper = [protocolor alpha];
2403 # float alpha = 1.0;
2404 # if (alpha_wrapper != nil) {
2405 # alpha = [alpha_wrapper value];
2406 # }
2407 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
2408 # }
2409 #
2410 # static Color* toProto(UIColor* color) {
2411 # CGFloat red, green, blue, alpha;
2412 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
2413 # return nil;
2414 # }
2415 # Color* result = [Color alloc] init];
2416 # [result setRed:red];
2417 # [result setGreen:green];
2418 # [result setBlue:blue];
2419 # if (alpha <= 0.9999) {
2420 # [result setAlpha:floatWrapperWithValue(alpha)];
2421 # }
2422 # [result autorelease];
2423 # return result;
2424 # }
2425 # // ...
2426 #
2427 # Example (JavaScript):
2428 #
2429 # // ...
2430 #
2431 # var protoToCssColor = function(rgb_color) {
2432 # var redFrac = rgb_color.red || 0.0;
2433 # var greenFrac = rgb_color.green || 0.0;
2434 # var blueFrac = rgb_color.blue || 0.0;
2435 # var red = Math.floor(redFrac * 255);
2436 # var green = Math.floor(greenFrac * 255);
2437 # var blue = Math.floor(blueFrac * 255);
2438 #
2439 # if (!('alpha' in rgb_color)) {
2440 # return rgbToCssColor_(red, green, blue);
2441 # }
2442 #
2443 # var alphaFrac = rgb_color.alpha.value || 0.0;
2444 # var rgbParams = [red, green, blue].join(',');
2445 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
2446 # };
2447 #
2448 # var rgbToCssColor_ = function(red, green, blue) {
2449 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
2450 # var hexString = rgbNumber.toString(16);
2451 # var missingZeros = 6 - hexString.length;
2452 # var resultBuilder = ['#'];
2453 # for (var i = 0; i < missingZeros; i++) {
2454 # resultBuilder.push('0');
2455 # }
2456 # resultBuilder.push(hexString);
2457 # return resultBuilder.join('');
2458 # };
2459 #
2460 # // ...
2461 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
2462 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
2463 # the final pixel color is defined by the equation:
2464 #
2465 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
2466 #
2467 # This means that a value of 1.0 corresponds to a solid color, whereas
2468 # a value of 0.0 corresponds to a completely transparent color. This
2469 # uses a wrapper message rather than a simple float scalar so that it is
2470 # possible to distinguish between a default value and the value being unset.
2471 # If omitted, this color object is to be rendered as a solid color
2472 # (as if the alpha value had been explicitly given with a value of 1.0).
2473 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
2474 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
2475 },
2476 "width": 42, # The width of the border, in pixels.
2477 # Border widths must be between 0 and 3 pixels.
2478 "style": "A String", # The style of the border.
2479 },
2480 "right": { # A border along a cell. # The right border of the cell.
2481 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
2482 # for simplicity of conversion to/from color representations in various
2483 # languages over compactness; for example, the fields of this representation
2484 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
2485 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
2486 # method in iOS; and, with just a little work, it can be easily formatted into
2487 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
2488 #
2489 # Example (Java):
2490 #
2491 # import com.google.type.Color;
2492 #
2493 # // ...
2494 # public static java.awt.Color fromProto(Color protocolor) {
2495 # float alpha = protocolor.hasAlpha()
2496 # ? protocolor.getAlpha().getValue()
2497 # : 1.0;
2498 #
2499 # return new java.awt.Color(
2500 # protocolor.getRed(),
2501 # protocolor.getGreen(),
2502 # protocolor.getBlue(),
2503 # alpha);
2504 # }
2505 #
2506 # public static Color toProto(java.awt.Color color) {
2507 # float red = (float) color.getRed();
2508 # float green = (float) color.getGreen();
2509 # float blue = (float) color.getBlue();
2510 # float denominator = 255.0;
2511 # Color.Builder resultBuilder =
2512 # Color
2513 # .newBuilder()
2514 # .setRed(red / denominator)
2515 # .setGreen(green / denominator)
2516 # .setBlue(blue / denominator);
2517 # int alpha = color.getAlpha();
2518 # if (alpha != 255) {
2519 # result.setAlpha(
2520 # FloatValue
2521 # .newBuilder()
2522 # .setValue(((float) alpha) / denominator)
2523 # .build());
2524 # }
2525 # return resultBuilder.build();
2526 # }
2527 # // ...
2528 #
2529 # Example (iOS / Obj-C):
2530 #
2531 # // ...
2532 # static UIColor* fromProto(Color* protocolor) {
2533 # float red = [protocolor red];
2534 # float green = [protocolor green];
2535 # float blue = [protocolor blue];
2536 # FloatValue* alpha_wrapper = [protocolor alpha];
2537 # float alpha = 1.0;
2538 # if (alpha_wrapper != nil) {
2539 # alpha = [alpha_wrapper value];
2540 # }
2541 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
2542 # }
2543 #
2544 # static Color* toProto(UIColor* color) {
2545 # CGFloat red, green, blue, alpha;
2546 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
2547 # return nil;
2548 # }
2549 # Color* result = [Color alloc] init];
2550 # [result setRed:red];
2551 # [result setGreen:green];
2552 # [result setBlue:blue];
2553 # if (alpha <= 0.9999) {
2554 # [result setAlpha:floatWrapperWithValue(alpha)];
2555 # }
2556 # [result autorelease];
2557 # return result;
2558 # }
2559 # // ...
2560 #
2561 # Example (JavaScript):
2562 #
2563 # // ...
2564 #
2565 # var protoToCssColor = function(rgb_color) {
2566 # var redFrac = rgb_color.red || 0.0;
2567 # var greenFrac = rgb_color.green || 0.0;
2568 # var blueFrac = rgb_color.blue || 0.0;
2569 # var red = Math.floor(redFrac * 255);
2570 # var green = Math.floor(greenFrac * 255);
2571 # var blue = Math.floor(blueFrac * 255);
2572 #
2573 # if (!('alpha' in rgb_color)) {
2574 # return rgbToCssColor_(red, green, blue);
2575 # }
2576 #
2577 # var alphaFrac = rgb_color.alpha.value || 0.0;
2578 # var rgbParams = [red, green, blue].join(',');
2579 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
2580 # };
2581 #
2582 # var rgbToCssColor_ = function(red, green, blue) {
2583 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
2584 # var hexString = rgbNumber.toString(16);
2585 # var missingZeros = 6 - hexString.length;
2586 # var resultBuilder = ['#'];
2587 # for (var i = 0; i < missingZeros; i++) {
2588 # resultBuilder.push('0');
2589 # }
2590 # resultBuilder.push(hexString);
2591 # return resultBuilder.join('');
2592 # };
2593 #
2594 # // ...
2595 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
2596 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
2597 # the final pixel color is defined by the equation:
2598 #
2599 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
2600 #
2601 # This means that a value of 1.0 corresponds to a solid color, whereas
2602 # a value of 0.0 corresponds to a completely transparent color. This
2603 # uses a wrapper message rather than a simple float scalar so that it is
2604 # possible to distinguish between a default value and the value being unset.
2605 # If omitted, this color object is to be rendered as a solid color
2606 # (as if the alpha value had been explicitly given with a value of 1.0).
2607 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
2608 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
2609 },
2610 "width": 42, # The width of the border, in pixels.
2611 # Border widths must be between 0 and 3 pixels.
2612 "style": "A String", # The style of the border.
2613 },
2614 "bottom": { # A border along a cell. # The bottom border of the cell.
2615 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
2616 # for simplicity of conversion to/from color representations in various
2617 # languages over compactness; for example, the fields of this representation
2618 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
2619 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
2620 # method in iOS; and, with just a little work, it can be easily formatted into
2621 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
2622 #
2623 # Example (Java):
2624 #
2625 # import com.google.type.Color;
2626 #
2627 # // ...
2628 # public static java.awt.Color fromProto(Color protocolor) {
2629 # float alpha = protocolor.hasAlpha()
2630 # ? protocolor.getAlpha().getValue()
2631 # : 1.0;
2632 #
2633 # return new java.awt.Color(
2634 # protocolor.getRed(),
2635 # protocolor.getGreen(),
2636 # protocolor.getBlue(),
2637 # alpha);
2638 # }
2639 #
2640 # public static Color toProto(java.awt.Color color) {
2641 # float red = (float) color.getRed();
2642 # float green = (float) color.getGreen();
2643 # float blue = (float) color.getBlue();
2644 # float denominator = 255.0;
2645 # Color.Builder resultBuilder =
2646 # Color
2647 # .newBuilder()
2648 # .setRed(red / denominator)
2649 # .setGreen(green / denominator)
2650 # .setBlue(blue / denominator);
2651 # int alpha = color.getAlpha();
2652 # if (alpha != 255) {
2653 # result.setAlpha(
2654 # FloatValue
2655 # .newBuilder()
2656 # .setValue(((float) alpha) / denominator)
2657 # .build());
2658 # }
2659 # return resultBuilder.build();
2660 # }
2661 # // ...
2662 #
2663 # Example (iOS / Obj-C):
2664 #
2665 # // ...
2666 # static UIColor* fromProto(Color* protocolor) {
2667 # float red = [protocolor red];
2668 # float green = [protocolor green];
2669 # float blue = [protocolor blue];
2670 # FloatValue* alpha_wrapper = [protocolor alpha];
2671 # float alpha = 1.0;
2672 # if (alpha_wrapper != nil) {
2673 # alpha = [alpha_wrapper value];
2674 # }
2675 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
2676 # }
2677 #
2678 # static Color* toProto(UIColor* color) {
2679 # CGFloat red, green, blue, alpha;
2680 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
2681 # return nil;
2682 # }
2683 # Color* result = [Color alloc] init];
2684 # [result setRed:red];
2685 # [result setGreen:green];
2686 # [result setBlue:blue];
2687 # if (alpha <= 0.9999) {
2688 # [result setAlpha:floatWrapperWithValue(alpha)];
2689 # }
2690 # [result autorelease];
2691 # return result;
2692 # }
2693 # // ...
2694 #
2695 # Example (JavaScript):
2696 #
2697 # // ...
2698 #
2699 # var protoToCssColor = function(rgb_color) {
2700 # var redFrac = rgb_color.red || 0.0;
2701 # var greenFrac = rgb_color.green || 0.0;
2702 # var blueFrac = rgb_color.blue || 0.0;
2703 # var red = Math.floor(redFrac * 255);
2704 # var green = Math.floor(greenFrac * 255);
2705 # var blue = Math.floor(blueFrac * 255);
2706 #
2707 # if (!('alpha' in rgb_color)) {
2708 # return rgbToCssColor_(red, green, blue);
2709 # }
2710 #
2711 # var alphaFrac = rgb_color.alpha.value || 0.0;
2712 # var rgbParams = [red, green, blue].join(',');
2713 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
2714 # };
2715 #
2716 # var rgbToCssColor_ = function(red, green, blue) {
2717 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
2718 # var hexString = rgbNumber.toString(16);
2719 # var missingZeros = 6 - hexString.length;
2720 # var resultBuilder = ['#'];
2721 # for (var i = 0; i < missingZeros; i++) {
2722 # resultBuilder.push('0');
2723 # }
2724 # resultBuilder.push(hexString);
2725 # return resultBuilder.join('');
2726 # };
2727 #
2728 # // ...
2729 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
2730 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
2731 # the final pixel color is defined by the equation:
2732 #
2733 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
2734 #
2735 # This means that a value of 1.0 corresponds to a solid color, whereas
2736 # a value of 0.0 corresponds to a completely transparent color. This
2737 # uses a wrapper message rather than a simple float scalar so that it is
2738 # possible to distinguish between a default value and the value being unset.
2739 # If omitted, this color object is to be rendered as a solid color
2740 # (as if the alpha value had been explicitly given with a value of 1.0).
2741 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
2742 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
2743 },
2744 "width": 42, # The width of the border, in pixels.
2745 # Border widths must be between 0 and 3 pixels.
2746 "style": "A String", # The style of the border.
2747 },
2748 "left": { # A border along a cell. # The left border of the cell.
2749 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
2750 # for simplicity of conversion to/from color representations in various
2751 # languages over compactness; for example, the fields of this representation
2752 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
2753 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
2754 # method in iOS; and, with just a little work, it can be easily formatted into
2755 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
2756 #
2757 # Example (Java):
2758 #
2759 # import com.google.type.Color;
2760 #
2761 # // ...
2762 # public static java.awt.Color fromProto(Color protocolor) {
2763 # float alpha = protocolor.hasAlpha()
2764 # ? protocolor.getAlpha().getValue()
2765 # : 1.0;
2766 #
2767 # return new java.awt.Color(
2768 # protocolor.getRed(),
2769 # protocolor.getGreen(),
2770 # protocolor.getBlue(),
2771 # alpha);
2772 # }
2773 #
2774 # public static Color toProto(java.awt.Color color) {
2775 # float red = (float) color.getRed();
2776 # float green = (float) color.getGreen();
2777 # float blue = (float) color.getBlue();
2778 # float denominator = 255.0;
2779 # Color.Builder resultBuilder =
2780 # Color
2781 # .newBuilder()
2782 # .setRed(red / denominator)
2783 # .setGreen(green / denominator)
2784 # .setBlue(blue / denominator);
2785 # int alpha = color.getAlpha();
2786 # if (alpha != 255) {
2787 # result.setAlpha(
2788 # FloatValue
2789 # .newBuilder()
2790 # .setValue(((float) alpha) / denominator)
2791 # .build());
2792 # }
2793 # return resultBuilder.build();
2794 # }
2795 # // ...
2796 #
2797 # Example (iOS / Obj-C):
2798 #
2799 # // ...
2800 # static UIColor* fromProto(Color* protocolor) {
2801 # float red = [protocolor red];
2802 # float green = [protocolor green];
2803 # float blue = [protocolor blue];
2804 # FloatValue* alpha_wrapper = [protocolor alpha];
2805 # float alpha = 1.0;
2806 # if (alpha_wrapper != nil) {
2807 # alpha = [alpha_wrapper value];
2808 # }
2809 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
2810 # }
2811 #
2812 # static Color* toProto(UIColor* color) {
2813 # CGFloat red, green, blue, alpha;
2814 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
2815 # return nil;
2816 # }
2817 # Color* result = [Color alloc] init];
2818 # [result setRed:red];
2819 # [result setGreen:green];
2820 # [result setBlue:blue];
2821 # if (alpha <= 0.9999) {
2822 # [result setAlpha:floatWrapperWithValue(alpha)];
2823 # }
2824 # [result autorelease];
2825 # return result;
2826 # }
2827 # // ...
2828 #
2829 # Example (JavaScript):
2830 #
2831 # // ...
2832 #
2833 # var protoToCssColor = function(rgb_color) {
2834 # var redFrac = rgb_color.red || 0.0;
2835 # var greenFrac = rgb_color.green || 0.0;
2836 # var blueFrac = rgb_color.blue || 0.0;
2837 # var red = Math.floor(redFrac * 255);
2838 # var green = Math.floor(greenFrac * 255);
2839 # var blue = Math.floor(blueFrac * 255);
2840 #
2841 # if (!('alpha' in rgb_color)) {
2842 # return rgbToCssColor_(red, green, blue);
2843 # }
2844 #
2845 # var alphaFrac = rgb_color.alpha.value || 0.0;
2846 # var rgbParams = [red, green, blue].join(',');
2847 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
2848 # };
2849 #
2850 # var rgbToCssColor_ = function(red, green, blue) {
2851 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
2852 # var hexString = rgbNumber.toString(16);
2853 # var missingZeros = 6 - hexString.length;
2854 # var resultBuilder = ['#'];
2855 # for (var i = 0; i < missingZeros; i++) {
2856 # resultBuilder.push('0');
2857 # }
2858 # resultBuilder.push(hexString);
2859 # return resultBuilder.join('');
2860 # };
2861 #
2862 # // ...
2863 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
2864 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
2865 # the final pixel color is defined by the equation:
2866 #
2867 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
2868 #
2869 # This means that a value of 1.0 corresponds to a solid color, whereas
2870 # a value of 0.0 corresponds to a completely transparent color. This
2871 # uses a wrapper message rather than a simple float scalar so that it is
2872 # possible to distinguish between a default value and the value being unset.
2873 # If omitted, this color object is to be rendered as a solid color
2874 # (as if the alpha value had been explicitly given with a value of 1.0).
2875 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
2876 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
2877 },
2878 "width": 42, # The width of the border, in pixels.
2879 # Border widths must be between 0 and 3 pixels.
2880 "style": "A String", # The style of the border.
2881 },
2882 },
2883 "wrapStrategy": "A String", # The wrap strategy for the value in the cell.
2884 },
2885 "userEnteredFormat": { # The format of a cell. # The format the user entered for the cell.
2886 #
2887 # When writing, the new format will be merged with the existing format.
2888 "numberFormat": { # The number format of a cell. # A format describing how number values should be represented to the user.
2889 # When updating, all fields must be set.
2890 "pattern": "A String", # Pattern string used for formatting.
2891 "type": "A String", # The type of the number format.
2892 },
2893 "textDirection": "A String", # The direction of the text in the cell.
2894 "padding": { # The amount of padding around the cell, in pixels. # The padding of the cell.
2895 # When updating padding, every field must be specified.
2896 "top": 42, # The top padding of the cell.
2897 "right": 42, # The right padding of the cell.
2898 "bottom": 42, # The bottom padding of the cell.
2899 "left": 42, # The left padding of the cell.
2900 },
2901 "horizontalAlignment": "A String", # The horizontal alignment of the value in cell.
2902 "backgroundColor": { # Represents a color in the RGBA color space. This representation is designed # The background color of the cell.
2903 # for simplicity of conversion to/from color representations in various
2904 # languages over compactness; for example, the fields of this representation
2905 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
2906 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
2907 # method in iOS; and, with just a little work, it can be easily formatted into
2908 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
2909 #
2910 # Example (Java):
2911 #
2912 # import com.google.type.Color;
2913 #
2914 # // ...
2915 # public static java.awt.Color fromProto(Color protocolor) {
2916 # float alpha = protocolor.hasAlpha()
2917 # ? protocolor.getAlpha().getValue()
2918 # : 1.0;
2919 #
2920 # return new java.awt.Color(
2921 # protocolor.getRed(),
2922 # protocolor.getGreen(),
2923 # protocolor.getBlue(),
2924 # alpha);
2925 # }
2926 #
2927 # public static Color toProto(java.awt.Color color) {
2928 # float red = (float) color.getRed();
2929 # float green = (float) color.getGreen();
2930 # float blue = (float) color.getBlue();
2931 # float denominator = 255.0;
2932 # Color.Builder resultBuilder =
2933 # Color
2934 # .newBuilder()
2935 # .setRed(red / denominator)
2936 # .setGreen(green / denominator)
2937 # .setBlue(blue / denominator);
2938 # int alpha = color.getAlpha();
2939 # if (alpha != 255) {
2940 # result.setAlpha(
2941 # FloatValue
2942 # .newBuilder()
2943 # .setValue(((float) alpha) / denominator)
2944 # .build());
2945 # }
2946 # return resultBuilder.build();
2947 # }
2948 # // ...
2949 #
2950 # Example (iOS / Obj-C):
2951 #
2952 # // ...
2953 # static UIColor* fromProto(Color* protocolor) {
2954 # float red = [protocolor red];
2955 # float green = [protocolor green];
2956 # float blue = [protocolor blue];
2957 # FloatValue* alpha_wrapper = [protocolor alpha];
2958 # float alpha = 1.0;
2959 # if (alpha_wrapper != nil) {
2960 # alpha = [alpha_wrapper value];
2961 # }
2962 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
2963 # }
2964 #
2965 # static Color* toProto(UIColor* color) {
2966 # CGFloat red, green, blue, alpha;
2967 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
2968 # return nil;
2969 # }
2970 # Color* result = [Color alloc] init];
2971 # [result setRed:red];
2972 # [result setGreen:green];
2973 # [result setBlue:blue];
2974 # if (alpha <= 0.9999) {
2975 # [result setAlpha:floatWrapperWithValue(alpha)];
2976 # }
2977 # [result autorelease];
2978 # return result;
2979 # }
2980 # // ...
2981 #
2982 # Example (JavaScript):
2983 #
2984 # // ...
2985 #
2986 # var protoToCssColor = function(rgb_color) {
2987 # var redFrac = rgb_color.red || 0.0;
2988 # var greenFrac = rgb_color.green || 0.0;
2989 # var blueFrac = rgb_color.blue || 0.0;
2990 # var red = Math.floor(redFrac * 255);
2991 # var green = Math.floor(greenFrac * 255);
2992 # var blue = Math.floor(blueFrac * 255);
2993 #
2994 # if (!('alpha' in rgb_color)) {
2995 # return rgbToCssColor_(red, green, blue);
2996 # }
2997 #
2998 # var alphaFrac = rgb_color.alpha.value || 0.0;
2999 # var rgbParams = [red, green, blue].join(',');
3000 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
3001 # };
3002 #
3003 # var rgbToCssColor_ = function(red, green, blue) {
3004 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
3005 # var hexString = rgbNumber.toString(16);
3006 # var missingZeros = 6 - hexString.length;
3007 # var resultBuilder = ['#'];
3008 # for (var i = 0; i < missingZeros; i++) {
3009 # resultBuilder.push('0');
3010 # }
3011 # resultBuilder.push(hexString);
3012 # return resultBuilder.join('');
3013 # };
3014 #
3015 # // ...
3016 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
3017 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
3018 # the final pixel color is defined by the equation:
3019 #
3020 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
3021 #
3022 # This means that a value of 1.0 corresponds to a solid color, whereas
3023 # a value of 0.0 corresponds to a completely transparent color. This
3024 # uses a wrapper message rather than a simple float scalar so that it is
3025 # possible to distinguish between a default value and the value being unset.
3026 # If omitted, this color object is to be rendered as a solid color
3027 # (as if the alpha value had been explicitly given with a value of 1.0).
3028 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
3029 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
3030 },
3031 "verticalAlignment": "A String", # The vertical alignment of the value in cell.
3032 "textFormat": { # The format of a run of text in a cell. # The format of the text in the cell (unless overridden by a format run).
3033 # Absent values indicate that the field isn't specified.
3034 "foregroundColor": { # Represents a color in the RGBA color space. This representation is designed # The foreground color of the text.
3035 # for simplicity of conversion to/from color representations in various
3036 # languages over compactness; for example, the fields of this representation
3037 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
3038 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
3039 # method in iOS; and, with just a little work, it can be easily formatted into
3040 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
3041 #
3042 # Example (Java):
3043 #
3044 # import com.google.type.Color;
3045 #
3046 # // ...
3047 # public static java.awt.Color fromProto(Color protocolor) {
3048 # float alpha = protocolor.hasAlpha()
3049 # ? protocolor.getAlpha().getValue()
3050 # : 1.0;
3051 #
3052 # return new java.awt.Color(
3053 # protocolor.getRed(),
3054 # protocolor.getGreen(),
3055 # protocolor.getBlue(),
3056 # alpha);
3057 # }
3058 #
3059 # public static Color toProto(java.awt.Color color) {
3060 # float red = (float) color.getRed();
3061 # float green = (float) color.getGreen();
3062 # float blue = (float) color.getBlue();
3063 # float denominator = 255.0;
3064 # Color.Builder resultBuilder =
3065 # Color
3066 # .newBuilder()
3067 # .setRed(red / denominator)
3068 # .setGreen(green / denominator)
3069 # .setBlue(blue / denominator);
3070 # int alpha = color.getAlpha();
3071 # if (alpha != 255) {
3072 # result.setAlpha(
3073 # FloatValue
3074 # .newBuilder()
3075 # .setValue(((float) alpha) / denominator)
3076 # .build());
3077 # }
3078 # return resultBuilder.build();
3079 # }
3080 # // ...
3081 #
3082 # Example (iOS / Obj-C):
3083 #
3084 # // ...
3085 # static UIColor* fromProto(Color* protocolor) {
3086 # float red = [protocolor red];
3087 # float green = [protocolor green];
3088 # float blue = [protocolor blue];
3089 # FloatValue* alpha_wrapper = [protocolor alpha];
3090 # float alpha = 1.0;
3091 # if (alpha_wrapper != nil) {
3092 # alpha = [alpha_wrapper value];
3093 # }
3094 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
3095 # }
3096 #
3097 # static Color* toProto(UIColor* color) {
3098 # CGFloat red, green, blue, alpha;
3099 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
3100 # return nil;
3101 # }
3102 # Color* result = [Color alloc] init];
3103 # [result setRed:red];
3104 # [result setGreen:green];
3105 # [result setBlue:blue];
3106 # if (alpha <= 0.9999) {
3107 # [result setAlpha:floatWrapperWithValue(alpha)];
3108 # }
3109 # [result autorelease];
3110 # return result;
3111 # }
3112 # // ...
3113 #
3114 # Example (JavaScript):
3115 #
3116 # // ...
3117 #
3118 # var protoToCssColor = function(rgb_color) {
3119 # var redFrac = rgb_color.red || 0.0;
3120 # var greenFrac = rgb_color.green || 0.0;
3121 # var blueFrac = rgb_color.blue || 0.0;
3122 # var red = Math.floor(redFrac * 255);
3123 # var green = Math.floor(greenFrac * 255);
3124 # var blue = Math.floor(blueFrac * 255);
3125 #
3126 # if (!('alpha' in rgb_color)) {
3127 # return rgbToCssColor_(red, green, blue);
3128 # }
3129 #
3130 # var alphaFrac = rgb_color.alpha.value || 0.0;
3131 # var rgbParams = [red, green, blue].join(',');
3132 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
3133 # };
3134 #
3135 # var rgbToCssColor_ = function(red, green, blue) {
3136 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
3137 # var hexString = rgbNumber.toString(16);
3138 # var missingZeros = 6 - hexString.length;
3139 # var resultBuilder = ['#'];
3140 # for (var i = 0; i < missingZeros; i++) {
3141 # resultBuilder.push('0');
3142 # }
3143 # resultBuilder.push(hexString);
3144 # return resultBuilder.join('');
3145 # };
3146 #
3147 # // ...
3148 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
3149 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
3150 # the final pixel color is defined by the equation:
3151 #
3152 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
3153 #
3154 # This means that a value of 1.0 corresponds to a solid color, whereas
3155 # a value of 0.0 corresponds to a completely transparent color. This
3156 # uses a wrapper message rather than a simple float scalar so that it is
3157 # possible to distinguish between a default value and the value being unset.
3158 # If omitted, this color object is to be rendered as a solid color
3159 # (as if the alpha value had been explicitly given with a value of 1.0).
3160 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
3161 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
3162 },
3163 "bold": True or False, # True if the text is bold.
3164 "strikethrough": True or False, # True if the text has a strikethrough.
3165 "fontFamily": "A String", # The font family.
3166 "fontSize": 42, # The size of the font.
3167 "italic": True or False, # True if the text is italicized.
3168 "underline": True or False, # True if the text is underlined.
3169 },
3170 "hyperlinkDisplayType": "A String", # How a hyperlink, if it exists, should be displayed in the cell.
3171 "borders": { # The borders of the cell. # The borders of the cell.
3172 "top": { # A border along a cell. # The top border of the cell.
3173 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
3174 # for simplicity of conversion to/from color representations in various
3175 # languages over compactness; for example, the fields of this representation
3176 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
3177 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
3178 # method in iOS; and, with just a little work, it can be easily formatted into
3179 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
3180 #
3181 # Example (Java):
3182 #
3183 # import com.google.type.Color;
3184 #
3185 # // ...
3186 # public static java.awt.Color fromProto(Color protocolor) {
3187 # float alpha = protocolor.hasAlpha()
3188 # ? protocolor.getAlpha().getValue()
3189 # : 1.0;
3190 #
3191 # return new java.awt.Color(
3192 # protocolor.getRed(),
3193 # protocolor.getGreen(),
3194 # protocolor.getBlue(),
3195 # alpha);
3196 # }
3197 #
3198 # public static Color toProto(java.awt.Color color) {
3199 # float red = (float) color.getRed();
3200 # float green = (float) color.getGreen();
3201 # float blue = (float) color.getBlue();
3202 # float denominator = 255.0;
3203 # Color.Builder resultBuilder =
3204 # Color
3205 # .newBuilder()
3206 # .setRed(red / denominator)
3207 # .setGreen(green / denominator)
3208 # .setBlue(blue / denominator);
3209 # int alpha = color.getAlpha();
3210 # if (alpha != 255) {
3211 # result.setAlpha(
3212 # FloatValue
3213 # .newBuilder()
3214 # .setValue(((float) alpha) / denominator)
3215 # .build());
3216 # }
3217 # return resultBuilder.build();
3218 # }
3219 # // ...
3220 #
3221 # Example (iOS / Obj-C):
3222 #
3223 # // ...
3224 # static UIColor* fromProto(Color* protocolor) {
3225 # float red = [protocolor red];
3226 # float green = [protocolor green];
3227 # float blue = [protocolor blue];
3228 # FloatValue* alpha_wrapper = [protocolor alpha];
3229 # float alpha = 1.0;
3230 # if (alpha_wrapper != nil) {
3231 # alpha = [alpha_wrapper value];
3232 # }
3233 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
3234 # }
3235 #
3236 # static Color* toProto(UIColor* color) {
3237 # CGFloat red, green, blue, alpha;
3238 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
3239 # return nil;
3240 # }
3241 # Color* result = [Color alloc] init];
3242 # [result setRed:red];
3243 # [result setGreen:green];
3244 # [result setBlue:blue];
3245 # if (alpha <= 0.9999) {
3246 # [result setAlpha:floatWrapperWithValue(alpha)];
3247 # }
3248 # [result autorelease];
3249 # return result;
3250 # }
3251 # // ...
3252 #
3253 # Example (JavaScript):
3254 #
3255 # // ...
3256 #
3257 # var protoToCssColor = function(rgb_color) {
3258 # var redFrac = rgb_color.red || 0.0;
3259 # var greenFrac = rgb_color.green || 0.0;
3260 # var blueFrac = rgb_color.blue || 0.0;
3261 # var red = Math.floor(redFrac * 255);
3262 # var green = Math.floor(greenFrac * 255);
3263 # var blue = Math.floor(blueFrac * 255);
3264 #
3265 # if (!('alpha' in rgb_color)) {
3266 # return rgbToCssColor_(red, green, blue);
3267 # }
3268 #
3269 # var alphaFrac = rgb_color.alpha.value || 0.0;
3270 # var rgbParams = [red, green, blue].join(',');
3271 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
3272 # };
3273 #
3274 # var rgbToCssColor_ = function(red, green, blue) {
3275 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
3276 # var hexString = rgbNumber.toString(16);
3277 # var missingZeros = 6 - hexString.length;
3278 # var resultBuilder = ['#'];
3279 # for (var i = 0; i < missingZeros; i++) {
3280 # resultBuilder.push('0');
3281 # }
3282 # resultBuilder.push(hexString);
3283 # return resultBuilder.join('');
3284 # };
3285 #
3286 # // ...
3287 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
3288 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
3289 # the final pixel color is defined by the equation:
3290 #
3291 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
3292 #
3293 # This means that a value of 1.0 corresponds to a solid color, whereas
3294 # a value of 0.0 corresponds to a completely transparent color. This
3295 # uses a wrapper message rather than a simple float scalar so that it is
3296 # possible to distinguish between a default value and the value being unset.
3297 # If omitted, this color object is to be rendered as a solid color
3298 # (as if the alpha value had been explicitly given with a value of 1.0).
3299 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
3300 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
3301 },
3302 "width": 42, # The width of the border, in pixels.
3303 # Border widths must be between 0 and 3 pixels.
3304 "style": "A String", # The style of the border.
3305 },
3306 "right": { # A border along a cell. # The right border of the cell.
3307 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
3308 # for simplicity of conversion to/from color representations in various
3309 # languages over compactness; for example, the fields of this representation
3310 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
3311 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
3312 # method in iOS; and, with just a little work, it can be easily formatted into
3313 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
3314 #
3315 # Example (Java):
3316 #
3317 # import com.google.type.Color;
3318 #
3319 # // ...
3320 # public static java.awt.Color fromProto(Color protocolor) {
3321 # float alpha = protocolor.hasAlpha()
3322 # ? protocolor.getAlpha().getValue()
3323 # : 1.0;
3324 #
3325 # return new java.awt.Color(
3326 # protocolor.getRed(),
3327 # protocolor.getGreen(),
3328 # protocolor.getBlue(),
3329 # alpha);
3330 # }
3331 #
3332 # public static Color toProto(java.awt.Color color) {
3333 # float red = (float) color.getRed();
3334 # float green = (float) color.getGreen();
3335 # float blue = (float) color.getBlue();
3336 # float denominator = 255.0;
3337 # Color.Builder resultBuilder =
3338 # Color
3339 # .newBuilder()
3340 # .setRed(red / denominator)
3341 # .setGreen(green / denominator)
3342 # .setBlue(blue / denominator);
3343 # int alpha = color.getAlpha();
3344 # if (alpha != 255) {
3345 # result.setAlpha(
3346 # FloatValue
3347 # .newBuilder()
3348 # .setValue(((float) alpha) / denominator)
3349 # .build());
3350 # }
3351 # return resultBuilder.build();
3352 # }
3353 # // ...
3354 #
3355 # Example (iOS / Obj-C):
3356 #
3357 # // ...
3358 # static UIColor* fromProto(Color* protocolor) {
3359 # float red = [protocolor red];
3360 # float green = [protocolor green];
3361 # float blue = [protocolor blue];
3362 # FloatValue* alpha_wrapper = [protocolor alpha];
3363 # float alpha = 1.0;
3364 # if (alpha_wrapper != nil) {
3365 # alpha = [alpha_wrapper value];
3366 # }
3367 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
3368 # }
3369 #
3370 # static Color* toProto(UIColor* color) {
3371 # CGFloat red, green, blue, alpha;
3372 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
3373 # return nil;
3374 # }
3375 # Color* result = [Color alloc] init];
3376 # [result setRed:red];
3377 # [result setGreen:green];
3378 # [result setBlue:blue];
3379 # if (alpha <= 0.9999) {
3380 # [result setAlpha:floatWrapperWithValue(alpha)];
3381 # }
3382 # [result autorelease];
3383 # return result;
3384 # }
3385 # // ...
3386 #
3387 # Example (JavaScript):
3388 #
3389 # // ...
3390 #
3391 # var protoToCssColor = function(rgb_color) {
3392 # var redFrac = rgb_color.red || 0.0;
3393 # var greenFrac = rgb_color.green || 0.0;
3394 # var blueFrac = rgb_color.blue || 0.0;
3395 # var red = Math.floor(redFrac * 255);
3396 # var green = Math.floor(greenFrac * 255);
3397 # var blue = Math.floor(blueFrac * 255);
3398 #
3399 # if (!('alpha' in rgb_color)) {
3400 # return rgbToCssColor_(red, green, blue);
3401 # }
3402 #
3403 # var alphaFrac = rgb_color.alpha.value || 0.0;
3404 # var rgbParams = [red, green, blue].join(',');
3405 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
3406 # };
3407 #
3408 # var rgbToCssColor_ = function(red, green, blue) {
3409 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
3410 # var hexString = rgbNumber.toString(16);
3411 # var missingZeros = 6 - hexString.length;
3412 # var resultBuilder = ['#'];
3413 # for (var i = 0; i < missingZeros; i++) {
3414 # resultBuilder.push('0');
3415 # }
3416 # resultBuilder.push(hexString);
3417 # return resultBuilder.join('');
3418 # };
3419 #
3420 # // ...
3421 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
3422 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
3423 # the final pixel color is defined by the equation:
3424 #
3425 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
3426 #
3427 # This means that a value of 1.0 corresponds to a solid color, whereas
3428 # a value of 0.0 corresponds to a completely transparent color. This
3429 # uses a wrapper message rather than a simple float scalar so that it is
3430 # possible to distinguish between a default value and the value being unset.
3431 # If omitted, this color object is to be rendered as a solid color
3432 # (as if the alpha value had been explicitly given with a value of 1.0).
3433 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
3434 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
3435 },
3436 "width": 42, # The width of the border, in pixels.
3437 # Border widths must be between 0 and 3 pixels.
3438 "style": "A String", # The style of the border.
3439 },
3440 "bottom": { # A border along a cell. # The bottom border of the cell.
3441 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
3442 # for simplicity of conversion to/from color representations in various
3443 # languages over compactness; for example, the fields of this representation
3444 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
3445 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
3446 # method in iOS; and, with just a little work, it can be easily formatted into
3447 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
3448 #
3449 # Example (Java):
3450 #
3451 # import com.google.type.Color;
3452 #
3453 # // ...
3454 # public static java.awt.Color fromProto(Color protocolor) {
3455 # float alpha = protocolor.hasAlpha()
3456 # ? protocolor.getAlpha().getValue()
3457 # : 1.0;
3458 #
3459 # return new java.awt.Color(
3460 # protocolor.getRed(),
3461 # protocolor.getGreen(),
3462 # protocolor.getBlue(),
3463 # alpha);
3464 # }
3465 #
3466 # public static Color toProto(java.awt.Color color) {
3467 # float red = (float) color.getRed();
3468 # float green = (float) color.getGreen();
3469 # float blue = (float) color.getBlue();
3470 # float denominator = 255.0;
3471 # Color.Builder resultBuilder =
3472 # Color
3473 # .newBuilder()
3474 # .setRed(red / denominator)
3475 # .setGreen(green / denominator)
3476 # .setBlue(blue / denominator);
3477 # int alpha = color.getAlpha();
3478 # if (alpha != 255) {
3479 # result.setAlpha(
3480 # FloatValue
3481 # .newBuilder()
3482 # .setValue(((float) alpha) / denominator)
3483 # .build());
3484 # }
3485 # return resultBuilder.build();
3486 # }
3487 # // ...
3488 #
3489 # Example (iOS / Obj-C):
3490 #
3491 # // ...
3492 # static UIColor* fromProto(Color* protocolor) {
3493 # float red = [protocolor red];
3494 # float green = [protocolor green];
3495 # float blue = [protocolor blue];
3496 # FloatValue* alpha_wrapper = [protocolor alpha];
3497 # float alpha = 1.0;
3498 # if (alpha_wrapper != nil) {
3499 # alpha = [alpha_wrapper value];
3500 # }
3501 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
3502 # }
3503 #
3504 # static Color* toProto(UIColor* color) {
3505 # CGFloat red, green, blue, alpha;
3506 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
3507 # return nil;
3508 # }
3509 # Color* result = [Color alloc] init];
3510 # [result setRed:red];
3511 # [result setGreen:green];
3512 # [result setBlue:blue];
3513 # if (alpha <= 0.9999) {
3514 # [result setAlpha:floatWrapperWithValue(alpha)];
3515 # }
3516 # [result autorelease];
3517 # return result;
3518 # }
3519 # // ...
3520 #
3521 # Example (JavaScript):
3522 #
3523 # // ...
3524 #
3525 # var protoToCssColor = function(rgb_color) {
3526 # var redFrac = rgb_color.red || 0.0;
3527 # var greenFrac = rgb_color.green || 0.0;
3528 # var blueFrac = rgb_color.blue || 0.0;
3529 # var red = Math.floor(redFrac * 255);
3530 # var green = Math.floor(greenFrac * 255);
3531 # var blue = Math.floor(blueFrac * 255);
3532 #
3533 # if (!('alpha' in rgb_color)) {
3534 # return rgbToCssColor_(red, green, blue);
3535 # }
3536 #
3537 # var alphaFrac = rgb_color.alpha.value || 0.0;
3538 # var rgbParams = [red, green, blue].join(',');
3539 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
3540 # };
3541 #
3542 # var rgbToCssColor_ = function(red, green, blue) {
3543 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
3544 # var hexString = rgbNumber.toString(16);
3545 # var missingZeros = 6 - hexString.length;
3546 # var resultBuilder = ['#'];
3547 # for (var i = 0; i < missingZeros; i++) {
3548 # resultBuilder.push('0');
3549 # }
3550 # resultBuilder.push(hexString);
3551 # return resultBuilder.join('');
3552 # };
3553 #
3554 # // ...
3555 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
3556 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
3557 # the final pixel color is defined by the equation:
3558 #
3559 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
3560 #
3561 # This means that a value of 1.0 corresponds to a solid color, whereas
3562 # a value of 0.0 corresponds to a completely transparent color. This
3563 # uses a wrapper message rather than a simple float scalar so that it is
3564 # possible to distinguish between a default value and the value being unset.
3565 # If omitted, this color object is to be rendered as a solid color
3566 # (as if the alpha value had been explicitly given with a value of 1.0).
3567 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
3568 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
3569 },
3570 "width": 42, # The width of the border, in pixels.
3571 # Border widths must be between 0 and 3 pixels.
3572 "style": "A String", # The style of the border.
3573 },
3574 "left": { # A border along a cell. # The left border of the cell.
3575 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
3576 # for simplicity of conversion to/from color representations in various
3577 # languages over compactness; for example, the fields of this representation
3578 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
3579 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
3580 # method in iOS; and, with just a little work, it can be easily formatted into
3581 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
3582 #
3583 # Example (Java):
3584 #
3585 # import com.google.type.Color;
3586 #
3587 # // ...
3588 # public static java.awt.Color fromProto(Color protocolor) {
3589 # float alpha = protocolor.hasAlpha()
3590 # ? protocolor.getAlpha().getValue()
3591 # : 1.0;
3592 #
3593 # return new java.awt.Color(
3594 # protocolor.getRed(),
3595 # protocolor.getGreen(),
3596 # protocolor.getBlue(),
3597 # alpha);
3598 # }
3599 #
3600 # public static Color toProto(java.awt.Color color) {
3601 # float red = (float) color.getRed();
3602 # float green = (float) color.getGreen();
3603 # float blue = (float) color.getBlue();
3604 # float denominator = 255.0;
3605 # Color.Builder resultBuilder =
3606 # Color
3607 # .newBuilder()
3608 # .setRed(red / denominator)
3609 # .setGreen(green / denominator)
3610 # .setBlue(blue / denominator);
3611 # int alpha = color.getAlpha();
3612 # if (alpha != 255) {
3613 # result.setAlpha(
3614 # FloatValue
3615 # .newBuilder()
3616 # .setValue(((float) alpha) / denominator)
3617 # .build());
3618 # }
3619 # return resultBuilder.build();
3620 # }
3621 # // ...
3622 #
3623 # Example (iOS / Obj-C):
3624 #
3625 # // ...
3626 # static UIColor* fromProto(Color* protocolor) {
3627 # float red = [protocolor red];
3628 # float green = [protocolor green];
3629 # float blue = [protocolor blue];
3630 # FloatValue* alpha_wrapper = [protocolor alpha];
3631 # float alpha = 1.0;
3632 # if (alpha_wrapper != nil) {
3633 # alpha = [alpha_wrapper value];
3634 # }
3635 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
3636 # }
3637 #
3638 # static Color* toProto(UIColor* color) {
3639 # CGFloat red, green, blue, alpha;
3640 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
3641 # return nil;
3642 # }
3643 # Color* result = [Color alloc] init];
3644 # [result setRed:red];
3645 # [result setGreen:green];
3646 # [result setBlue:blue];
3647 # if (alpha <= 0.9999) {
3648 # [result setAlpha:floatWrapperWithValue(alpha)];
3649 # }
3650 # [result autorelease];
3651 # return result;
3652 # }
3653 # // ...
3654 #
3655 # Example (JavaScript):
3656 #
3657 # // ...
3658 #
3659 # var protoToCssColor = function(rgb_color) {
3660 # var redFrac = rgb_color.red || 0.0;
3661 # var greenFrac = rgb_color.green || 0.0;
3662 # var blueFrac = rgb_color.blue || 0.0;
3663 # var red = Math.floor(redFrac * 255);
3664 # var green = Math.floor(greenFrac * 255);
3665 # var blue = Math.floor(blueFrac * 255);
3666 #
3667 # if (!('alpha' in rgb_color)) {
3668 # return rgbToCssColor_(red, green, blue);
3669 # }
3670 #
3671 # var alphaFrac = rgb_color.alpha.value || 0.0;
3672 # var rgbParams = [red, green, blue].join(',');
3673 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
3674 # };
3675 #
3676 # var rgbToCssColor_ = function(red, green, blue) {
3677 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
3678 # var hexString = rgbNumber.toString(16);
3679 # var missingZeros = 6 - hexString.length;
3680 # var resultBuilder = ['#'];
3681 # for (var i = 0; i < missingZeros; i++) {
3682 # resultBuilder.push('0');
3683 # }
3684 # resultBuilder.push(hexString);
3685 # return resultBuilder.join('');
3686 # };
3687 #
3688 # // ...
3689 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
3690 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
3691 # the final pixel color is defined by the equation:
3692 #
3693 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
3694 #
3695 # This means that a value of 1.0 corresponds to a solid color, whereas
3696 # a value of 0.0 corresponds to a completely transparent color. This
3697 # uses a wrapper message rather than a simple float scalar so that it is
3698 # possible to distinguish between a default value and the value being unset.
3699 # If omitted, this color object is to be rendered as a solid color
3700 # (as if the alpha value had been explicitly given with a value of 1.0).
3701 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
3702 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
3703 },
3704 "width": 42, # The width of the border, in pixels.
3705 # Border widths must be between 0 and 3 pixels.
3706 "style": "A String", # The style of the border.
3707 },
3708 },
3709 "wrapStrategy": "A String", # The wrap strategy for the value in the cell.
3710 },
3711 "dataValidation": { # A data validation rule. # A data validation rule on the cell, if any.
3712 #
3713 # When writing, the new data validation rule will overwrite any prior rule.
3714 "showCustomUi": True or False, # True if the UI should be customized based on the kind of condition.
3715 # If true, "List" conditions will show a dropdown.
3716 "strict": True or False, # True if invalid data should be rejected.
3717 "inputMessage": "A String", # A message to show the user when adding data to the cell.
3718 "condition": { # A condition that can evaluate to true or false. # The condition that data in the cell must match.
3719 # BooleanConditions are used by conditional formatting,
3720 # data validation, and the criteria in filters.
3721 "type": "A String", # The type of condition.
3722 "values": [ # The values of the condition. The number of supported values depends
3723 # on the condition type. Some support zero values,
3724 # others one or two values,
3725 # and ConditionType.ONE_OF_LIST supports an arbitrary number of values.
3726 { # The value of the condition.
3727 "relativeDate": "A String", # A relative date (based on the current date).
3728 # Valid only if the type is
3729 # DATE_BEFORE,
3730 # DATE_AFTER,
3731 # DATE_ON_OR_BEFORE or
3732 # DATE_ON_OR_AFTER.
3733 #
3734 # Relative dates are not supported in data validation.
3735 # They are supported only in conditional formatting and
3736 # conditional filters.
3737 "userEnteredValue": "A String", # A value the condition is based on.
3738 # The value will be parsed as if the user typed into a cell.
3739 # Formulas are supported (and must begin with an `=`).
3740 },
3741 ],
3742 },
3743 },
3744 "textFormatRuns": [ # Runs of rich text applied to subsections of the cell.
3745 # Runs start at specific indexes in the text and continue until the next
3746 # run. Properties of a run will continue unless explicitly changed
3747 # in a subsequent run (and properties of the first run will continue
3748 # the properties of the cell unless explicitly changed).
3749 #
3750 # When writing, the new runs will overwrite any prior runs.
3751 { # A run of a text format. The format of this run continues until explicitly
3752 # overridden in the next run.
3753 # When updating, all fields must be set.
3754 "startIndex": 42, # The character index where this run starts.
3755 "format": { # The format of a run of text in a cell. # The format of this run. Absent values inherit the cell's format.
3756 # Absent values indicate that the field isn't specified.
3757 "foregroundColor": { # Represents a color in the RGBA color space. This representation is designed # The foreground color of the text.
3758 # for simplicity of conversion to/from color representations in various
3759 # languages over compactness; for example, the fields of this representation
3760 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
3761 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
3762 # method in iOS; and, with just a little work, it can be easily formatted into
3763 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
3764 #
3765 # Example (Java):
3766 #
3767 # import com.google.type.Color;
3768 #
3769 # // ...
3770 # public static java.awt.Color fromProto(Color protocolor) {
3771 # float alpha = protocolor.hasAlpha()
3772 # ? protocolor.getAlpha().getValue()
3773 # : 1.0;
3774 #
3775 # return new java.awt.Color(
3776 # protocolor.getRed(),
3777 # protocolor.getGreen(),
3778 # protocolor.getBlue(),
3779 # alpha);
3780 # }
3781 #
3782 # public static Color toProto(java.awt.Color color) {
3783 # float red = (float) color.getRed();
3784 # float green = (float) color.getGreen();
3785 # float blue = (float) color.getBlue();
3786 # float denominator = 255.0;
3787 # Color.Builder resultBuilder =
3788 # Color
3789 # .newBuilder()
3790 # .setRed(red / denominator)
3791 # .setGreen(green / denominator)
3792 # .setBlue(blue / denominator);
3793 # int alpha = color.getAlpha();
3794 # if (alpha != 255) {
3795 # result.setAlpha(
3796 # FloatValue
3797 # .newBuilder()
3798 # .setValue(((float) alpha) / denominator)
3799 # .build());
3800 # }
3801 # return resultBuilder.build();
3802 # }
3803 # // ...
3804 #
3805 # Example (iOS / Obj-C):
3806 #
3807 # // ...
3808 # static UIColor* fromProto(Color* protocolor) {
3809 # float red = [protocolor red];
3810 # float green = [protocolor green];
3811 # float blue = [protocolor blue];
3812 # FloatValue* alpha_wrapper = [protocolor alpha];
3813 # float alpha = 1.0;
3814 # if (alpha_wrapper != nil) {
3815 # alpha = [alpha_wrapper value];
3816 # }
3817 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
3818 # }
3819 #
3820 # static Color* toProto(UIColor* color) {
3821 # CGFloat red, green, blue, alpha;
3822 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
3823 # return nil;
3824 # }
3825 # Color* result = [Color alloc] init];
3826 # [result setRed:red];
3827 # [result setGreen:green];
3828 # [result setBlue:blue];
3829 # if (alpha <= 0.9999) {
3830 # [result setAlpha:floatWrapperWithValue(alpha)];
3831 # }
3832 # [result autorelease];
3833 # return result;
3834 # }
3835 # // ...
3836 #
3837 # Example (JavaScript):
3838 #
3839 # // ...
3840 #
3841 # var protoToCssColor = function(rgb_color) {
3842 # var redFrac = rgb_color.red || 0.0;
3843 # var greenFrac = rgb_color.green || 0.0;
3844 # var blueFrac = rgb_color.blue || 0.0;
3845 # var red = Math.floor(redFrac * 255);
3846 # var green = Math.floor(greenFrac * 255);
3847 # var blue = Math.floor(blueFrac * 255);
3848 #
3849 # if (!('alpha' in rgb_color)) {
3850 # return rgbToCssColor_(red, green, blue);
3851 # }
3852 #
3853 # var alphaFrac = rgb_color.alpha.value || 0.0;
3854 # var rgbParams = [red, green, blue].join(',');
3855 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
3856 # };
3857 #
3858 # var rgbToCssColor_ = function(red, green, blue) {
3859 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
3860 # var hexString = rgbNumber.toString(16);
3861 # var missingZeros = 6 - hexString.length;
3862 # var resultBuilder = ['#'];
3863 # for (var i = 0; i < missingZeros; i++) {
3864 # resultBuilder.push('0');
3865 # }
3866 # resultBuilder.push(hexString);
3867 # return resultBuilder.join('');
3868 # };
3869 #
3870 # // ...
3871 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
3872 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
3873 # the final pixel color is defined by the equation:
3874 #
3875 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
3876 #
3877 # This means that a value of 1.0 corresponds to a solid color, whereas
3878 # a value of 0.0 corresponds to a completely transparent color. This
3879 # uses a wrapper message rather than a simple float scalar so that it is
3880 # possible to distinguish between a default value and the value being unset.
3881 # If omitted, this color object is to be rendered as a solid color
3882 # (as if the alpha value had been explicitly given with a value of 1.0).
3883 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
3884 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
3885 },
3886 "bold": True or False, # True if the text is bold.
3887 "strikethrough": True or False, # True if the text has a strikethrough.
3888 "fontFamily": "A String", # The font family.
3889 "fontSize": 42, # The size of the font.
3890 "italic": True or False, # True if the text is italicized.
3891 "underline": True or False, # True if the text is underlined.
3892 },
3893 },
3894 ],
3895 },
3896 ],
3897 },
3898 ],
3899 "sheetId": 42, # The sheet ID to append the data to.
3900 },
3901 "duplicateSheet": { # Duplicates the contents of a sheet. # Duplicates a sheet.
3902 "sourceSheetId": 42, # The sheet to duplicate.
3903 "insertSheetIndex": 42, # The zero-based index where the new sheet should be inserted.
3904 # The index of all sheets after this are incremented.
3905 "newSheetName": "A String", # The name of the new sheet. If empty, a new name is chosen for you.
3906 "newSheetId": 42, # If set, the ID of the new sheet. If not set, an ID is chosen.
3907 # If set, the ID must not conflict with any existing sheet ID.
3908 # If set, it must be non-negative.
3909 },
3910 "updateSheetProperties": { # Updates properties of the sheet with the specified # Updates a sheet's properties.
3911 # sheetId.
3912 # It is an error to specify read only fields in the field mask.
3913 "fields": "A String", # The fields that should be updated. At least one field must be specified.
3914 # The root `properties` is implied and should not be specified.
3915 # A single `"*"` can be used as short-hand for listing every field.
3916 "properties": { # Properties of a sheet. # The properties to update.
3917 "sheetType": "A String", # The type of sheet. Defaults to GRID.
3918 # This field cannot be changed once set.
3919 "index": 42, # The index of the sheet within the spreadsheet.
3920 # When adding or updating sheet properties, if this field
3921 # is excluded then the sheet will be added or moved to the end
3922 # of the sheet list.
3923 "title": "A String", # The name of the sheet.
3924 "gridProperties": { # Properties of a grid. # Additional properties of the sheet if this sheet is a grid.
3925 # (If the sheet is an object sheet, containing a chart or image, then
3926 # this field will be absent.)
3927 # When writing it is an error to set any grid properties on non-grid sheets.
3928 "columnCount": 42, # The number of columns in the grid.
3929 "rowCount": 42, # The number of rows in the grid.
3930 "frozenColumnCount": 42, # The number of columns that are frozen in the grid.
3931 "hideGridlines": True or False, # True if the grid isn't showing gridlines in the UI.
3932 "frozenRowCount": 42, # The number of rows that are frozen in the grid.
3933 },
3934 "rightToLeft": True or False, # True if the sheet is an RTL sheet instead of an LTR sheet.
3935 "tabColor": { # Represents a color in the RGBA color space. This representation is designed # The color of the tab in the UI.
3936 # for simplicity of conversion to/from color representations in various
3937 # languages over compactness; for example, the fields of this representation
3938 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
3939 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
3940 # method in iOS; and, with just a little work, it can be easily formatted into
3941 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
3942 #
3943 # Example (Java):
3944 #
3945 # import com.google.type.Color;
3946 #
3947 # // ...
3948 # public static java.awt.Color fromProto(Color protocolor) {
3949 # float alpha = protocolor.hasAlpha()
3950 # ? protocolor.getAlpha().getValue()
3951 # : 1.0;
3952 #
3953 # return new java.awt.Color(
3954 # protocolor.getRed(),
3955 # protocolor.getGreen(),
3956 # protocolor.getBlue(),
3957 # alpha);
3958 # }
3959 #
3960 # public static Color toProto(java.awt.Color color) {
3961 # float red = (float) color.getRed();
3962 # float green = (float) color.getGreen();
3963 # float blue = (float) color.getBlue();
3964 # float denominator = 255.0;
3965 # Color.Builder resultBuilder =
3966 # Color
3967 # .newBuilder()
3968 # .setRed(red / denominator)
3969 # .setGreen(green / denominator)
3970 # .setBlue(blue / denominator);
3971 # int alpha = color.getAlpha();
3972 # if (alpha != 255) {
3973 # result.setAlpha(
3974 # FloatValue
3975 # .newBuilder()
3976 # .setValue(((float) alpha) / denominator)
3977 # .build());
3978 # }
3979 # return resultBuilder.build();
3980 # }
3981 # // ...
3982 #
3983 # Example (iOS / Obj-C):
3984 #
3985 # // ...
3986 # static UIColor* fromProto(Color* protocolor) {
3987 # float red = [protocolor red];
3988 # float green = [protocolor green];
3989 # float blue = [protocolor blue];
3990 # FloatValue* alpha_wrapper = [protocolor alpha];
3991 # float alpha = 1.0;
3992 # if (alpha_wrapper != nil) {
3993 # alpha = [alpha_wrapper value];
3994 # }
3995 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
3996 # }
3997 #
3998 # static Color* toProto(UIColor* color) {
3999 # CGFloat red, green, blue, alpha;
4000 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
4001 # return nil;
4002 # }
4003 # Color* result = [Color alloc] init];
4004 # [result setRed:red];
4005 # [result setGreen:green];
4006 # [result setBlue:blue];
4007 # if (alpha <= 0.9999) {
4008 # [result setAlpha:floatWrapperWithValue(alpha)];
4009 # }
4010 # [result autorelease];
4011 # return result;
4012 # }
4013 # // ...
4014 #
4015 # Example (JavaScript):
4016 #
4017 # // ...
4018 #
4019 # var protoToCssColor = function(rgb_color) {
4020 # var redFrac = rgb_color.red || 0.0;
4021 # var greenFrac = rgb_color.green || 0.0;
4022 # var blueFrac = rgb_color.blue || 0.0;
4023 # var red = Math.floor(redFrac * 255);
4024 # var green = Math.floor(greenFrac * 255);
4025 # var blue = Math.floor(blueFrac * 255);
4026 #
4027 # if (!('alpha' in rgb_color)) {
4028 # return rgbToCssColor_(red, green, blue);
4029 # }
4030 #
4031 # var alphaFrac = rgb_color.alpha.value || 0.0;
4032 # var rgbParams = [red, green, blue].join(',');
4033 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
4034 # };
4035 #
4036 # var rgbToCssColor_ = function(red, green, blue) {
4037 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
4038 # var hexString = rgbNumber.toString(16);
4039 # var missingZeros = 6 - hexString.length;
4040 # var resultBuilder = ['#'];
4041 # for (var i = 0; i < missingZeros; i++) {
4042 # resultBuilder.push('0');
4043 # }
4044 # resultBuilder.push(hexString);
4045 # return resultBuilder.join('');
4046 # };
4047 #
4048 # // ...
4049 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
4050 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
4051 # the final pixel color is defined by the equation:
4052 #
4053 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
4054 #
4055 # This means that a value of 1.0 corresponds to a solid color, whereas
4056 # a value of 0.0 corresponds to a completely transparent color. This
4057 # uses a wrapper message rather than a simple float scalar so that it is
4058 # possible to distinguish between a default value and the value being unset.
4059 # If omitted, this color object is to be rendered as a solid color
4060 # (as if the alpha value had been explicitly given with a value of 1.0).
4061 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
4062 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
4063 },
4064 "hidden": True or False, # True if the sheet is hidden in the UI, false if it's visible.
4065 "sheetId": 42, # The ID of the sheet. Must be non-negative.
4066 # This field cannot be changed once set.
4067 },
4068 },
4069 "addChart": { # Adds a chart to a sheet in the spreadsheet. # Adds a chart.
4070 "chart": { # A chart embedded in a sheet. # The chart that should be added to the spreadsheet, including the position
4071 # where it should be placed.
4072 "chartId": 42, # The ID of the chart.
4073 "position": { # The position of an embedded object such as a chart. # The position of the chart.
4074 "newSheet": True or False, # If true, the embedded object will be put on a new sheet whose ID
4075 # is chosen for you. Used only when writing.
4076 "sheetId": 42, # The sheet this is on. Set only if the embedded object
4077 # is on its own sheet. Must be non-negative.
4078 "overlayPosition": { # The location an object is overlaid on top of a grid. # The position the object is overlaid on top of a grid.
4079 "anchorCell": { # A coordinate in a sheet. # The cell the object is anchored to.
4080 # All indexes are zero-based.
4081 "rowIndex": 42, # The row index of the coordinate.
4082 "columnIndex": 42, # The column index of the coordinate.
4083 "sheetId": 42, # The sheet this coordinate is on.
4084 },
4085 "offsetYPixels": 42, # The vertical offset, in pixels, that the object is offset
4086 # from the anchor cell.
4087 "widthPixels": 42, # The width of the object, in pixels. Defaults to 600.
4088 "offsetXPixels": 42, # The horizontal offset, in pixels, that the object is offset
4089 # from the anchor cell.
4090 "heightPixels": 42, # The height of the object, in pixels. Defaults to 371.
4091 },
4092 },
4093 "spec": { # The specifications of a chart. # The specification of the chart.
4094 "hiddenDimensionStrategy": "A String", # Determines how the charts will use hidden rows or columns.
4095 # This value is only meaningful if the
4096 # ChartData.sourceRange
4097 # is used for a domain or series.
4098 "pieChart": { # A <a href="/chart/interactive/docs/gallery/piechart">pie chart</a>. # A pie chart specification.
4099 "series": { # The data included in a domain or series. # The data that covers the one and only series of the pie chart.
4100 "sourceRange": { # Source ranges for a chart. # The source ranges of the data.
4101 "sources": [ # The ranges of data for a series or domain.
4102 # Exactly one dimension must have a length of 1,
4103 # and all sources in the list must have the same dimension
4104 # with length 1.
4105 # The domain (if it exists) & all series must have the same number
4106 # of source ranges. If using more than one source range, then the source
4107 # range at a given offset must be contiguous across the domain and series.
4108 #
4109 # For example, these are valid configurations:
4110 #
4111 # domain sources: A1:A5
4112 # series1 sources: B1:B5
4113 # series2 sources: D6:D10
4114 #
4115 # domain sources: A1:A5, C10:C12
4116 # series1 sources: B1:B5, D10:D12
4117 # series2 sources: C1:C5, E10:E12
4118 { # A range on a sheet.
4119 # All indexes are zero-based.
4120 # Indexes are half open, e.g the start index is inclusive
4121 # and the end index is exclusive -- [start_index, end_index).
4122 # Missing indexes indicate the range is unbounded on that side.
4123 #
4124 # For example, if "Sheet1" is grid ID 0, then:
4125 #
4126 # Sheet1!A1:A1 == sheet_id: 0,
4127 # start_row_index: 0, end_row_index: 1,
4128 # start_column_index: 0, end_column_index: 1
4129 #
4130 # Sheet1!A3:B4 == sheet_id: 0,
4131 # start_row_index: 2, end_row_index: 4,
4132 # start_column_index: 0, end_column_index: 2
4133 #
4134 # Sheet1!A:B == sheet_id: 0,
4135 # start_column_index: 0, end_column_index: 2
4136 #
4137 # Sheet1!A5:B == sheet_id: 0,
4138 # start_row_index: 4,
4139 # start_column_index: 0, end_column_index: 2
4140 #
4141 # Sheet1 == sheet_id:0
4142 #
4143 # The start index must always be less than or equal to the end index.
4144 # If the start index equals the end index, then the range is empty.
4145 # Empty ranges are typically not meaningful and are usually rendered in the
4146 # UI as `#REF!`.
4147 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
4148 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
4149 "sheetId": 42, # The sheet this range is on.
4150 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
4151 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
4152 },
4153 ],
4154 },
4155 },
4156 "domain": { # The data included in a domain or series. # The data that covers the domain of the pie chart.
4157 "sourceRange": { # Source ranges for a chart. # The source ranges of the data.
4158 "sources": [ # The ranges of data for a series or domain.
4159 # Exactly one dimension must have a length of 1,
4160 # and all sources in the list must have the same dimension
4161 # with length 1.
4162 # The domain (if it exists) & all series must have the same number
4163 # of source ranges. If using more than one source range, then the source
4164 # range at a given offset must be contiguous across the domain and series.
4165 #
4166 # For example, these are valid configurations:
4167 #
4168 # domain sources: A1:A5
4169 # series1 sources: B1:B5
4170 # series2 sources: D6:D10
4171 #
4172 # domain sources: A1:A5, C10:C12
4173 # series1 sources: B1:B5, D10:D12
4174 # series2 sources: C1:C5, E10:E12
4175 { # A range on a sheet.
4176 # All indexes are zero-based.
4177 # Indexes are half open, e.g the start index is inclusive
4178 # and the end index is exclusive -- [start_index, end_index).
4179 # Missing indexes indicate the range is unbounded on that side.
4180 #
4181 # For example, if "Sheet1" is grid ID 0, then:
4182 #
4183 # Sheet1!A1:A1 == sheet_id: 0,
4184 # start_row_index: 0, end_row_index: 1,
4185 # start_column_index: 0, end_column_index: 1
4186 #
4187 # Sheet1!A3:B4 == sheet_id: 0,
4188 # start_row_index: 2, end_row_index: 4,
4189 # start_column_index: 0, end_column_index: 2
4190 #
4191 # Sheet1!A:B == sheet_id: 0,
4192 # start_column_index: 0, end_column_index: 2
4193 #
4194 # Sheet1!A5:B == sheet_id: 0,
4195 # start_row_index: 4,
4196 # start_column_index: 0, end_column_index: 2
4197 #
4198 # Sheet1 == sheet_id:0
4199 #
4200 # The start index must always be less than or equal to the end index.
4201 # If the start index equals the end index, then the range is empty.
4202 # Empty ranges are typically not meaningful and are usually rendered in the
4203 # UI as `#REF!`.
4204 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
4205 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
4206 "sheetId": 42, # The sheet this range is on.
4207 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
4208 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
4209 },
4210 ],
4211 },
4212 },
4213 "threeDimensional": True or False, # True if the pie is three dimensional.
4214 "legendPosition": "A String", # Where the legend of the pie chart should be drawn.
4215 "pieHole": 3.14, # The size of the hole in the pie chart.
4216 },
4217 "basicChart": { # The specification for a basic chart. See BasicChartType for the list # A basic chart specification, can be one of many kinds of charts.
4218 # See BasicChartType for the list of all charts this supports.
4219 # of charts this supports.
4220 "headerCount": 42, # The number of rows or columns in the data that are "headers".
4221 # If not set, Google Sheets will guess how many rows are headers based
4222 # on the data.
4223 #
4224 # (Note that BasicChartAxis.title may override the axis title
4225 # inferred from the header values.)
4226 "series": [ # The data this chart is visualizing.
4227 { # A single series of data in a chart.
4228 # For example, if charting stock prices over time, multiple series may exist,
4229 # one for the "Open Price", "High Price", "Low Price" and "Close Price".
4230 "series": { # The data included in a domain or series. # The data being visualized in this chart series.
4231 "sourceRange": { # Source ranges for a chart. # The source ranges of the data.
4232 "sources": [ # The ranges of data for a series or domain.
4233 # Exactly one dimension must have a length of 1,
4234 # and all sources in the list must have the same dimension
4235 # with length 1.
4236 # The domain (if it exists) & all series must have the same number
4237 # of source ranges. If using more than one source range, then the source
4238 # range at a given offset must be contiguous across the domain and series.
4239 #
4240 # For example, these are valid configurations:
4241 #
4242 # domain sources: A1:A5
4243 # series1 sources: B1:B5
4244 # series2 sources: D6:D10
4245 #
4246 # domain sources: A1:A5, C10:C12
4247 # series1 sources: B1:B5, D10:D12
4248 # series2 sources: C1:C5, E10:E12
4249 { # A range on a sheet.
4250 # All indexes are zero-based.
4251 # Indexes are half open, e.g the start index is inclusive
4252 # and the end index is exclusive -- [start_index, end_index).
4253 # Missing indexes indicate the range is unbounded on that side.
4254 #
4255 # For example, if "Sheet1" is grid ID 0, then:
4256 #
4257 # Sheet1!A1:A1 == sheet_id: 0,
4258 # start_row_index: 0, end_row_index: 1,
4259 # start_column_index: 0, end_column_index: 1
4260 #
4261 # Sheet1!A3:B4 == sheet_id: 0,
4262 # start_row_index: 2, end_row_index: 4,
4263 # start_column_index: 0, end_column_index: 2
4264 #
4265 # Sheet1!A:B == sheet_id: 0,
4266 # start_column_index: 0, end_column_index: 2
4267 #
4268 # Sheet1!A5:B == sheet_id: 0,
4269 # start_row_index: 4,
4270 # start_column_index: 0, end_column_index: 2
4271 #
4272 # Sheet1 == sheet_id:0
4273 #
4274 # The start index must always be less than or equal to the end index.
4275 # If the start index equals the end index, then the range is empty.
4276 # Empty ranges are typically not meaningful and are usually rendered in the
4277 # UI as `#REF!`.
4278 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
4279 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
4280 "sheetId": 42, # The sheet this range is on.
4281 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
4282 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
4283 },
4284 ],
4285 },
4286 },
4287 "targetAxis": "A String", # The minor axis that will specify the range of values for this series.
4288 # For example, if charting stocks over time, the "Volume" series
4289 # may want to be pinned to the right with the prices pinned to the left,
4290 # because the scale of trading volume is different than the scale of
4291 # prices.
4292 # It is an error to specify an axis that isn't a valid minor axis
4293 # for the chart's type.
4294 "type": "A String", # The type of this series. Valid only if the
4295 # chartType is
4296 # COMBO.
4297 # Different types will change the way the series is visualized.
4298 # Only LINE, AREA,
4299 # and COLUMN are supported.
4300 },
4301 ],
4302 "legendPosition": "A String", # The position of the chart legend.
4303 "domains": [ # The domain of data this is charting.
4304 # Only a single domain is currently supported.
4305 { # The domain of a chart.
4306 # For example, if charting stock prices over time, this would be the date.
4307 "domain": { # The data included in a domain or series. # The data of the domain. For example, if charting stock prices over time,
4308 # this be the data representing the dates.
4309 "sourceRange": { # Source ranges for a chart. # The source ranges of the data.
4310 "sources": [ # The ranges of data for a series or domain.
4311 # Exactly one dimension must have a length of 1,
4312 # and all sources in the list must have the same dimension
4313 # with length 1.
4314 # The domain (if it exists) & all series must have the same number
4315 # of source ranges. If using more than one source range, then the source
4316 # range at a given offset must be contiguous across the domain and series.
4317 #
4318 # For example, these are valid configurations:
4319 #
4320 # domain sources: A1:A5
4321 # series1 sources: B1:B5
4322 # series2 sources: D6:D10
4323 #
4324 # domain sources: A1:A5, C10:C12
4325 # series1 sources: B1:B5, D10:D12
4326 # series2 sources: C1:C5, E10:E12
4327 { # A range on a sheet.
4328 # All indexes are zero-based.
4329 # Indexes are half open, e.g the start index is inclusive
4330 # and the end index is exclusive -- [start_index, end_index).
4331 # Missing indexes indicate the range is unbounded on that side.
4332 #
4333 # For example, if "Sheet1" is grid ID 0, then:
4334 #
4335 # Sheet1!A1:A1 == sheet_id: 0,
4336 # start_row_index: 0, end_row_index: 1,
4337 # start_column_index: 0, end_column_index: 1
4338 #
4339 # Sheet1!A3:B4 == sheet_id: 0,
4340 # start_row_index: 2, end_row_index: 4,
4341 # start_column_index: 0, end_column_index: 2
4342 #
4343 # Sheet1!A:B == sheet_id: 0,
4344 # start_column_index: 0, end_column_index: 2
4345 #
4346 # Sheet1!A5:B == sheet_id: 0,
4347 # start_row_index: 4,
4348 # start_column_index: 0, end_column_index: 2
4349 #
4350 # Sheet1 == sheet_id:0
4351 #
4352 # The start index must always be less than or equal to the end index.
4353 # If the start index equals the end index, then the range is empty.
4354 # Empty ranges are typically not meaningful and are usually rendered in the
4355 # UI as `#REF!`.
4356 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
4357 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
4358 "sheetId": 42, # The sheet this range is on.
4359 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
4360 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
4361 },
4362 ],
4363 },
4364 },
4365 },
4366 ],
4367 "chartType": "A String", # The type of the chart.
4368 "axis": [ # The axis on the chart.
4369 { # An axis of the chart.
4370 # A chart may not have more than one axis per
4371 # axis position.
4372 "position": "A String", # The position of this axis.
4373 "format": { # The format of a run of text in a cell. # The format of the title.
4374 # Only valid if the axis is not associated with the domain.
4375 # Absent values indicate that the field isn't specified.
4376 "foregroundColor": { # Represents a color in the RGBA color space. This representation is designed # The foreground color of the text.
4377 # for simplicity of conversion to/from color representations in various
4378 # languages over compactness; for example, the fields of this representation
4379 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
4380 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
4381 # method in iOS; and, with just a little work, it can be easily formatted into
4382 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
4383 #
4384 # Example (Java):
4385 #
4386 # import com.google.type.Color;
4387 #
4388 # // ...
4389 # public static java.awt.Color fromProto(Color protocolor) {
4390 # float alpha = protocolor.hasAlpha()
4391 # ? protocolor.getAlpha().getValue()
4392 # : 1.0;
4393 #
4394 # return new java.awt.Color(
4395 # protocolor.getRed(),
4396 # protocolor.getGreen(),
4397 # protocolor.getBlue(),
4398 # alpha);
4399 # }
4400 #
4401 # public static Color toProto(java.awt.Color color) {
4402 # float red = (float) color.getRed();
4403 # float green = (float) color.getGreen();
4404 # float blue = (float) color.getBlue();
4405 # float denominator = 255.0;
4406 # Color.Builder resultBuilder =
4407 # Color
4408 # .newBuilder()
4409 # .setRed(red / denominator)
4410 # .setGreen(green / denominator)
4411 # .setBlue(blue / denominator);
4412 # int alpha = color.getAlpha();
4413 # if (alpha != 255) {
4414 # result.setAlpha(
4415 # FloatValue
4416 # .newBuilder()
4417 # .setValue(((float) alpha) / denominator)
4418 # .build());
4419 # }
4420 # return resultBuilder.build();
4421 # }
4422 # // ...
4423 #
4424 # Example (iOS / Obj-C):
4425 #
4426 # // ...
4427 # static UIColor* fromProto(Color* protocolor) {
4428 # float red = [protocolor red];
4429 # float green = [protocolor green];
4430 # float blue = [protocolor blue];
4431 # FloatValue* alpha_wrapper = [protocolor alpha];
4432 # float alpha = 1.0;
4433 # if (alpha_wrapper != nil) {
4434 # alpha = [alpha_wrapper value];
4435 # }
4436 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
4437 # }
4438 #
4439 # static Color* toProto(UIColor* color) {
4440 # CGFloat red, green, blue, alpha;
4441 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
4442 # return nil;
4443 # }
4444 # Color* result = [Color alloc] init];
4445 # [result setRed:red];
4446 # [result setGreen:green];
4447 # [result setBlue:blue];
4448 # if (alpha <= 0.9999) {
4449 # [result setAlpha:floatWrapperWithValue(alpha)];
4450 # }
4451 # [result autorelease];
4452 # return result;
4453 # }
4454 # // ...
4455 #
4456 # Example (JavaScript):
4457 #
4458 # // ...
4459 #
4460 # var protoToCssColor = function(rgb_color) {
4461 # var redFrac = rgb_color.red || 0.0;
4462 # var greenFrac = rgb_color.green || 0.0;
4463 # var blueFrac = rgb_color.blue || 0.0;
4464 # var red = Math.floor(redFrac * 255);
4465 # var green = Math.floor(greenFrac * 255);
4466 # var blue = Math.floor(blueFrac * 255);
4467 #
4468 # if (!('alpha' in rgb_color)) {
4469 # return rgbToCssColor_(red, green, blue);
4470 # }
4471 #
4472 # var alphaFrac = rgb_color.alpha.value || 0.0;
4473 # var rgbParams = [red, green, blue].join(',');
4474 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
4475 # };
4476 #
4477 # var rgbToCssColor_ = function(red, green, blue) {
4478 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
4479 # var hexString = rgbNumber.toString(16);
4480 # var missingZeros = 6 - hexString.length;
4481 # var resultBuilder = ['#'];
4482 # for (var i = 0; i < missingZeros; i++) {
4483 # resultBuilder.push('0');
4484 # }
4485 # resultBuilder.push(hexString);
4486 # return resultBuilder.join('');
4487 # };
4488 #
4489 # // ...
4490 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
4491 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
4492 # the final pixel color is defined by the equation:
4493 #
4494 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
4495 #
4496 # This means that a value of 1.0 corresponds to a solid color, whereas
4497 # a value of 0.0 corresponds to a completely transparent color. This
4498 # uses a wrapper message rather than a simple float scalar so that it is
4499 # possible to distinguish between a default value and the value being unset.
4500 # If omitted, this color object is to be rendered as a solid color
4501 # (as if the alpha value had been explicitly given with a value of 1.0).
4502 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
4503 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
4504 },
4505 "bold": True or False, # True if the text is bold.
4506 "strikethrough": True or False, # True if the text has a strikethrough.
4507 "fontFamily": "A String", # The font family.
4508 "fontSize": 42, # The size of the font.
4509 "italic": True or False, # True if the text is italicized.
4510 "underline": True or False, # True if the text is underlined.
4511 },
4512 "title": "A String", # The title of this axis. If set, this overrides any title inferred
4513 # from headers of the data.
4514 },
4515 ],
4516 },
4517 "title": "A String", # The title of the chart.
4518 },
4519 },
4520 },
4521 "addConditionalFormatRule": { # Adds a new conditional format rule at the given index. # Adds a new conditional format rule.
4522 # All subsequent rules' indexes are incremented.
4523 "index": 42, # The zero-based index where the rule should be inserted.
4524 "rule": { # A rule describing a conditional format. # The rule to add.
4525 "ranges": [ # The ranges that will be formatted if the condition is true.
4526 # All the ranges must be on the same grid.
4527 { # A range on a sheet.
4528 # All indexes are zero-based.
4529 # Indexes are half open, e.g the start index is inclusive
4530 # and the end index is exclusive -- [start_index, end_index).
4531 # Missing indexes indicate the range is unbounded on that side.
4532 #
4533 # For example, if "Sheet1" is grid ID 0, then:
4534 #
4535 # Sheet1!A1:A1 == sheet_id: 0,
4536 # start_row_index: 0, end_row_index: 1,
4537 # start_column_index: 0, end_column_index: 1
4538 #
4539 # Sheet1!A3:B4 == sheet_id: 0,
4540 # start_row_index: 2, end_row_index: 4,
4541 # start_column_index: 0, end_column_index: 2
4542 #
4543 # Sheet1!A:B == sheet_id: 0,
4544 # start_column_index: 0, end_column_index: 2
4545 #
4546 # Sheet1!A5:B == sheet_id: 0,
4547 # start_row_index: 4,
4548 # start_column_index: 0, end_column_index: 2
4549 #
4550 # Sheet1 == sheet_id:0
4551 #
4552 # The start index must always be less than or equal to the end index.
4553 # If the start index equals the end index, then the range is empty.
4554 # Empty ranges are typically not meaningful and are usually rendered in the
4555 # UI as `#REF!`.
4556 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
4557 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
4558 "sheetId": 42, # The sheet this range is on.
4559 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
4560 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
4561 },
4562 ],
4563 "booleanRule": { # A rule that may or may not match, depending on the condition. # The formatting is either "on" or "off" according to the rule.
4564 "condition": { # A condition that can evaluate to true or false. # The condition of the rule. If the condition evaluates to true,
4565 # the format will be applied.
4566 # BooleanConditions are used by conditional formatting,
4567 # data validation, and the criteria in filters.
4568 "type": "A String", # The type of condition.
4569 "values": [ # The values of the condition. The number of supported values depends
4570 # on the condition type. Some support zero values,
4571 # others one or two values,
4572 # and ConditionType.ONE_OF_LIST supports an arbitrary number of values.
4573 { # The value of the condition.
4574 "relativeDate": "A String", # A relative date (based on the current date).
4575 # Valid only if the type is
4576 # DATE_BEFORE,
4577 # DATE_AFTER,
4578 # DATE_ON_OR_BEFORE or
4579 # DATE_ON_OR_AFTER.
4580 #
4581 # Relative dates are not supported in data validation.
4582 # They are supported only in conditional formatting and
4583 # conditional filters.
4584 "userEnteredValue": "A String", # A value the condition is based on.
4585 # The value will be parsed as if the user typed into a cell.
4586 # Formulas are supported (and must begin with an `=`).
4587 },
4588 ],
4589 },
4590 "format": { # The format of a cell. # The format to apply.
4591 # Conditional formatting can only apply a subset of formatting:
4592 # bold, italic,
4593 # strikethrough,
4594 # foreground color &
4595 # background color.
4596 "numberFormat": { # The number format of a cell. # A format describing how number values should be represented to the user.
4597 # When updating, all fields must be set.
4598 "pattern": "A String", # Pattern string used for formatting.
4599 "type": "A String", # The type of the number format.
4600 },
4601 "textDirection": "A String", # The direction of the text in the cell.
4602 "padding": { # The amount of padding around the cell, in pixels. # The padding of the cell.
4603 # When updating padding, every field must be specified.
4604 "top": 42, # The top padding of the cell.
4605 "right": 42, # The right padding of the cell.
4606 "bottom": 42, # The bottom padding of the cell.
4607 "left": 42, # The left padding of the cell.
4608 },
4609 "horizontalAlignment": "A String", # The horizontal alignment of the value in cell.
4610 "backgroundColor": { # Represents a color in the RGBA color space. This representation is designed # The background color of the cell.
4611 # for simplicity of conversion to/from color representations in various
4612 # languages over compactness; for example, the fields of this representation
4613 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
4614 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
4615 # method in iOS; and, with just a little work, it can be easily formatted into
4616 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
4617 #
4618 # Example (Java):
4619 #
4620 # import com.google.type.Color;
4621 #
4622 # // ...
4623 # public static java.awt.Color fromProto(Color protocolor) {
4624 # float alpha = protocolor.hasAlpha()
4625 # ? protocolor.getAlpha().getValue()
4626 # : 1.0;
4627 #
4628 # return new java.awt.Color(
4629 # protocolor.getRed(),
4630 # protocolor.getGreen(),
4631 # protocolor.getBlue(),
4632 # alpha);
4633 # }
4634 #
4635 # public static Color toProto(java.awt.Color color) {
4636 # float red = (float) color.getRed();
4637 # float green = (float) color.getGreen();
4638 # float blue = (float) color.getBlue();
4639 # float denominator = 255.0;
4640 # Color.Builder resultBuilder =
4641 # Color
4642 # .newBuilder()
4643 # .setRed(red / denominator)
4644 # .setGreen(green / denominator)
4645 # .setBlue(blue / denominator);
4646 # int alpha = color.getAlpha();
4647 # if (alpha != 255) {
4648 # result.setAlpha(
4649 # FloatValue
4650 # .newBuilder()
4651 # .setValue(((float) alpha) / denominator)
4652 # .build());
4653 # }
4654 # return resultBuilder.build();
4655 # }
4656 # // ...
4657 #
4658 # Example (iOS / Obj-C):
4659 #
4660 # // ...
4661 # static UIColor* fromProto(Color* protocolor) {
4662 # float red = [protocolor red];
4663 # float green = [protocolor green];
4664 # float blue = [protocolor blue];
4665 # FloatValue* alpha_wrapper = [protocolor alpha];
4666 # float alpha = 1.0;
4667 # if (alpha_wrapper != nil) {
4668 # alpha = [alpha_wrapper value];
4669 # }
4670 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
4671 # }
4672 #
4673 # static Color* toProto(UIColor* color) {
4674 # CGFloat red, green, blue, alpha;
4675 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
4676 # return nil;
4677 # }
4678 # Color* result = [Color alloc] init];
4679 # [result setRed:red];
4680 # [result setGreen:green];
4681 # [result setBlue:blue];
4682 # if (alpha <= 0.9999) {
4683 # [result setAlpha:floatWrapperWithValue(alpha)];
4684 # }
4685 # [result autorelease];
4686 # return result;
4687 # }
4688 # // ...
4689 #
4690 # Example (JavaScript):
4691 #
4692 # // ...
4693 #
4694 # var protoToCssColor = function(rgb_color) {
4695 # var redFrac = rgb_color.red || 0.0;
4696 # var greenFrac = rgb_color.green || 0.0;
4697 # var blueFrac = rgb_color.blue || 0.0;
4698 # var red = Math.floor(redFrac * 255);
4699 # var green = Math.floor(greenFrac * 255);
4700 # var blue = Math.floor(blueFrac * 255);
4701 #
4702 # if (!('alpha' in rgb_color)) {
4703 # return rgbToCssColor_(red, green, blue);
4704 # }
4705 #
4706 # var alphaFrac = rgb_color.alpha.value || 0.0;
4707 # var rgbParams = [red, green, blue].join(',');
4708 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
4709 # };
4710 #
4711 # var rgbToCssColor_ = function(red, green, blue) {
4712 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
4713 # var hexString = rgbNumber.toString(16);
4714 # var missingZeros = 6 - hexString.length;
4715 # var resultBuilder = ['#'];
4716 # for (var i = 0; i < missingZeros; i++) {
4717 # resultBuilder.push('0');
4718 # }
4719 # resultBuilder.push(hexString);
4720 # return resultBuilder.join('');
4721 # };
4722 #
4723 # // ...
4724 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
4725 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
4726 # the final pixel color is defined by the equation:
4727 #
4728 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
4729 #
4730 # This means that a value of 1.0 corresponds to a solid color, whereas
4731 # a value of 0.0 corresponds to a completely transparent color. This
4732 # uses a wrapper message rather than a simple float scalar so that it is
4733 # possible to distinguish between a default value and the value being unset.
4734 # If omitted, this color object is to be rendered as a solid color
4735 # (as if the alpha value had been explicitly given with a value of 1.0).
4736 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
4737 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
4738 },
4739 "verticalAlignment": "A String", # The vertical alignment of the value in cell.
4740 "textFormat": { # The format of a run of text in a cell. # The format of the text in the cell (unless overridden by a format run).
4741 # Absent values indicate that the field isn't specified.
4742 "foregroundColor": { # Represents a color in the RGBA color space. This representation is designed # The foreground color of the text.
4743 # for simplicity of conversion to/from color representations in various
4744 # languages over compactness; for example, the fields of this representation
4745 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
4746 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
4747 # method in iOS; and, with just a little work, it can be easily formatted into
4748 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
4749 #
4750 # Example (Java):
4751 #
4752 # import com.google.type.Color;
4753 #
4754 # // ...
4755 # public static java.awt.Color fromProto(Color protocolor) {
4756 # float alpha = protocolor.hasAlpha()
4757 # ? protocolor.getAlpha().getValue()
4758 # : 1.0;
4759 #
4760 # return new java.awt.Color(
4761 # protocolor.getRed(),
4762 # protocolor.getGreen(),
4763 # protocolor.getBlue(),
4764 # alpha);
4765 # }
4766 #
4767 # public static Color toProto(java.awt.Color color) {
4768 # float red = (float) color.getRed();
4769 # float green = (float) color.getGreen();
4770 # float blue = (float) color.getBlue();
4771 # float denominator = 255.0;
4772 # Color.Builder resultBuilder =
4773 # Color
4774 # .newBuilder()
4775 # .setRed(red / denominator)
4776 # .setGreen(green / denominator)
4777 # .setBlue(blue / denominator);
4778 # int alpha = color.getAlpha();
4779 # if (alpha != 255) {
4780 # result.setAlpha(
4781 # FloatValue
4782 # .newBuilder()
4783 # .setValue(((float) alpha) / denominator)
4784 # .build());
4785 # }
4786 # return resultBuilder.build();
4787 # }
4788 # // ...
4789 #
4790 # Example (iOS / Obj-C):
4791 #
4792 # // ...
4793 # static UIColor* fromProto(Color* protocolor) {
4794 # float red = [protocolor red];
4795 # float green = [protocolor green];
4796 # float blue = [protocolor blue];
4797 # FloatValue* alpha_wrapper = [protocolor alpha];
4798 # float alpha = 1.0;
4799 # if (alpha_wrapper != nil) {
4800 # alpha = [alpha_wrapper value];
4801 # }
4802 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
4803 # }
4804 #
4805 # static Color* toProto(UIColor* color) {
4806 # CGFloat red, green, blue, alpha;
4807 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
4808 # return nil;
4809 # }
4810 # Color* result = [Color alloc] init];
4811 # [result setRed:red];
4812 # [result setGreen:green];
4813 # [result setBlue:blue];
4814 # if (alpha <= 0.9999) {
4815 # [result setAlpha:floatWrapperWithValue(alpha)];
4816 # }
4817 # [result autorelease];
4818 # return result;
4819 # }
4820 # // ...
4821 #
4822 # Example (JavaScript):
4823 #
4824 # // ...
4825 #
4826 # var protoToCssColor = function(rgb_color) {
4827 # var redFrac = rgb_color.red || 0.0;
4828 # var greenFrac = rgb_color.green || 0.0;
4829 # var blueFrac = rgb_color.blue || 0.0;
4830 # var red = Math.floor(redFrac * 255);
4831 # var green = Math.floor(greenFrac * 255);
4832 # var blue = Math.floor(blueFrac * 255);
4833 #
4834 # if (!('alpha' in rgb_color)) {
4835 # return rgbToCssColor_(red, green, blue);
4836 # }
4837 #
4838 # var alphaFrac = rgb_color.alpha.value || 0.0;
4839 # var rgbParams = [red, green, blue].join(',');
4840 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
4841 # };
4842 #
4843 # var rgbToCssColor_ = function(red, green, blue) {
4844 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
4845 # var hexString = rgbNumber.toString(16);
4846 # var missingZeros = 6 - hexString.length;
4847 # var resultBuilder = ['#'];
4848 # for (var i = 0; i < missingZeros; i++) {
4849 # resultBuilder.push('0');
4850 # }
4851 # resultBuilder.push(hexString);
4852 # return resultBuilder.join('');
4853 # };
4854 #
4855 # // ...
4856 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
4857 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
4858 # the final pixel color is defined by the equation:
4859 #
4860 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
4861 #
4862 # This means that a value of 1.0 corresponds to a solid color, whereas
4863 # a value of 0.0 corresponds to a completely transparent color. This
4864 # uses a wrapper message rather than a simple float scalar so that it is
4865 # possible to distinguish between a default value and the value being unset.
4866 # If omitted, this color object is to be rendered as a solid color
4867 # (as if the alpha value had been explicitly given with a value of 1.0).
4868 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
4869 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
4870 },
4871 "bold": True or False, # True if the text is bold.
4872 "strikethrough": True or False, # True if the text has a strikethrough.
4873 "fontFamily": "A String", # The font family.
4874 "fontSize": 42, # The size of the font.
4875 "italic": True or False, # True if the text is italicized.
4876 "underline": True or False, # True if the text is underlined.
4877 },
4878 "hyperlinkDisplayType": "A String", # How a hyperlink, if it exists, should be displayed in the cell.
4879 "borders": { # The borders of the cell. # The borders of the cell.
4880 "top": { # A border along a cell. # The top border of the cell.
4881 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
4882 # for simplicity of conversion to/from color representations in various
4883 # languages over compactness; for example, the fields of this representation
4884 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
4885 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
4886 # method in iOS; and, with just a little work, it can be easily formatted into
4887 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
4888 #
4889 # Example (Java):
4890 #
4891 # import com.google.type.Color;
4892 #
4893 # // ...
4894 # public static java.awt.Color fromProto(Color protocolor) {
4895 # float alpha = protocolor.hasAlpha()
4896 # ? protocolor.getAlpha().getValue()
4897 # : 1.0;
4898 #
4899 # return new java.awt.Color(
4900 # protocolor.getRed(),
4901 # protocolor.getGreen(),
4902 # protocolor.getBlue(),
4903 # alpha);
4904 # }
4905 #
4906 # public static Color toProto(java.awt.Color color) {
4907 # float red = (float) color.getRed();
4908 # float green = (float) color.getGreen();
4909 # float blue = (float) color.getBlue();
4910 # float denominator = 255.0;
4911 # Color.Builder resultBuilder =
4912 # Color
4913 # .newBuilder()
4914 # .setRed(red / denominator)
4915 # .setGreen(green / denominator)
4916 # .setBlue(blue / denominator);
4917 # int alpha = color.getAlpha();
4918 # if (alpha != 255) {
4919 # result.setAlpha(
4920 # FloatValue
4921 # .newBuilder()
4922 # .setValue(((float) alpha) / denominator)
4923 # .build());
4924 # }
4925 # return resultBuilder.build();
4926 # }
4927 # // ...
4928 #
4929 # Example (iOS / Obj-C):
4930 #
4931 # // ...
4932 # static UIColor* fromProto(Color* protocolor) {
4933 # float red = [protocolor red];
4934 # float green = [protocolor green];
4935 # float blue = [protocolor blue];
4936 # FloatValue* alpha_wrapper = [protocolor alpha];
4937 # float alpha = 1.0;
4938 # if (alpha_wrapper != nil) {
4939 # alpha = [alpha_wrapper value];
4940 # }
4941 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
4942 # }
4943 #
4944 # static Color* toProto(UIColor* color) {
4945 # CGFloat red, green, blue, alpha;
4946 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
4947 # return nil;
4948 # }
4949 # Color* result = [Color alloc] init];
4950 # [result setRed:red];
4951 # [result setGreen:green];
4952 # [result setBlue:blue];
4953 # if (alpha <= 0.9999) {
4954 # [result setAlpha:floatWrapperWithValue(alpha)];
4955 # }
4956 # [result autorelease];
4957 # return result;
4958 # }
4959 # // ...
4960 #
4961 # Example (JavaScript):
4962 #
4963 # // ...
4964 #
4965 # var protoToCssColor = function(rgb_color) {
4966 # var redFrac = rgb_color.red || 0.0;
4967 # var greenFrac = rgb_color.green || 0.0;
4968 # var blueFrac = rgb_color.blue || 0.0;
4969 # var red = Math.floor(redFrac * 255);
4970 # var green = Math.floor(greenFrac * 255);
4971 # var blue = Math.floor(blueFrac * 255);
4972 #
4973 # if (!('alpha' in rgb_color)) {
4974 # return rgbToCssColor_(red, green, blue);
4975 # }
4976 #
4977 # var alphaFrac = rgb_color.alpha.value || 0.0;
4978 # var rgbParams = [red, green, blue].join(',');
4979 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
4980 # };
4981 #
4982 # var rgbToCssColor_ = function(red, green, blue) {
4983 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
4984 # var hexString = rgbNumber.toString(16);
4985 # var missingZeros = 6 - hexString.length;
4986 # var resultBuilder = ['#'];
4987 # for (var i = 0; i < missingZeros; i++) {
4988 # resultBuilder.push('0');
4989 # }
4990 # resultBuilder.push(hexString);
4991 # return resultBuilder.join('');
4992 # };
4993 #
4994 # // ...
4995 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
4996 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
4997 # the final pixel color is defined by the equation:
4998 #
4999 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
5000 #
5001 # This means that a value of 1.0 corresponds to a solid color, whereas
5002 # a value of 0.0 corresponds to a completely transparent color. This
5003 # uses a wrapper message rather than a simple float scalar so that it is
5004 # possible to distinguish between a default value and the value being unset.
5005 # If omitted, this color object is to be rendered as a solid color
5006 # (as if the alpha value had been explicitly given with a value of 1.0).
5007 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
5008 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
5009 },
5010 "width": 42, # The width of the border, in pixels.
5011 # Border widths must be between 0 and 3 pixels.
5012 "style": "A String", # The style of the border.
5013 },
5014 "right": { # A border along a cell. # The right border of the cell.
5015 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
5016 # for simplicity of conversion to/from color representations in various
5017 # languages over compactness; for example, the fields of this representation
5018 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
5019 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
5020 # method in iOS; and, with just a little work, it can be easily formatted into
5021 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
5022 #
5023 # Example (Java):
5024 #
5025 # import com.google.type.Color;
5026 #
5027 # // ...
5028 # public static java.awt.Color fromProto(Color protocolor) {
5029 # float alpha = protocolor.hasAlpha()
5030 # ? protocolor.getAlpha().getValue()
5031 # : 1.0;
5032 #
5033 # return new java.awt.Color(
5034 # protocolor.getRed(),
5035 # protocolor.getGreen(),
5036 # protocolor.getBlue(),
5037 # alpha);
5038 # }
5039 #
5040 # public static Color toProto(java.awt.Color color) {
5041 # float red = (float) color.getRed();
5042 # float green = (float) color.getGreen();
5043 # float blue = (float) color.getBlue();
5044 # float denominator = 255.0;
5045 # Color.Builder resultBuilder =
5046 # Color
5047 # .newBuilder()
5048 # .setRed(red / denominator)
5049 # .setGreen(green / denominator)
5050 # .setBlue(blue / denominator);
5051 # int alpha = color.getAlpha();
5052 # if (alpha != 255) {
5053 # result.setAlpha(
5054 # FloatValue
5055 # .newBuilder()
5056 # .setValue(((float) alpha) / denominator)
5057 # .build());
5058 # }
5059 # return resultBuilder.build();
5060 # }
5061 # // ...
5062 #
5063 # Example (iOS / Obj-C):
5064 #
5065 # // ...
5066 # static UIColor* fromProto(Color* protocolor) {
5067 # float red = [protocolor red];
5068 # float green = [protocolor green];
5069 # float blue = [protocolor blue];
5070 # FloatValue* alpha_wrapper = [protocolor alpha];
5071 # float alpha = 1.0;
5072 # if (alpha_wrapper != nil) {
5073 # alpha = [alpha_wrapper value];
5074 # }
5075 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
5076 # }
5077 #
5078 # static Color* toProto(UIColor* color) {
5079 # CGFloat red, green, blue, alpha;
5080 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
5081 # return nil;
5082 # }
5083 # Color* result = [Color alloc] init];
5084 # [result setRed:red];
5085 # [result setGreen:green];
5086 # [result setBlue:blue];
5087 # if (alpha <= 0.9999) {
5088 # [result setAlpha:floatWrapperWithValue(alpha)];
5089 # }
5090 # [result autorelease];
5091 # return result;
5092 # }
5093 # // ...
5094 #
5095 # Example (JavaScript):
5096 #
5097 # // ...
5098 #
5099 # var protoToCssColor = function(rgb_color) {
5100 # var redFrac = rgb_color.red || 0.0;
5101 # var greenFrac = rgb_color.green || 0.0;
5102 # var blueFrac = rgb_color.blue || 0.0;
5103 # var red = Math.floor(redFrac * 255);
5104 # var green = Math.floor(greenFrac * 255);
5105 # var blue = Math.floor(blueFrac * 255);
5106 #
5107 # if (!('alpha' in rgb_color)) {
5108 # return rgbToCssColor_(red, green, blue);
5109 # }
5110 #
5111 # var alphaFrac = rgb_color.alpha.value || 0.0;
5112 # var rgbParams = [red, green, blue].join(',');
5113 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
5114 # };
5115 #
5116 # var rgbToCssColor_ = function(red, green, blue) {
5117 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
5118 # var hexString = rgbNumber.toString(16);
5119 # var missingZeros = 6 - hexString.length;
5120 # var resultBuilder = ['#'];
5121 # for (var i = 0; i < missingZeros; i++) {
5122 # resultBuilder.push('0');
5123 # }
5124 # resultBuilder.push(hexString);
5125 # return resultBuilder.join('');
5126 # };
5127 #
5128 # // ...
5129 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
5130 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
5131 # the final pixel color is defined by the equation:
5132 #
5133 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
5134 #
5135 # This means that a value of 1.0 corresponds to a solid color, whereas
5136 # a value of 0.0 corresponds to a completely transparent color. This
5137 # uses a wrapper message rather than a simple float scalar so that it is
5138 # possible to distinguish between a default value and the value being unset.
5139 # If omitted, this color object is to be rendered as a solid color
5140 # (as if the alpha value had been explicitly given with a value of 1.0).
5141 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
5142 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
5143 },
5144 "width": 42, # The width of the border, in pixels.
5145 # Border widths must be between 0 and 3 pixels.
5146 "style": "A String", # The style of the border.
5147 },
5148 "bottom": { # A border along a cell. # The bottom border of the cell.
5149 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
5150 # for simplicity of conversion to/from color representations in various
5151 # languages over compactness; for example, the fields of this representation
5152 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
5153 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
5154 # method in iOS; and, with just a little work, it can be easily formatted into
5155 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
5156 #
5157 # Example (Java):
5158 #
5159 # import com.google.type.Color;
5160 #
5161 # // ...
5162 # public static java.awt.Color fromProto(Color protocolor) {
5163 # float alpha = protocolor.hasAlpha()
5164 # ? protocolor.getAlpha().getValue()
5165 # : 1.0;
5166 #
5167 # return new java.awt.Color(
5168 # protocolor.getRed(),
5169 # protocolor.getGreen(),
5170 # protocolor.getBlue(),
5171 # alpha);
5172 # }
5173 #
5174 # public static Color toProto(java.awt.Color color) {
5175 # float red = (float) color.getRed();
5176 # float green = (float) color.getGreen();
5177 # float blue = (float) color.getBlue();
5178 # float denominator = 255.0;
5179 # Color.Builder resultBuilder =
5180 # Color
5181 # .newBuilder()
5182 # .setRed(red / denominator)
5183 # .setGreen(green / denominator)
5184 # .setBlue(blue / denominator);
5185 # int alpha = color.getAlpha();
5186 # if (alpha != 255) {
5187 # result.setAlpha(
5188 # FloatValue
5189 # .newBuilder()
5190 # .setValue(((float) alpha) / denominator)
5191 # .build());
5192 # }
5193 # return resultBuilder.build();
5194 # }
5195 # // ...
5196 #
5197 # Example (iOS / Obj-C):
5198 #
5199 # // ...
5200 # static UIColor* fromProto(Color* protocolor) {
5201 # float red = [protocolor red];
5202 # float green = [protocolor green];
5203 # float blue = [protocolor blue];
5204 # FloatValue* alpha_wrapper = [protocolor alpha];
5205 # float alpha = 1.0;
5206 # if (alpha_wrapper != nil) {
5207 # alpha = [alpha_wrapper value];
5208 # }
5209 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
5210 # }
5211 #
5212 # static Color* toProto(UIColor* color) {
5213 # CGFloat red, green, blue, alpha;
5214 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
5215 # return nil;
5216 # }
5217 # Color* result = [Color alloc] init];
5218 # [result setRed:red];
5219 # [result setGreen:green];
5220 # [result setBlue:blue];
5221 # if (alpha <= 0.9999) {
5222 # [result setAlpha:floatWrapperWithValue(alpha)];
5223 # }
5224 # [result autorelease];
5225 # return result;
5226 # }
5227 # // ...
5228 #
5229 # Example (JavaScript):
5230 #
5231 # // ...
5232 #
5233 # var protoToCssColor = function(rgb_color) {
5234 # var redFrac = rgb_color.red || 0.0;
5235 # var greenFrac = rgb_color.green || 0.0;
5236 # var blueFrac = rgb_color.blue || 0.0;
5237 # var red = Math.floor(redFrac * 255);
5238 # var green = Math.floor(greenFrac * 255);
5239 # var blue = Math.floor(blueFrac * 255);
5240 #
5241 # if (!('alpha' in rgb_color)) {
5242 # return rgbToCssColor_(red, green, blue);
5243 # }
5244 #
5245 # var alphaFrac = rgb_color.alpha.value || 0.0;
5246 # var rgbParams = [red, green, blue].join(',');
5247 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
5248 # };
5249 #
5250 # var rgbToCssColor_ = function(red, green, blue) {
5251 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
5252 # var hexString = rgbNumber.toString(16);
5253 # var missingZeros = 6 - hexString.length;
5254 # var resultBuilder = ['#'];
5255 # for (var i = 0; i < missingZeros; i++) {
5256 # resultBuilder.push('0');
5257 # }
5258 # resultBuilder.push(hexString);
5259 # return resultBuilder.join('');
5260 # };
5261 #
5262 # // ...
5263 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
5264 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
5265 # the final pixel color is defined by the equation:
5266 #
5267 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
5268 #
5269 # This means that a value of 1.0 corresponds to a solid color, whereas
5270 # a value of 0.0 corresponds to a completely transparent color. This
5271 # uses a wrapper message rather than a simple float scalar so that it is
5272 # possible to distinguish between a default value and the value being unset.
5273 # If omitted, this color object is to be rendered as a solid color
5274 # (as if the alpha value had been explicitly given with a value of 1.0).
5275 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
5276 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
5277 },
5278 "width": 42, # The width of the border, in pixels.
5279 # Border widths must be between 0 and 3 pixels.
5280 "style": "A String", # The style of the border.
5281 },
5282 "left": { # A border along a cell. # The left border of the cell.
5283 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
5284 # for simplicity of conversion to/from color representations in various
5285 # languages over compactness; for example, the fields of this representation
5286 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
5287 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
5288 # method in iOS; and, with just a little work, it can be easily formatted into
5289 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
5290 #
5291 # Example (Java):
5292 #
5293 # import com.google.type.Color;
5294 #
5295 # // ...
5296 # public static java.awt.Color fromProto(Color protocolor) {
5297 # float alpha = protocolor.hasAlpha()
5298 # ? protocolor.getAlpha().getValue()
5299 # : 1.0;
5300 #
5301 # return new java.awt.Color(
5302 # protocolor.getRed(),
5303 # protocolor.getGreen(),
5304 # protocolor.getBlue(),
5305 # alpha);
5306 # }
5307 #
5308 # public static Color toProto(java.awt.Color color) {
5309 # float red = (float) color.getRed();
5310 # float green = (float) color.getGreen();
5311 # float blue = (float) color.getBlue();
5312 # float denominator = 255.0;
5313 # Color.Builder resultBuilder =
5314 # Color
5315 # .newBuilder()
5316 # .setRed(red / denominator)
5317 # .setGreen(green / denominator)
5318 # .setBlue(blue / denominator);
5319 # int alpha = color.getAlpha();
5320 # if (alpha != 255) {
5321 # result.setAlpha(
5322 # FloatValue
5323 # .newBuilder()
5324 # .setValue(((float) alpha) / denominator)
5325 # .build());
5326 # }
5327 # return resultBuilder.build();
5328 # }
5329 # // ...
5330 #
5331 # Example (iOS / Obj-C):
5332 #
5333 # // ...
5334 # static UIColor* fromProto(Color* protocolor) {
5335 # float red = [protocolor red];
5336 # float green = [protocolor green];
5337 # float blue = [protocolor blue];
5338 # FloatValue* alpha_wrapper = [protocolor alpha];
5339 # float alpha = 1.0;
5340 # if (alpha_wrapper != nil) {
5341 # alpha = [alpha_wrapper value];
5342 # }
5343 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
5344 # }
5345 #
5346 # static Color* toProto(UIColor* color) {
5347 # CGFloat red, green, blue, alpha;
5348 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
5349 # return nil;
5350 # }
5351 # Color* result = [Color alloc] init];
5352 # [result setRed:red];
5353 # [result setGreen:green];
5354 # [result setBlue:blue];
5355 # if (alpha <= 0.9999) {
5356 # [result setAlpha:floatWrapperWithValue(alpha)];
5357 # }
5358 # [result autorelease];
5359 # return result;
5360 # }
5361 # // ...
5362 #
5363 # Example (JavaScript):
5364 #
5365 # // ...
5366 #
5367 # var protoToCssColor = function(rgb_color) {
5368 # var redFrac = rgb_color.red || 0.0;
5369 # var greenFrac = rgb_color.green || 0.0;
5370 # var blueFrac = rgb_color.blue || 0.0;
5371 # var red = Math.floor(redFrac * 255);
5372 # var green = Math.floor(greenFrac * 255);
5373 # var blue = Math.floor(blueFrac * 255);
5374 #
5375 # if (!('alpha' in rgb_color)) {
5376 # return rgbToCssColor_(red, green, blue);
5377 # }
5378 #
5379 # var alphaFrac = rgb_color.alpha.value || 0.0;
5380 # var rgbParams = [red, green, blue].join(',');
5381 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
5382 # };
5383 #
5384 # var rgbToCssColor_ = function(red, green, blue) {
5385 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
5386 # var hexString = rgbNumber.toString(16);
5387 # var missingZeros = 6 - hexString.length;
5388 # var resultBuilder = ['#'];
5389 # for (var i = 0; i < missingZeros; i++) {
5390 # resultBuilder.push('0');
5391 # }
5392 # resultBuilder.push(hexString);
5393 # return resultBuilder.join('');
5394 # };
5395 #
5396 # // ...
5397 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
5398 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
5399 # the final pixel color is defined by the equation:
5400 #
5401 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
5402 #
5403 # This means that a value of 1.0 corresponds to a solid color, whereas
5404 # a value of 0.0 corresponds to a completely transparent color. This
5405 # uses a wrapper message rather than a simple float scalar so that it is
5406 # possible to distinguish between a default value and the value being unset.
5407 # If omitted, this color object is to be rendered as a solid color
5408 # (as if the alpha value had been explicitly given with a value of 1.0).
5409 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
5410 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
5411 },
5412 "width": 42, # The width of the border, in pixels.
5413 # Border widths must be between 0 and 3 pixels.
5414 "style": "A String", # The style of the border.
5415 },
5416 },
5417 "wrapStrategy": "A String", # The wrap strategy for the value in the cell.
5418 },
5419 },
5420 "gradientRule": { # A rule that applies a gradient color scale format, based on # The formatting will vary based on the gradients in the rule.
5421 # the interpolation points listed. The format of a cell will vary
5422 # based on its contents as compared to the values of the interpolation
5423 # points.
5424 "maxpoint": { # A single interpolation point a gradient conditional format. # The final interpolation point.
5425 # These pin the gradient color scale according to the color,
5426 # type and value chosen.
5427 "color": { # Represents a color in the RGBA color space. This representation is designed # The color this interpolation point should use.
5428 # for simplicity of conversion to/from color representations in various
5429 # languages over compactness; for example, the fields of this representation
5430 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
5431 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
5432 # method in iOS; and, with just a little work, it can be easily formatted into
5433 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
5434 #
5435 # Example (Java):
5436 #
5437 # import com.google.type.Color;
5438 #
5439 # // ...
5440 # public static java.awt.Color fromProto(Color protocolor) {
5441 # float alpha = protocolor.hasAlpha()
5442 # ? protocolor.getAlpha().getValue()
5443 # : 1.0;
5444 #
5445 # return new java.awt.Color(
5446 # protocolor.getRed(),
5447 # protocolor.getGreen(),
5448 # protocolor.getBlue(),
5449 # alpha);
5450 # }
5451 #
5452 # public static Color toProto(java.awt.Color color) {
5453 # float red = (float) color.getRed();
5454 # float green = (float) color.getGreen();
5455 # float blue = (float) color.getBlue();
5456 # float denominator = 255.0;
5457 # Color.Builder resultBuilder =
5458 # Color
5459 # .newBuilder()
5460 # .setRed(red / denominator)
5461 # .setGreen(green / denominator)
5462 # .setBlue(blue / denominator);
5463 # int alpha = color.getAlpha();
5464 # if (alpha != 255) {
5465 # result.setAlpha(
5466 # FloatValue
5467 # .newBuilder()
5468 # .setValue(((float) alpha) / denominator)
5469 # .build());
5470 # }
5471 # return resultBuilder.build();
5472 # }
5473 # // ...
5474 #
5475 # Example (iOS / Obj-C):
5476 #
5477 # // ...
5478 # static UIColor* fromProto(Color* protocolor) {
5479 # float red = [protocolor red];
5480 # float green = [protocolor green];
5481 # float blue = [protocolor blue];
5482 # FloatValue* alpha_wrapper = [protocolor alpha];
5483 # float alpha = 1.0;
5484 # if (alpha_wrapper != nil) {
5485 # alpha = [alpha_wrapper value];
5486 # }
5487 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
5488 # }
5489 #
5490 # static Color* toProto(UIColor* color) {
5491 # CGFloat red, green, blue, alpha;
5492 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
5493 # return nil;
5494 # }
5495 # Color* result = [Color alloc] init];
5496 # [result setRed:red];
5497 # [result setGreen:green];
5498 # [result setBlue:blue];
5499 # if (alpha <= 0.9999) {
5500 # [result setAlpha:floatWrapperWithValue(alpha)];
5501 # }
5502 # [result autorelease];
5503 # return result;
5504 # }
5505 # // ...
5506 #
5507 # Example (JavaScript):
5508 #
5509 # // ...
5510 #
5511 # var protoToCssColor = function(rgb_color) {
5512 # var redFrac = rgb_color.red || 0.0;
5513 # var greenFrac = rgb_color.green || 0.0;
5514 # var blueFrac = rgb_color.blue || 0.0;
5515 # var red = Math.floor(redFrac * 255);
5516 # var green = Math.floor(greenFrac * 255);
5517 # var blue = Math.floor(blueFrac * 255);
5518 #
5519 # if (!('alpha' in rgb_color)) {
5520 # return rgbToCssColor_(red, green, blue);
5521 # }
5522 #
5523 # var alphaFrac = rgb_color.alpha.value || 0.0;
5524 # var rgbParams = [red, green, blue].join(',');
5525 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
5526 # };
5527 #
5528 # var rgbToCssColor_ = function(red, green, blue) {
5529 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
5530 # var hexString = rgbNumber.toString(16);
5531 # var missingZeros = 6 - hexString.length;
5532 # var resultBuilder = ['#'];
5533 # for (var i = 0; i < missingZeros; i++) {
5534 # resultBuilder.push('0');
5535 # }
5536 # resultBuilder.push(hexString);
5537 # return resultBuilder.join('');
5538 # };
5539 #
5540 # // ...
5541 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
5542 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
5543 # the final pixel color is defined by the equation:
5544 #
5545 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
5546 #
5547 # This means that a value of 1.0 corresponds to a solid color, whereas
5548 # a value of 0.0 corresponds to a completely transparent color. This
5549 # uses a wrapper message rather than a simple float scalar so that it is
5550 # possible to distinguish between a default value and the value being unset.
5551 # If omitted, this color object is to be rendered as a solid color
5552 # (as if the alpha value had been explicitly given with a value of 1.0).
5553 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
5554 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
5555 },
5556 "type": "A String", # How the value should be interpreted.
5557 "value": "A String", # The value this interpolation point uses. May be a formula.
5558 # Unused if type is MIN or
5559 # MAX.
5560 },
5561 "midpoint": { # A single interpolation point a gradient conditional format. # An optional midway interpolation point.
5562 # These pin the gradient color scale according to the color,
5563 # type and value chosen.
5564 "color": { # Represents a color in the RGBA color space. This representation is designed # The color this interpolation point should use.
5565 # for simplicity of conversion to/from color representations in various
5566 # languages over compactness; for example, the fields of this representation
5567 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
5568 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
5569 # method in iOS; and, with just a little work, it can be easily formatted into
5570 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
5571 #
5572 # Example (Java):
5573 #
5574 # import com.google.type.Color;
5575 #
5576 # // ...
5577 # public static java.awt.Color fromProto(Color protocolor) {
5578 # float alpha = protocolor.hasAlpha()
5579 # ? protocolor.getAlpha().getValue()
5580 # : 1.0;
5581 #
5582 # return new java.awt.Color(
5583 # protocolor.getRed(),
5584 # protocolor.getGreen(),
5585 # protocolor.getBlue(),
5586 # alpha);
5587 # }
5588 #
5589 # public static Color toProto(java.awt.Color color) {
5590 # float red = (float) color.getRed();
5591 # float green = (float) color.getGreen();
5592 # float blue = (float) color.getBlue();
5593 # float denominator = 255.0;
5594 # Color.Builder resultBuilder =
5595 # Color
5596 # .newBuilder()
5597 # .setRed(red / denominator)
5598 # .setGreen(green / denominator)
5599 # .setBlue(blue / denominator);
5600 # int alpha = color.getAlpha();
5601 # if (alpha != 255) {
5602 # result.setAlpha(
5603 # FloatValue
5604 # .newBuilder()
5605 # .setValue(((float) alpha) / denominator)
5606 # .build());
5607 # }
5608 # return resultBuilder.build();
5609 # }
5610 # // ...
5611 #
5612 # Example (iOS / Obj-C):
5613 #
5614 # // ...
5615 # static UIColor* fromProto(Color* protocolor) {
5616 # float red = [protocolor red];
5617 # float green = [protocolor green];
5618 # float blue = [protocolor blue];
5619 # FloatValue* alpha_wrapper = [protocolor alpha];
5620 # float alpha = 1.0;
5621 # if (alpha_wrapper != nil) {
5622 # alpha = [alpha_wrapper value];
5623 # }
5624 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
5625 # }
5626 #
5627 # static Color* toProto(UIColor* color) {
5628 # CGFloat red, green, blue, alpha;
5629 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
5630 # return nil;
5631 # }
5632 # Color* result = [Color alloc] init];
5633 # [result setRed:red];
5634 # [result setGreen:green];
5635 # [result setBlue:blue];
5636 # if (alpha <= 0.9999) {
5637 # [result setAlpha:floatWrapperWithValue(alpha)];
5638 # }
5639 # [result autorelease];
5640 # return result;
5641 # }
5642 # // ...
5643 #
5644 # Example (JavaScript):
5645 #
5646 # // ...
5647 #
5648 # var protoToCssColor = function(rgb_color) {
5649 # var redFrac = rgb_color.red || 0.0;
5650 # var greenFrac = rgb_color.green || 0.0;
5651 # var blueFrac = rgb_color.blue || 0.0;
5652 # var red = Math.floor(redFrac * 255);
5653 # var green = Math.floor(greenFrac * 255);
5654 # var blue = Math.floor(blueFrac * 255);
5655 #
5656 # if (!('alpha' in rgb_color)) {
5657 # return rgbToCssColor_(red, green, blue);
5658 # }
5659 #
5660 # var alphaFrac = rgb_color.alpha.value || 0.0;
5661 # var rgbParams = [red, green, blue].join(',');
5662 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
5663 # };
5664 #
5665 # var rgbToCssColor_ = function(red, green, blue) {
5666 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
5667 # var hexString = rgbNumber.toString(16);
5668 # var missingZeros = 6 - hexString.length;
5669 # var resultBuilder = ['#'];
5670 # for (var i = 0; i < missingZeros; i++) {
5671 # resultBuilder.push('0');
5672 # }
5673 # resultBuilder.push(hexString);
5674 # return resultBuilder.join('');
5675 # };
5676 #
5677 # // ...
5678 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
5679 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
5680 # the final pixel color is defined by the equation:
5681 #
5682 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
5683 #
5684 # This means that a value of 1.0 corresponds to a solid color, whereas
5685 # a value of 0.0 corresponds to a completely transparent color. This
5686 # uses a wrapper message rather than a simple float scalar so that it is
5687 # possible to distinguish between a default value and the value being unset.
5688 # If omitted, this color object is to be rendered as a solid color
5689 # (as if the alpha value had been explicitly given with a value of 1.0).
5690 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
5691 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
5692 },
5693 "type": "A String", # How the value should be interpreted.
5694 "value": "A String", # The value this interpolation point uses. May be a formula.
5695 # Unused if type is MIN or
5696 # MAX.
5697 },
5698 "minpoint": { # A single interpolation point a gradient conditional format. # The starting interpolation point.
5699 # These pin the gradient color scale according to the color,
5700 # type and value chosen.
5701 "color": { # Represents a color in the RGBA color space. This representation is designed # The color this interpolation point should use.
5702 # for simplicity of conversion to/from color representations in various
5703 # languages over compactness; for example, the fields of this representation
5704 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
5705 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
5706 # method in iOS; and, with just a little work, it can be easily formatted into
5707 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
5708 #
5709 # Example (Java):
5710 #
5711 # import com.google.type.Color;
5712 #
5713 # // ...
5714 # public static java.awt.Color fromProto(Color protocolor) {
5715 # float alpha = protocolor.hasAlpha()
5716 # ? protocolor.getAlpha().getValue()
5717 # : 1.0;
5718 #
5719 # return new java.awt.Color(
5720 # protocolor.getRed(),
5721 # protocolor.getGreen(),
5722 # protocolor.getBlue(),
5723 # alpha);
5724 # }
5725 #
5726 # public static Color toProto(java.awt.Color color) {
5727 # float red = (float) color.getRed();
5728 # float green = (float) color.getGreen();
5729 # float blue = (float) color.getBlue();
5730 # float denominator = 255.0;
5731 # Color.Builder resultBuilder =
5732 # Color
5733 # .newBuilder()
5734 # .setRed(red / denominator)
5735 # .setGreen(green / denominator)
5736 # .setBlue(blue / denominator);
5737 # int alpha = color.getAlpha();
5738 # if (alpha != 255) {
5739 # result.setAlpha(
5740 # FloatValue
5741 # .newBuilder()
5742 # .setValue(((float) alpha) / denominator)
5743 # .build());
5744 # }
5745 # return resultBuilder.build();
5746 # }
5747 # // ...
5748 #
5749 # Example (iOS / Obj-C):
5750 #
5751 # // ...
5752 # static UIColor* fromProto(Color* protocolor) {
5753 # float red = [protocolor red];
5754 # float green = [protocolor green];
5755 # float blue = [protocolor blue];
5756 # FloatValue* alpha_wrapper = [protocolor alpha];
5757 # float alpha = 1.0;
5758 # if (alpha_wrapper != nil) {
5759 # alpha = [alpha_wrapper value];
5760 # }
5761 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
5762 # }
5763 #
5764 # static Color* toProto(UIColor* color) {
5765 # CGFloat red, green, blue, alpha;
5766 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
5767 # return nil;
5768 # }
5769 # Color* result = [Color alloc] init];
5770 # [result setRed:red];
5771 # [result setGreen:green];
5772 # [result setBlue:blue];
5773 # if (alpha <= 0.9999) {
5774 # [result setAlpha:floatWrapperWithValue(alpha)];
5775 # }
5776 # [result autorelease];
5777 # return result;
5778 # }
5779 # // ...
5780 #
5781 # Example (JavaScript):
5782 #
5783 # // ...
5784 #
5785 # var protoToCssColor = function(rgb_color) {
5786 # var redFrac = rgb_color.red || 0.0;
5787 # var greenFrac = rgb_color.green || 0.0;
5788 # var blueFrac = rgb_color.blue || 0.0;
5789 # var red = Math.floor(redFrac * 255);
5790 # var green = Math.floor(greenFrac * 255);
5791 # var blue = Math.floor(blueFrac * 255);
5792 #
5793 # if (!('alpha' in rgb_color)) {
5794 # return rgbToCssColor_(red, green, blue);
5795 # }
5796 #
5797 # var alphaFrac = rgb_color.alpha.value || 0.0;
5798 # var rgbParams = [red, green, blue].join(',');
5799 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
5800 # };
5801 #
5802 # var rgbToCssColor_ = function(red, green, blue) {
5803 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
5804 # var hexString = rgbNumber.toString(16);
5805 # var missingZeros = 6 - hexString.length;
5806 # var resultBuilder = ['#'];
5807 # for (var i = 0; i < missingZeros; i++) {
5808 # resultBuilder.push('0');
5809 # }
5810 # resultBuilder.push(hexString);
5811 # return resultBuilder.join('');
5812 # };
5813 #
5814 # // ...
5815 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
5816 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
5817 # the final pixel color is defined by the equation:
5818 #
5819 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
5820 #
5821 # This means that a value of 1.0 corresponds to a solid color, whereas
5822 # a value of 0.0 corresponds to a completely transparent color. This
5823 # uses a wrapper message rather than a simple float scalar so that it is
5824 # possible to distinguish between a default value and the value being unset.
5825 # If omitted, this color object is to be rendered as a solid color
5826 # (as if the alpha value had been explicitly given with a value of 1.0).
5827 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
5828 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
5829 },
5830 "type": "A String", # How the value should be interpreted.
5831 "value": "A String", # The value this interpolation point uses. May be a formula.
5832 # Unused if type is MIN or
5833 # MAX.
5834 },
5835 },
5836 },
5837 },
5838 "repeatCell": { # Updates all cells in the range to the values in the given Cell object. # Repeats a single cell across a range.
5839 # Only the fields listed in the fields field are updated; others are
5840 # unchanged.
5841 #
5842 # If writing a cell with a formula, the formula's ranges will automatically
5843 # increment for each field in the range.
5844 # For example, if writing a cell with formula `=A1` into range B2:C4,
5845 # B2 would be `=A1`, B3 would be `=A2`, B4 would be `=A3`,
5846 # C2 would be `=B1`, C3 would be `=B2`, C4 would be `=B3`.
5847 #
5848 # To keep the formula's ranges static, use the `$` indicator.
5849 # For example, using the formula was `=$A$1`, neither
5850 # the row nor column would increment.
5851 "cell": { # Data about a specific cell. # The data to write.
5852 "pivotTable": { # A pivot table. # A pivot table anchored at this cell. The size of pivot table itself
5853 # is computed dynamically based on its data, grouping, filters, values,
5854 # etc... Only the top-left cell of the pivot table contains the pivot table
5855 # definition. The other cells will contain the calculated values of the
5856 # results of the pivot in their effectiveValue fields.
5857 "valueLayout": "A String", # Whether values should be listed horizontally (as columns)
5858 # or vertically (as rows).
5859 "rows": [ # Each row grouping in the pivot table.
5860 { # A single grouping (either row or column) in a pivot table.
5861 "showTotals": True or False, # True if the pivot table should include the totals for this grouping.
5862 "valueMetadata": [ # Metadata about values in the grouping.
5863 { # Metadata about a value in a pivot grouping.
5864 "collapsed": True or False, # True if the data corresponding to the value is collapsed.
5865 "value": { # The kinds of value that a cell in a spreadsheet can have. # The calculated value the metadata corresponds to.
5866 # (Note that formulaValue is not valid,
5867 # because the values will be calculated.)
5868 "numberValue": 3.14, # Represents a double value.
5869 # Note: Dates, Times and DateTimes are represented as doubles in
5870 # "serial number" format.
5871 "boolValue": True or False, # Represents a boolean value.
5872 "formulaValue": "A String", # Represents a formula.
5873 "stringValue": "A String", # Represents a string value.
5874 # Leading single quotes are not included. For example, if the user typed
5875 # `'123` into the UI, this would be represented as a `stringValue` of
5876 # `"123"`.
5877 "errorValue": { # An error in a cell. # Represents an error.
5878 # This field is read-only.
5879 "message": "A String", # A message with more information about the error
5880 # (in the spreadsheet's locale).
5881 "type": "A String", # The type of error.
5882 },
5883 },
5884 },
5885 ],
5886 "valueBucket": { # Information about which values in a pivot group should be used for sorting. # The bucket of the opposite pivot group to sort by.
5887 # If not specified, sorting is alphabetical by this group's values.
5888 "buckets": [ # Determines the bucket from which values are chosen to sort.
5889 #
5890 # For example, in a pivot table with one row group & two column groups,
5891 # the row group can list up to two values. The first value corresponds
5892 # to a value within the first column group, and the second value
5893 # corresponds to a value in the second column group. If no values
5894 # are listed, this would indicate that the row should be sorted according
5895 # to the "Grand Total" over the column groups. If a single value is listed,
5896 # this would correspond to using the "Total" of that bucket.
5897 { # The kinds of value that a cell in a spreadsheet can have.
5898 "numberValue": 3.14, # Represents a double value.
5899 # Note: Dates, Times and DateTimes are represented as doubles in
5900 # "serial number" format.
5901 "boolValue": True or False, # Represents a boolean value.
5902 "formulaValue": "A String", # Represents a formula.
5903 "stringValue": "A String", # Represents a string value.
5904 # Leading single quotes are not included. For example, if the user typed
5905 # `'123` into the UI, this would be represented as a `stringValue` of
5906 # `"123"`.
5907 "errorValue": { # An error in a cell. # Represents an error.
5908 # This field is read-only.
5909 "message": "A String", # A message with more information about the error
5910 # (in the spreadsheet's locale).
5911 "type": "A String", # The type of error.
5912 },
5913 },
5914 ],
5915 "valuesIndex": 42, # The offset in the [PivotTable.values] list which the values in this
5916 # grouping should be sorted by.
5917 },
5918 "sortOrder": "A String", # The order the values in this group should be sorted.
5919 "sourceColumnOffset": 42, # The column offset of the source range that this grouping is based on.
5920 #
5921 # For example, if the source was `C10:E15', a `sourceColumnOffset` of `0`
5922 # means this group refers to column `C`, whereas the offset `1` would refer
5923 # to column `D`.
5924 },
5925 ],
5926 "source": { # A range on a sheet. # The range the pivot table is reading data from.
5927 # All indexes are zero-based.
5928 # Indexes are half open, e.g the start index is inclusive
5929 # and the end index is exclusive -- [start_index, end_index).
5930 # Missing indexes indicate the range is unbounded on that side.
5931 #
5932 # For example, if "Sheet1" is grid ID 0, then:
5933 #
5934 # Sheet1!A1:A1 == sheet_id: 0,
5935 # start_row_index: 0, end_row_index: 1,
5936 # start_column_index: 0, end_column_index: 1
5937 #
5938 # Sheet1!A3:B4 == sheet_id: 0,
5939 # start_row_index: 2, end_row_index: 4,
5940 # start_column_index: 0, end_column_index: 2
5941 #
5942 # Sheet1!A:B == sheet_id: 0,
5943 # start_column_index: 0, end_column_index: 2
5944 #
5945 # Sheet1!A5:B == sheet_id: 0,
5946 # start_row_index: 4,
5947 # start_column_index: 0, end_column_index: 2
5948 #
5949 # Sheet1 == sheet_id:0
5950 #
5951 # The start index must always be less than or equal to the end index.
5952 # If the start index equals the end index, then the range is empty.
5953 # Empty ranges are typically not meaningful and are usually rendered in the
5954 # UI as `#REF!`.
5955 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
5956 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
5957 "sheetId": 42, # The sheet this range is on.
5958 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
5959 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
5960 },
5961 "values": [ # A list of values to include in the pivot table.
5962 { # The definition of how a value in a pivot table should be calculated.
5963 "formula": "A String", # A custom formula to calculate the value. The formula must start
5964 # with an `=` character.
5965 "summarizeFunction": "A String", # A function to summarize the value.
5966 # If formula is set, the only supported values are
5967 # SUM and
5968 # CUSTOM.
5969 # If sourceColumnOffset is set, then `CUSTOM`
5970 # is not supported.
5971 "sourceColumnOffset": 42, # The column offset of the source range that this value reads from.
5972 #
5973 # For example, if the source was `C10:E15', a `sourceColumnOffset` of `0`
5974 # means this value refers to column `C`, whereas the offset `1` would
5975 # refer to column `D`.
5976 "name": "A String", # A name to use for the value. This is only used if formula was set.
5977 # Otherwise, the column name is used.
5978 },
5979 ],
5980 "criteria": { # An optional mapping of filters per source column offset.
5981 #
5982 # The filters will be applied before aggregating data into the pivot table.
5983 # The map's key is the column offset of the source range that you want to
5984 # filter, and the value is the criteria for that column.
5985 #
5986 # For example, if the source was `C10:E15', a key of `0` will have the filter
5987 # for column `C`, whereas the key `1` is for column `D`.
5988 "a_key": { # Criteria for showing/hiding rows in a pivot table.
5989 "visibleValues": [ # Values that should be included. Values not listed here are excluded.
5990 "A String",
5991 ],
5992 },
5993 },
5994 "columns": [ # Each column grouping in the pivot table.
5995 { # A single grouping (either row or column) in a pivot table.
5996 "showTotals": True or False, # True if the pivot table should include the totals for this grouping.
5997 "valueMetadata": [ # Metadata about values in the grouping.
5998 { # Metadata about a value in a pivot grouping.
5999 "collapsed": True or False, # True if the data corresponding to the value is collapsed.
6000 "value": { # The kinds of value that a cell in a spreadsheet can have. # The calculated value the metadata corresponds to.
6001 # (Note that formulaValue is not valid,
6002 # because the values will be calculated.)
6003 "numberValue": 3.14, # Represents a double value.
6004 # Note: Dates, Times and DateTimes are represented as doubles in
6005 # "serial number" format.
6006 "boolValue": True or False, # Represents a boolean value.
6007 "formulaValue": "A String", # Represents a formula.
6008 "stringValue": "A String", # Represents a string value.
6009 # Leading single quotes are not included. For example, if the user typed
6010 # `'123` into the UI, this would be represented as a `stringValue` of
6011 # `"123"`.
6012 "errorValue": { # An error in a cell. # Represents an error.
6013 # This field is read-only.
6014 "message": "A String", # A message with more information about the error
6015 # (in the spreadsheet's locale).
6016 "type": "A String", # The type of error.
6017 },
6018 },
6019 },
6020 ],
6021 "valueBucket": { # Information about which values in a pivot group should be used for sorting. # The bucket of the opposite pivot group to sort by.
6022 # If not specified, sorting is alphabetical by this group's values.
6023 "buckets": [ # Determines the bucket from which values are chosen to sort.
6024 #
6025 # For example, in a pivot table with one row group & two column groups,
6026 # the row group can list up to two values. The first value corresponds
6027 # to a value within the first column group, and the second value
6028 # corresponds to a value in the second column group. If no values
6029 # are listed, this would indicate that the row should be sorted according
6030 # to the "Grand Total" over the column groups. If a single value is listed,
6031 # this would correspond to using the "Total" of that bucket.
6032 { # The kinds of value that a cell in a spreadsheet can have.
6033 "numberValue": 3.14, # Represents a double value.
6034 # Note: Dates, Times and DateTimes are represented as doubles in
6035 # "serial number" format.
6036 "boolValue": True or False, # Represents a boolean value.
6037 "formulaValue": "A String", # Represents a formula.
6038 "stringValue": "A String", # Represents a string value.
6039 # Leading single quotes are not included. For example, if the user typed
6040 # `'123` into the UI, this would be represented as a `stringValue` of
6041 # `"123"`.
6042 "errorValue": { # An error in a cell. # Represents an error.
6043 # This field is read-only.
6044 "message": "A String", # A message with more information about the error
6045 # (in the spreadsheet's locale).
6046 "type": "A String", # The type of error.
6047 },
6048 },
6049 ],
6050 "valuesIndex": 42, # The offset in the [PivotTable.values] list which the values in this
6051 # grouping should be sorted by.
6052 },
6053 "sortOrder": "A String", # The order the values in this group should be sorted.
6054 "sourceColumnOffset": 42, # The column offset of the source range that this grouping is based on.
6055 #
6056 # For example, if the source was `C10:E15', a `sourceColumnOffset` of `0`
6057 # means this group refers to column `C`, whereas the offset `1` would refer
6058 # to column `D`.
6059 },
6060 ],
6061 },
6062 "hyperlink": "A String", # A hyperlink this cell points to, if any.
6063 # This field is read-only. (To set it, use a `=HYPERLINK` formula.)
6064 "effectiveValue": { # The kinds of value that a cell in a spreadsheet can have. # The effective value of the cell. For cells with formulas, this will be
6065 # the calculated value. For cells with literals, this will be
6066 # the same as the user_entered_value.
6067 # This field is read-only.
6068 "numberValue": 3.14, # Represents a double value.
6069 # Note: Dates, Times and DateTimes are represented as doubles in
6070 # "serial number" format.
6071 "boolValue": True or False, # Represents a boolean value.
6072 "formulaValue": "A String", # Represents a formula.
6073 "stringValue": "A String", # Represents a string value.
6074 # Leading single quotes are not included. For example, if the user typed
6075 # `'123` into the UI, this would be represented as a `stringValue` of
6076 # `"123"`.
6077 "errorValue": { # An error in a cell. # Represents an error.
6078 # This field is read-only.
6079 "message": "A String", # A message with more information about the error
6080 # (in the spreadsheet's locale).
6081 "type": "A String", # The type of error.
6082 },
6083 },
6084 "formattedValue": "A String", # The formatted value of the cell.
6085 # This is the value as it's shown to the user.
6086 # This field is read-only.
6087 "userEnteredValue": { # The kinds of value that a cell in a spreadsheet can have. # The value the user entered in the cell. e.g, `1234`, `'Hello'`, or `=NOW()`
6088 # Note: Dates, Times and DateTimes are represented as doubles in
6089 # serial number format.
6090 "numberValue": 3.14, # Represents a double value.
6091 # Note: Dates, Times and DateTimes are represented as doubles in
6092 # "serial number" format.
6093 "boolValue": True or False, # Represents a boolean value.
6094 "formulaValue": "A String", # Represents a formula.
6095 "stringValue": "A String", # Represents a string value.
6096 # Leading single quotes are not included. For example, if the user typed
6097 # `'123` into the UI, this would be represented as a `stringValue` of
6098 # `"123"`.
6099 "errorValue": { # An error in a cell. # Represents an error.
6100 # This field is read-only.
6101 "message": "A String", # A message with more information about the error
6102 # (in the spreadsheet's locale).
6103 "type": "A String", # The type of error.
6104 },
6105 },
6106 "note": "A String", # Any note on the cell.
6107 "effectiveFormat": { # The format of a cell. # The effective format being used by the cell.
6108 # This includes the results of applying any conditional formatting and,
6109 # if the cell contains a formula, the computed number format.
6110 # If the effective format is the default format, effective format will
6111 # not be written.
6112 # This field is read-only.
6113 "numberFormat": { # The number format of a cell. # A format describing how number values should be represented to the user.
6114 # When updating, all fields must be set.
6115 "pattern": "A String", # Pattern string used for formatting.
6116 "type": "A String", # The type of the number format.
6117 },
6118 "textDirection": "A String", # The direction of the text in the cell.
6119 "padding": { # The amount of padding around the cell, in pixels. # The padding of the cell.
6120 # When updating padding, every field must be specified.
6121 "top": 42, # The top padding of the cell.
6122 "right": 42, # The right padding of the cell.
6123 "bottom": 42, # The bottom padding of the cell.
6124 "left": 42, # The left padding of the cell.
6125 },
6126 "horizontalAlignment": "A String", # The horizontal alignment of the value in cell.
6127 "backgroundColor": { # Represents a color in the RGBA color space. This representation is designed # The background color of the cell.
6128 # for simplicity of conversion to/from color representations in various
6129 # languages over compactness; for example, the fields of this representation
6130 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
6131 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
6132 # method in iOS; and, with just a little work, it can be easily formatted into
6133 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
6134 #
6135 # Example (Java):
6136 #
6137 # import com.google.type.Color;
6138 #
6139 # // ...
6140 # public static java.awt.Color fromProto(Color protocolor) {
6141 # float alpha = protocolor.hasAlpha()
6142 # ? protocolor.getAlpha().getValue()
6143 # : 1.0;
6144 #
6145 # return new java.awt.Color(
6146 # protocolor.getRed(),
6147 # protocolor.getGreen(),
6148 # protocolor.getBlue(),
6149 # alpha);
6150 # }
6151 #
6152 # public static Color toProto(java.awt.Color color) {
6153 # float red = (float) color.getRed();
6154 # float green = (float) color.getGreen();
6155 # float blue = (float) color.getBlue();
6156 # float denominator = 255.0;
6157 # Color.Builder resultBuilder =
6158 # Color
6159 # .newBuilder()
6160 # .setRed(red / denominator)
6161 # .setGreen(green / denominator)
6162 # .setBlue(blue / denominator);
6163 # int alpha = color.getAlpha();
6164 # if (alpha != 255) {
6165 # result.setAlpha(
6166 # FloatValue
6167 # .newBuilder()
6168 # .setValue(((float) alpha) / denominator)
6169 # .build());
6170 # }
6171 # return resultBuilder.build();
6172 # }
6173 # // ...
6174 #
6175 # Example (iOS / Obj-C):
6176 #
6177 # // ...
6178 # static UIColor* fromProto(Color* protocolor) {
6179 # float red = [protocolor red];
6180 # float green = [protocolor green];
6181 # float blue = [protocolor blue];
6182 # FloatValue* alpha_wrapper = [protocolor alpha];
6183 # float alpha = 1.0;
6184 # if (alpha_wrapper != nil) {
6185 # alpha = [alpha_wrapper value];
6186 # }
6187 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
6188 # }
6189 #
6190 # static Color* toProto(UIColor* color) {
6191 # CGFloat red, green, blue, alpha;
6192 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
6193 # return nil;
6194 # }
6195 # Color* result = [Color alloc] init];
6196 # [result setRed:red];
6197 # [result setGreen:green];
6198 # [result setBlue:blue];
6199 # if (alpha <= 0.9999) {
6200 # [result setAlpha:floatWrapperWithValue(alpha)];
6201 # }
6202 # [result autorelease];
6203 # return result;
6204 # }
6205 # // ...
6206 #
6207 # Example (JavaScript):
6208 #
6209 # // ...
6210 #
6211 # var protoToCssColor = function(rgb_color) {
6212 # var redFrac = rgb_color.red || 0.0;
6213 # var greenFrac = rgb_color.green || 0.0;
6214 # var blueFrac = rgb_color.blue || 0.0;
6215 # var red = Math.floor(redFrac * 255);
6216 # var green = Math.floor(greenFrac * 255);
6217 # var blue = Math.floor(blueFrac * 255);
6218 #
6219 # if (!('alpha' in rgb_color)) {
6220 # return rgbToCssColor_(red, green, blue);
6221 # }
6222 #
6223 # var alphaFrac = rgb_color.alpha.value || 0.0;
6224 # var rgbParams = [red, green, blue].join(',');
6225 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
6226 # };
6227 #
6228 # var rgbToCssColor_ = function(red, green, blue) {
6229 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
6230 # var hexString = rgbNumber.toString(16);
6231 # var missingZeros = 6 - hexString.length;
6232 # var resultBuilder = ['#'];
6233 # for (var i = 0; i < missingZeros; i++) {
6234 # resultBuilder.push('0');
6235 # }
6236 # resultBuilder.push(hexString);
6237 # return resultBuilder.join('');
6238 # };
6239 #
6240 # // ...
6241 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
6242 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
6243 # the final pixel color is defined by the equation:
6244 #
6245 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
6246 #
6247 # This means that a value of 1.0 corresponds to a solid color, whereas
6248 # a value of 0.0 corresponds to a completely transparent color. This
6249 # uses a wrapper message rather than a simple float scalar so that it is
6250 # possible to distinguish between a default value and the value being unset.
6251 # If omitted, this color object is to be rendered as a solid color
6252 # (as if the alpha value had been explicitly given with a value of 1.0).
6253 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
6254 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
6255 },
6256 "verticalAlignment": "A String", # The vertical alignment of the value in cell.
6257 "textFormat": { # The format of a run of text in a cell. # The format of the text in the cell (unless overridden by a format run).
6258 # Absent values indicate that the field isn't specified.
6259 "foregroundColor": { # Represents a color in the RGBA color space. This representation is designed # The foreground color of the text.
6260 # for simplicity of conversion to/from color representations in various
6261 # languages over compactness; for example, the fields of this representation
6262 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
6263 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
6264 # method in iOS; and, with just a little work, it can be easily formatted into
6265 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
6266 #
6267 # Example (Java):
6268 #
6269 # import com.google.type.Color;
6270 #
6271 # // ...
6272 # public static java.awt.Color fromProto(Color protocolor) {
6273 # float alpha = protocolor.hasAlpha()
6274 # ? protocolor.getAlpha().getValue()
6275 # : 1.0;
6276 #
6277 # return new java.awt.Color(
6278 # protocolor.getRed(),
6279 # protocolor.getGreen(),
6280 # protocolor.getBlue(),
6281 # alpha);
6282 # }
6283 #
6284 # public static Color toProto(java.awt.Color color) {
6285 # float red = (float) color.getRed();
6286 # float green = (float) color.getGreen();
6287 # float blue = (float) color.getBlue();
6288 # float denominator = 255.0;
6289 # Color.Builder resultBuilder =
6290 # Color
6291 # .newBuilder()
6292 # .setRed(red / denominator)
6293 # .setGreen(green / denominator)
6294 # .setBlue(blue / denominator);
6295 # int alpha = color.getAlpha();
6296 # if (alpha != 255) {
6297 # result.setAlpha(
6298 # FloatValue
6299 # .newBuilder()
6300 # .setValue(((float) alpha) / denominator)
6301 # .build());
6302 # }
6303 # return resultBuilder.build();
6304 # }
6305 # // ...
6306 #
6307 # Example (iOS / Obj-C):
6308 #
6309 # // ...
6310 # static UIColor* fromProto(Color* protocolor) {
6311 # float red = [protocolor red];
6312 # float green = [protocolor green];
6313 # float blue = [protocolor blue];
6314 # FloatValue* alpha_wrapper = [protocolor alpha];
6315 # float alpha = 1.0;
6316 # if (alpha_wrapper != nil) {
6317 # alpha = [alpha_wrapper value];
6318 # }
6319 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
6320 # }
6321 #
6322 # static Color* toProto(UIColor* color) {
6323 # CGFloat red, green, blue, alpha;
6324 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
6325 # return nil;
6326 # }
6327 # Color* result = [Color alloc] init];
6328 # [result setRed:red];
6329 # [result setGreen:green];
6330 # [result setBlue:blue];
6331 # if (alpha <= 0.9999) {
6332 # [result setAlpha:floatWrapperWithValue(alpha)];
6333 # }
6334 # [result autorelease];
6335 # return result;
6336 # }
6337 # // ...
6338 #
6339 # Example (JavaScript):
6340 #
6341 # // ...
6342 #
6343 # var protoToCssColor = function(rgb_color) {
6344 # var redFrac = rgb_color.red || 0.0;
6345 # var greenFrac = rgb_color.green || 0.0;
6346 # var blueFrac = rgb_color.blue || 0.0;
6347 # var red = Math.floor(redFrac * 255);
6348 # var green = Math.floor(greenFrac * 255);
6349 # var blue = Math.floor(blueFrac * 255);
6350 #
6351 # if (!('alpha' in rgb_color)) {
6352 # return rgbToCssColor_(red, green, blue);
6353 # }
6354 #
6355 # var alphaFrac = rgb_color.alpha.value || 0.0;
6356 # var rgbParams = [red, green, blue].join(',');
6357 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
6358 # };
6359 #
6360 # var rgbToCssColor_ = function(red, green, blue) {
6361 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
6362 # var hexString = rgbNumber.toString(16);
6363 # var missingZeros = 6 - hexString.length;
6364 # var resultBuilder = ['#'];
6365 # for (var i = 0; i < missingZeros; i++) {
6366 # resultBuilder.push('0');
6367 # }
6368 # resultBuilder.push(hexString);
6369 # return resultBuilder.join('');
6370 # };
6371 #
6372 # // ...
6373 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
6374 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
6375 # the final pixel color is defined by the equation:
6376 #
6377 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
6378 #
6379 # This means that a value of 1.0 corresponds to a solid color, whereas
6380 # a value of 0.0 corresponds to a completely transparent color. This
6381 # uses a wrapper message rather than a simple float scalar so that it is
6382 # possible to distinguish between a default value and the value being unset.
6383 # If omitted, this color object is to be rendered as a solid color
6384 # (as if the alpha value had been explicitly given with a value of 1.0).
6385 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
6386 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
6387 },
6388 "bold": True or False, # True if the text is bold.
6389 "strikethrough": True or False, # True if the text has a strikethrough.
6390 "fontFamily": "A String", # The font family.
6391 "fontSize": 42, # The size of the font.
6392 "italic": True or False, # True if the text is italicized.
6393 "underline": True or False, # True if the text is underlined.
6394 },
6395 "hyperlinkDisplayType": "A String", # How a hyperlink, if it exists, should be displayed in the cell.
6396 "borders": { # The borders of the cell. # The borders of the cell.
6397 "top": { # A border along a cell. # The top border of the cell.
6398 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
6399 # for simplicity of conversion to/from color representations in various
6400 # languages over compactness; for example, the fields of this representation
6401 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
6402 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
6403 # method in iOS; and, with just a little work, it can be easily formatted into
6404 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
6405 #
6406 # Example (Java):
6407 #
6408 # import com.google.type.Color;
6409 #
6410 # // ...
6411 # public static java.awt.Color fromProto(Color protocolor) {
6412 # float alpha = protocolor.hasAlpha()
6413 # ? protocolor.getAlpha().getValue()
6414 # : 1.0;
6415 #
6416 # return new java.awt.Color(
6417 # protocolor.getRed(),
6418 # protocolor.getGreen(),
6419 # protocolor.getBlue(),
6420 # alpha);
6421 # }
6422 #
6423 # public static Color toProto(java.awt.Color color) {
6424 # float red = (float) color.getRed();
6425 # float green = (float) color.getGreen();
6426 # float blue = (float) color.getBlue();
6427 # float denominator = 255.0;
6428 # Color.Builder resultBuilder =
6429 # Color
6430 # .newBuilder()
6431 # .setRed(red / denominator)
6432 # .setGreen(green / denominator)
6433 # .setBlue(blue / denominator);
6434 # int alpha = color.getAlpha();
6435 # if (alpha != 255) {
6436 # result.setAlpha(
6437 # FloatValue
6438 # .newBuilder()
6439 # .setValue(((float) alpha) / denominator)
6440 # .build());
6441 # }
6442 # return resultBuilder.build();
6443 # }
6444 # // ...
6445 #
6446 # Example (iOS / Obj-C):
6447 #
6448 # // ...
6449 # static UIColor* fromProto(Color* protocolor) {
6450 # float red = [protocolor red];
6451 # float green = [protocolor green];
6452 # float blue = [protocolor blue];
6453 # FloatValue* alpha_wrapper = [protocolor alpha];
6454 # float alpha = 1.0;
6455 # if (alpha_wrapper != nil) {
6456 # alpha = [alpha_wrapper value];
6457 # }
6458 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
6459 # }
6460 #
6461 # static Color* toProto(UIColor* color) {
6462 # CGFloat red, green, blue, alpha;
6463 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
6464 # return nil;
6465 # }
6466 # Color* result = [Color alloc] init];
6467 # [result setRed:red];
6468 # [result setGreen:green];
6469 # [result setBlue:blue];
6470 # if (alpha <= 0.9999) {
6471 # [result setAlpha:floatWrapperWithValue(alpha)];
6472 # }
6473 # [result autorelease];
6474 # return result;
6475 # }
6476 # // ...
6477 #
6478 # Example (JavaScript):
6479 #
6480 # // ...
6481 #
6482 # var protoToCssColor = function(rgb_color) {
6483 # var redFrac = rgb_color.red || 0.0;
6484 # var greenFrac = rgb_color.green || 0.0;
6485 # var blueFrac = rgb_color.blue || 0.0;
6486 # var red = Math.floor(redFrac * 255);
6487 # var green = Math.floor(greenFrac * 255);
6488 # var blue = Math.floor(blueFrac * 255);
6489 #
6490 # if (!('alpha' in rgb_color)) {
6491 # return rgbToCssColor_(red, green, blue);
6492 # }
6493 #
6494 # var alphaFrac = rgb_color.alpha.value || 0.0;
6495 # var rgbParams = [red, green, blue].join(',');
6496 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
6497 # };
6498 #
6499 # var rgbToCssColor_ = function(red, green, blue) {
6500 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
6501 # var hexString = rgbNumber.toString(16);
6502 # var missingZeros = 6 - hexString.length;
6503 # var resultBuilder = ['#'];
6504 # for (var i = 0; i < missingZeros; i++) {
6505 # resultBuilder.push('0');
6506 # }
6507 # resultBuilder.push(hexString);
6508 # return resultBuilder.join('');
6509 # };
6510 #
6511 # // ...
6512 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
6513 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
6514 # the final pixel color is defined by the equation:
6515 #
6516 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
6517 #
6518 # This means that a value of 1.0 corresponds to a solid color, whereas
6519 # a value of 0.0 corresponds to a completely transparent color. This
6520 # uses a wrapper message rather than a simple float scalar so that it is
6521 # possible to distinguish between a default value and the value being unset.
6522 # If omitted, this color object is to be rendered as a solid color
6523 # (as if the alpha value had been explicitly given with a value of 1.0).
6524 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
6525 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
6526 },
6527 "width": 42, # The width of the border, in pixels.
6528 # Border widths must be between 0 and 3 pixels.
6529 "style": "A String", # The style of the border.
6530 },
6531 "right": { # A border along a cell. # The right border of the cell.
6532 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
6533 # for simplicity of conversion to/from color representations in various
6534 # languages over compactness; for example, the fields of this representation
6535 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
6536 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
6537 # method in iOS; and, with just a little work, it can be easily formatted into
6538 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
6539 #
6540 # Example (Java):
6541 #
6542 # import com.google.type.Color;
6543 #
6544 # // ...
6545 # public static java.awt.Color fromProto(Color protocolor) {
6546 # float alpha = protocolor.hasAlpha()
6547 # ? protocolor.getAlpha().getValue()
6548 # : 1.0;
6549 #
6550 # return new java.awt.Color(
6551 # protocolor.getRed(),
6552 # protocolor.getGreen(),
6553 # protocolor.getBlue(),
6554 # alpha);
6555 # }
6556 #
6557 # public static Color toProto(java.awt.Color color) {
6558 # float red = (float) color.getRed();
6559 # float green = (float) color.getGreen();
6560 # float blue = (float) color.getBlue();
6561 # float denominator = 255.0;
6562 # Color.Builder resultBuilder =
6563 # Color
6564 # .newBuilder()
6565 # .setRed(red / denominator)
6566 # .setGreen(green / denominator)
6567 # .setBlue(blue / denominator);
6568 # int alpha = color.getAlpha();
6569 # if (alpha != 255) {
6570 # result.setAlpha(
6571 # FloatValue
6572 # .newBuilder()
6573 # .setValue(((float) alpha) / denominator)
6574 # .build());
6575 # }
6576 # return resultBuilder.build();
6577 # }
6578 # // ...
6579 #
6580 # Example (iOS / Obj-C):
6581 #
6582 # // ...
6583 # static UIColor* fromProto(Color* protocolor) {
6584 # float red = [protocolor red];
6585 # float green = [protocolor green];
6586 # float blue = [protocolor blue];
6587 # FloatValue* alpha_wrapper = [protocolor alpha];
6588 # float alpha = 1.0;
6589 # if (alpha_wrapper != nil) {
6590 # alpha = [alpha_wrapper value];
6591 # }
6592 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
6593 # }
6594 #
6595 # static Color* toProto(UIColor* color) {
6596 # CGFloat red, green, blue, alpha;
6597 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
6598 # return nil;
6599 # }
6600 # Color* result = [Color alloc] init];
6601 # [result setRed:red];
6602 # [result setGreen:green];
6603 # [result setBlue:blue];
6604 # if (alpha <= 0.9999) {
6605 # [result setAlpha:floatWrapperWithValue(alpha)];
6606 # }
6607 # [result autorelease];
6608 # return result;
6609 # }
6610 # // ...
6611 #
6612 # Example (JavaScript):
6613 #
6614 # // ...
6615 #
6616 # var protoToCssColor = function(rgb_color) {
6617 # var redFrac = rgb_color.red || 0.0;
6618 # var greenFrac = rgb_color.green || 0.0;
6619 # var blueFrac = rgb_color.blue || 0.0;
6620 # var red = Math.floor(redFrac * 255);
6621 # var green = Math.floor(greenFrac * 255);
6622 # var blue = Math.floor(blueFrac * 255);
6623 #
6624 # if (!('alpha' in rgb_color)) {
6625 # return rgbToCssColor_(red, green, blue);
6626 # }
6627 #
6628 # var alphaFrac = rgb_color.alpha.value || 0.0;
6629 # var rgbParams = [red, green, blue].join(',');
6630 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
6631 # };
6632 #
6633 # var rgbToCssColor_ = function(red, green, blue) {
6634 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
6635 # var hexString = rgbNumber.toString(16);
6636 # var missingZeros = 6 - hexString.length;
6637 # var resultBuilder = ['#'];
6638 # for (var i = 0; i < missingZeros; i++) {
6639 # resultBuilder.push('0');
6640 # }
6641 # resultBuilder.push(hexString);
6642 # return resultBuilder.join('');
6643 # };
6644 #
6645 # // ...
6646 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
6647 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
6648 # the final pixel color is defined by the equation:
6649 #
6650 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
6651 #
6652 # This means that a value of 1.0 corresponds to a solid color, whereas
6653 # a value of 0.0 corresponds to a completely transparent color. This
6654 # uses a wrapper message rather than a simple float scalar so that it is
6655 # possible to distinguish between a default value and the value being unset.
6656 # If omitted, this color object is to be rendered as a solid color
6657 # (as if the alpha value had been explicitly given with a value of 1.0).
6658 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
6659 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
6660 },
6661 "width": 42, # The width of the border, in pixels.
6662 # Border widths must be between 0 and 3 pixels.
6663 "style": "A String", # The style of the border.
6664 },
6665 "bottom": { # A border along a cell. # The bottom border of the cell.
6666 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
6667 # for simplicity of conversion to/from color representations in various
6668 # languages over compactness; for example, the fields of this representation
6669 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
6670 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
6671 # method in iOS; and, with just a little work, it can be easily formatted into
6672 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
6673 #
6674 # Example (Java):
6675 #
6676 # import com.google.type.Color;
6677 #
6678 # // ...
6679 # public static java.awt.Color fromProto(Color protocolor) {
6680 # float alpha = protocolor.hasAlpha()
6681 # ? protocolor.getAlpha().getValue()
6682 # : 1.0;
6683 #
6684 # return new java.awt.Color(
6685 # protocolor.getRed(),
6686 # protocolor.getGreen(),
6687 # protocolor.getBlue(),
6688 # alpha);
6689 # }
6690 #
6691 # public static Color toProto(java.awt.Color color) {
6692 # float red = (float) color.getRed();
6693 # float green = (float) color.getGreen();
6694 # float blue = (float) color.getBlue();
6695 # float denominator = 255.0;
6696 # Color.Builder resultBuilder =
6697 # Color
6698 # .newBuilder()
6699 # .setRed(red / denominator)
6700 # .setGreen(green / denominator)
6701 # .setBlue(blue / denominator);
6702 # int alpha = color.getAlpha();
6703 # if (alpha != 255) {
6704 # result.setAlpha(
6705 # FloatValue
6706 # .newBuilder()
6707 # .setValue(((float) alpha) / denominator)
6708 # .build());
6709 # }
6710 # return resultBuilder.build();
6711 # }
6712 # // ...
6713 #
6714 # Example (iOS / Obj-C):
6715 #
6716 # // ...
6717 # static UIColor* fromProto(Color* protocolor) {
6718 # float red = [protocolor red];
6719 # float green = [protocolor green];
6720 # float blue = [protocolor blue];
6721 # FloatValue* alpha_wrapper = [protocolor alpha];
6722 # float alpha = 1.0;
6723 # if (alpha_wrapper != nil) {
6724 # alpha = [alpha_wrapper value];
6725 # }
6726 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
6727 # }
6728 #
6729 # static Color* toProto(UIColor* color) {
6730 # CGFloat red, green, blue, alpha;
6731 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
6732 # return nil;
6733 # }
6734 # Color* result = [Color alloc] init];
6735 # [result setRed:red];
6736 # [result setGreen:green];
6737 # [result setBlue:blue];
6738 # if (alpha <= 0.9999) {
6739 # [result setAlpha:floatWrapperWithValue(alpha)];
6740 # }
6741 # [result autorelease];
6742 # return result;
6743 # }
6744 # // ...
6745 #
6746 # Example (JavaScript):
6747 #
6748 # // ...
6749 #
6750 # var protoToCssColor = function(rgb_color) {
6751 # var redFrac = rgb_color.red || 0.0;
6752 # var greenFrac = rgb_color.green || 0.0;
6753 # var blueFrac = rgb_color.blue || 0.0;
6754 # var red = Math.floor(redFrac * 255);
6755 # var green = Math.floor(greenFrac * 255);
6756 # var blue = Math.floor(blueFrac * 255);
6757 #
6758 # if (!('alpha' in rgb_color)) {
6759 # return rgbToCssColor_(red, green, blue);
6760 # }
6761 #
6762 # var alphaFrac = rgb_color.alpha.value || 0.0;
6763 # var rgbParams = [red, green, blue].join(',');
6764 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
6765 # };
6766 #
6767 # var rgbToCssColor_ = function(red, green, blue) {
6768 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
6769 # var hexString = rgbNumber.toString(16);
6770 # var missingZeros = 6 - hexString.length;
6771 # var resultBuilder = ['#'];
6772 # for (var i = 0; i < missingZeros; i++) {
6773 # resultBuilder.push('0');
6774 # }
6775 # resultBuilder.push(hexString);
6776 # return resultBuilder.join('');
6777 # };
6778 #
6779 # // ...
6780 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
6781 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
6782 # the final pixel color is defined by the equation:
6783 #
6784 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
6785 #
6786 # This means that a value of 1.0 corresponds to a solid color, whereas
6787 # a value of 0.0 corresponds to a completely transparent color. This
6788 # uses a wrapper message rather than a simple float scalar so that it is
6789 # possible to distinguish between a default value and the value being unset.
6790 # If omitted, this color object is to be rendered as a solid color
6791 # (as if the alpha value had been explicitly given with a value of 1.0).
6792 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
6793 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
6794 },
6795 "width": 42, # The width of the border, in pixels.
6796 # Border widths must be between 0 and 3 pixels.
6797 "style": "A String", # The style of the border.
6798 },
6799 "left": { # A border along a cell. # The left border of the cell.
6800 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
6801 # for simplicity of conversion to/from color representations in various
6802 # languages over compactness; for example, the fields of this representation
6803 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
6804 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
6805 # method in iOS; and, with just a little work, it can be easily formatted into
6806 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
6807 #
6808 # Example (Java):
6809 #
6810 # import com.google.type.Color;
6811 #
6812 # // ...
6813 # public static java.awt.Color fromProto(Color protocolor) {
6814 # float alpha = protocolor.hasAlpha()
6815 # ? protocolor.getAlpha().getValue()
6816 # : 1.0;
6817 #
6818 # return new java.awt.Color(
6819 # protocolor.getRed(),
6820 # protocolor.getGreen(),
6821 # protocolor.getBlue(),
6822 # alpha);
6823 # }
6824 #
6825 # public static Color toProto(java.awt.Color color) {
6826 # float red = (float) color.getRed();
6827 # float green = (float) color.getGreen();
6828 # float blue = (float) color.getBlue();
6829 # float denominator = 255.0;
6830 # Color.Builder resultBuilder =
6831 # Color
6832 # .newBuilder()
6833 # .setRed(red / denominator)
6834 # .setGreen(green / denominator)
6835 # .setBlue(blue / denominator);
6836 # int alpha = color.getAlpha();
6837 # if (alpha != 255) {
6838 # result.setAlpha(
6839 # FloatValue
6840 # .newBuilder()
6841 # .setValue(((float) alpha) / denominator)
6842 # .build());
6843 # }
6844 # return resultBuilder.build();
6845 # }
6846 # // ...
6847 #
6848 # Example (iOS / Obj-C):
6849 #
6850 # // ...
6851 # static UIColor* fromProto(Color* protocolor) {
6852 # float red = [protocolor red];
6853 # float green = [protocolor green];
6854 # float blue = [protocolor blue];
6855 # FloatValue* alpha_wrapper = [protocolor alpha];
6856 # float alpha = 1.0;
6857 # if (alpha_wrapper != nil) {
6858 # alpha = [alpha_wrapper value];
6859 # }
6860 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
6861 # }
6862 #
6863 # static Color* toProto(UIColor* color) {
6864 # CGFloat red, green, blue, alpha;
6865 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
6866 # return nil;
6867 # }
6868 # Color* result = [Color alloc] init];
6869 # [result setRed:red];
6870 # [result setGreen:green];
6871 # [result setBlue:blue];
6872 # if (alpha <= 0.9999) {
6873 # [result setAlpha:floatWrapperWithValue(alpha)];
6874 # }
6875 # [result autorelease];
6876 # return result;
6877 # }
6878 # // ...
6879 #
6880 # Example (JavaScript):
6881 #
6882 # // ...
6883 #
6884 # var protoToCssColor = function(rgb_color) {
6885 # var redFrac = rgb_color.red || 0.0;
6886 # var greenFrac = rgb_color.green || 0.0;
6887 # var blueFrac = rgb_color.blue || 0.0;
6888 # var red = Math.floor(redFrac * 255);
6889 # var green = Math.floor(greenFrac * 255);
6890 # var blue = Math.floor(blueFrac * 255);
6891 #
6892 # if (!('alpha' in rgb_color)) {
6893 # return rgbToCssColor_(red, green, blue);
6894 # }
6895 #
6896 # var alphaFrac = rgb_color.alpha.value || 0.0;
6897 # var rgbParams = [red, green, blue].join(',');
6898 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
6899 # };
6900 #
6901 # var rgbToCssColor_ = function(red, green, blue) {
6902 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
6903 # var hexString = rgbNumber.toString(16);
6904 # var missingZeros = 6 - hexString.length;
6905 # var resultBuilder = ['#'];
6906 # for (var i = 0; i < missingZeros; i++) {
6907 # resultBuilder.push('0');
6908 # }
6909 # resultBuilder.push(hexString);
6910 # return resultBuilder.join('');
6911 # };
6912 #
6913 # // ...
6914 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
6915 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
6916 # the final pixel color is defined by the equation:
6917 #
6918 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
6919 #
6920 # This means that a value of 1.0 corresponds to a solid color, whereas
6921 # a value of 0.0 corresponds to a completely transparent color. This
6922 # uses a wrapper message rather than a simple float scalar so that it is
6923 # possible to distinguish between a default value and the value being unset.
6924 # If omitted, this color object is to be rendered as a solid color
6925 # (as if the alpha value had been explicitly given with a value of 1.0).
6926 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
6927 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
6928 },
6929 "width": 42, # The width of the border, in pixels.
6930 # Border widths must be between 0 and 3 pixels.
6931 "style": "A String", # The style of the border.
6932 },
6933 },
6934 "wrapStrategy": "A String", # The wrap strategy for the value in the cell.
6935 },
6936 "userEnteredFormat": { # The format of a cell. # The format the user entered for the cell.
6937 #
6938 # When writing, the new format will be merged with the existing format.
6939 "numberFormat": { # The number format of a cell. # A format describing how number values should be represented to the user.
6940 # When updating, all fields must be set.
6941 "pattern": "A String", # Pattern string used for formatting.
6942 "type": "A String", # The type of the number format.
6943 },
6944 "textDirection": "A String", # The direction of the text in the cell.
6945 "padding": { # The amount of padding around the cell, in pixels. # The padding of the cell.
6946 # When updating padding, every field must be specified.
6947 "top": 42, # The top padding of the cell.
6948 "right": 42, # The right padding of the cell.
6949 "bottom": 42, # The bottom padding of the cell.
6950 "left": 42, # The left padding of the cell.
6951 },
6952 "horizontalAlignment": "A String", # The horizontal alignment of the value in cell.
6953 "backgroundColor": { # Represents a color in the RGBA color space. This representation is designed # The background color of the cell.
6954 # for simplicity of conversion to/from color representations in various
6955 # languages over compactness; for example, the fields of this representation
6956 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
6957 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
6958 # method in iOS; and, with just a little work, it can be easily formatted into
6959 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
6960 #
6961 # Example (Java):
6962 #
6963 # import com.google.type.Color;
6964 #
6965 # // ...
6966 # public static java.awt.Color fromProto(Color protocolor) {
6967 # float alpha = protocolor.hasAlpha()
6968 # ? protocolor.getAlpha().getValue()
6969 # : 1.0;
6970 #
6971 # return new java.awt.Color(
6972 # protocolor.getRed(),
6973 # protocolor.getGreen(),
6974 # protocolor.getBlue(),
6975 # alpha);
6976 # }
6977 #
6978 # public static Color toProto(java.awt.Color color) {
6979 # float red = (float) color.getRed();
6980 # float green = (float) color.getGreen();
6981 # float blue = (float) color.getBlue();
6982 # float denominator = 255.0;
6983 # Color.Builder resultBuilder =
6984 # Color
6985 # .newBuilder()
6986 # .setRed(red / denominator)
6987 # .setGreen(green / denominator)
6988 # .setBlue(blue / denominator);
6989 # int alpha = color.getAlpha();
6990 # if (alpha != 255) {
6991 # result.setAlpha(
6992 # FloatValue
6993 # .newBuilder()
6994 # .setValue(((float) alpha) / denominator)
6995 # .build());
6996 # }
6997 # return resultBuilder.build();
6998 # }
6999 # // ...
7000 #
7001 # Example (iOS / Obj-C):
7002 #
7003 # // ...
7004 # static UIColor* fromProto(Color* protocolor) {
7005 # float red = [protocolor red];
7006 # float green = [protocolor green];
7007 # float blue = [protocolor blue];
7008 # FloatValue* alpha_wrapper = [protocolor alpha];
7009 # float alpha = 1.0;
7010 # if (alpha_wrapper != nil) {
7011 # alpha = [alpha_wrapper value];
7012 # }
7013 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
7014 # }
7015 #
7016 # static Color* toProto(UIColor* color) {
7017 # CGFloat red, green, blue, alpha;
7018 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
7019 # return nil;
7020 # }
7021 # Color* result = [Color alloc] init];
7022 # [result setRed:red];
7023 # [result setGreen:green];
7024 # [result setBlue:blue];
7025 # if (alpha <= 0.9999) {
7026 # [result setAlpha:floatWrapperWithValue(alpha)];
7027 # }
7028 # [result autorelease];
7029 # return result;
7030 # }
7031 # // ...
7032 #
7033 # Example (JavaScript):
7034 #
7035 # // ...
7036 #
7037 # var protoToCssColor = function(rgb_color) {
7038 # var redFrac = rgb_color.red || 0.0;
7039 # var greenFrac = rgb_color.green || 0.0;
7040 # var blueFrac = rgb_color.blue || 0.0;
7041 # var red = Math.floor(redFrac * 255);
7042 # var green = Math.floor(greenFrac * 255);
7043 # var blue = Math.floor(blueFrac * 255);
7044 #
7045 # if (!('alpha' in rgb_color)) {
7046 # return rgbToCssColor_(red, green, blue);
7047 # }
7048 #
7049 # var alphaFrac = rgb_color.alpha.value || 0.0;
7050 # var rgbParams = [red, green, blue].join(',');
7051 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
7052 # };
7053 #
7054 # var rgbToCssColor_ = function(red, green, blue) {
7055 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
7056 # var hexString = rgbNumber.toString(16);
7057 # var missingZeros = 6 - hexString.length;
7058 # var resultBuilder = ['#'];
7059 # for (var i = 0; i < missingZeros; i++) {
7060 # resultBuilder.push('0');
7061 # }
7062 # resultBuilder.push(hexString);
7063 # return resultBuilder.join('');
7064 # };
7065 #
7066 # // ...
7067 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
7068 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
7069 # the final pixel color is defined by the equation:
7070 #
7071 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
7072 #
7073 # This means that a value of 1.0 corresponds to a solid color, whereas
7074 # a value of 0.0 corresponds to a completely transparent color. This
7075 # uses a wrapper message rather than a simple float scalar so that it is
7076 # possible to distinguish between a default value and the value being unset.
7077 # If omitted, this color object is to be rendered as a solid color
7078 # (as if the alpha value had been explicitly given with a value of 1.0).
7079 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
7080 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
7081 },
7082 "verticalAlignment": "A String", # The vertical alignment of the value in cell.
7083 "textFormat": { # The format of a run of text in a cell. # The format of the text in the cell (unless overridden by a format run).
7084 # Absent values indicate that the field isn't specified.
7085 "foregroundColor": { # Represents a color in the RGBA color space. This representation is designed # The foreground color of the text.
7086 # for simplicity of conversion to/from color representations in various
7087 # languages over compactness; for example, the fields of this representation
7088 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
7089 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
7090 # method in iOS; and, with just a little work, it can be easily formatted into
7091 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
7092 #
7093 # Example (Java):
7094 #
7095 # import com.google.type.Color;
7096 #
7097 # // ...
7098 # public static java.awt.Color fromProto(Color protocolor) {
7099 # float alpha = protocolor.hasAlpha()
7100 # ? protocolor.getAlpha().getValue()
7101 # : 1.0;
7102 #
7103 # return new java.awt.Color(
7104 # protocolor.getRed(),
7105 # protocolor.getGreen(),
7106 # protocolor.getBlue(),
7107 # alpha);
7108 # }
7109 #
7110 # public static Color toProto(java.awt.Color color) {
7111 # float red = (float) color.getRed();
7112 # float green = (float) color.getGreen();
7113 # float blue = (float) color.getBlue();
7114 # float denominator = 255.0;
7115 # Color.Builder resultBuilder =
7116 # Color
7117 # .newBuilder()
7118 # .setRed(red / denominator)
7119 # .setGreen(green / denominator)
7120 # .setBlue(blue / denominator);
7121 # int alpha = color.getAlpha();
7122 # if (alpha != 255) {
7123 # result.setAlpha(
7124 # FloatValue
7125 # .newBuilder()
7126 # .setValue(((float) alpha) / denominator)
7127 # .build());
7128 # }
7129 # return resultBuilder.build();
7130 # }
7131 # // ...
7132 #
7133 # Example (iOS / Obj-C):
7134 #
7135 # // ...
7136 # static UIColor* fromProto(Color* protocolor) {
7137 # float red = [protocolor red];
7138 # float green = [protocolor green];
7139 # float blue = [protocolor blue];
7140 # FloatValue* alpha_wrapper = [protocolor alpha];
7141 # float alpha = 1.0;
7142 # if (alpha_wrapper != nil) {
7143 # alpha = [alpha_wrapper value];
7144 # }
7145 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
7146 # }
7147 #
7148 # static Color* toProto(UIColor* color) {
7149 # CGFloat red, green, blue, alpha;
7150 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
7151 # return nil;
7152 # }
7153 # Color* result = [Color alloc] init];
7154 # [result setRed:red];
7155 # [result setGreen:green];
7156 # [result setBlue:blue];
7157 # if (alpha <= 0.9999) {
7158 # [result setAlpha:floatWrapperWithValue(alpha)];
7159 # }
7160 # [result autorelease];
7161 # return result;
7162 # }
7163 # // ...
7164 #
7165 # Example (JavaScript):
7166 #
7167 # // ...
7168 #
7169 # var protoToCssColor = function(rgb_color) {
7170 # var redFrac = rgb_color.red || 0.0;
7171 # var greenFrac = rgb_color.green || 0.0;
7172 # var blueFrac = rgb_color.blue || 0.0;
7173 # var red = Math.floor(redFrac * 255);
7174 # var green = Math.floor(greenFrac * 255);
7175 # var blue = Math.floor(blueFrac * 255);
7176 #
7177 # if (!('alpha' in rgb_color)) {
7178 # return rgbToCssColor_(red, green, blue);
7179 # }
7180 #
7181 # var alphaFrac = rgb_color.alpha.value || 0.0;
7182 # var rgbParams = [red, green, blue].join(',');
7183 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
7184 # };
7185 #
7186 # var rgbToCssColor_ = function(red, green, blue) {
7187 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
7188 # var hexString = rgbNumber.toString(16);
7189 # var missingZeros = 6 - hexString.length;
7190 # var resultBuilder = ['#'];
7191 # for (var i = 0; i < missingZeros; i++) {
7192 # resultBuilder.push('0');
7193 # }
7194 # resultBuilder.push(hexString);
7195 # return resultBuilder.join('');
7196 # };
7197 #
7198 # // ...
7199 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
7200 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
7201 # the final pixel color is defined by the equation:
7202 #
7203 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
7204 #
7205 # This means that a value of 1.0 corresponds to a solid color, whereas
7206 # a value of 0.0 corresponds to a completely transparent color. This
7207 # uses a wrapper message rather than a simple float scalar so that it is
7208 # possible to distinguish between a default value and the value being unset.
7209 # If omitted, this color object is to be rendered as a solid color
7210 # (as if the alpha value had been explicitly given with a value of 1.0).
7211 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
7212 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
7213 },
7214 "bold": True or False, # True if the text is bold.
7215 "strikethrough": True or False, # True if the text has a strikethrough.
7216 "fontFamily": "A String", # The font family.
7217 "fontSize": 42, # The size of the font.
7218 "italic": True or False, # True if the text is italicized.
7219 "underline": True or False, # True if the text is underlined.
7220 },
7221 "hyperlinkDisplayType": "A String", # How a hyperlink, if it exists, should be displayed in the cell.
7222 "borders": { # The borders of the cell. # The borders of the cell.
7223 "top": { # A border along a cell. # The top border of the cell.
7224 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
7225 # for simplicity of conversion to/from color representations in various
7226 # languages over compactness; for example, the fields of this representation
7227 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
7228 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
7229 # method in iOS; and, with just a little work, it can be easily formatted into
7230 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
7231 #
7232 # Example (Java):
7233 #
7234 # import com.google.type.Color;
7235 #
7236 # // ...
7237 # public static java.awt.Color fromProto(Color protocolor) {
7238 # float alpha = protocolor.hasAlpha()
7239 # ? protocolor.getAlpha().getValue()
7240 # : 1.0;
7241 #
7242 # return new java.awt.Color(
7243 # protocolor.getRed(),
7244 # protocolor.getGreen(),
7245 # protocolor.getBlue(),
7246 # alpha);
7247 # }
7248 #
7249 # public static Color toProto(java.awt.Color color) {
7250 # float red = (float) color.getRed();
7251 # float green = (float) color.getGreen();
7252 # float blue = (float) color.getBlue();
7253 # float denominator = 255.0;
7254 # Color.Builder resultBuilder =
7255 # Color
7256 # .newBuilder()
7257 # .setRed(red / denominator)
7258 # .setGreen(green / denominator)
7259 # .setBlue(blue / denominator);
7260 # int alpha = color.getAlpha();
7261 # if (alpha != 255) {
7262 # result.setAlpha(
7263 # FloatValue
7264 # .newBuilder()
7265 # .setValue(((float) alpha) / denominator)
7266 # .build());
7267 # }
7268 # return resultBuilder.build();
7269 # }
7270 # // ...
7271 #
7272 # Example (iOS / Obj-C):
7273 #
7274 # // ...
7275 # static UIColor* fromProto(Color* protocolor) {
7276 # float red = [protocolor red];
7277 # float green = [protocolor green];
7278 # float blue = [protocolor blue];
7279 # FloatValue* alpha_wrapper = [protocolor alpha];
7280 # float alpha = 1.0;
7281 # if (alpha_wrapper != nil) {
7282 # alpha = [alpha_wrapper value];
7283 # }
7284 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
7285 # }
7286 #
7287 # static Color* toProto(UIColor* color) {
7288 # CGFloat red, green, blue, alpha;
7289 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
7290 # return nil;
7291 # }
7292 # Color* result = [Color alloc] init];
7293 # [result setRed:red];
7294 # [result setGreen:green];
7295 # [result setBlue:blue];
7296 # if (alpha <= 0.9999) {
7297 # [result setAlpha:floatWrapperWithValue(alpha)];
7298 # }
7299 # [result autorelease];
7300 # return result;
7301 # }
7302 # // ...
7303 #
7304 # Example (JavaScript):
7305 #
7306 # // ...
7307 #
7308 # var protoToCssColor = function(rgb_color) {
7309 # var redFrac = rgb_color.red || 0.0;
7310 # var greenFrac = rgb_color.green || 0.0;
7311 # var blueFrac = rgb_color.blue || 0.0;
7312 # var red = Math.floor(redFrac * 255);
7313 # var green = Math.floor(greenFrac * 255);
7314 # var blue = Math.floor(blueFrac * 255);
7315 #
7316 # if (!('alpha' in rgb_color)) {
7317 # return rgbToCssColor_(red, green, blue);
7318 # }
7319 #
7320 # var alphaFrac = rgb_color.alpha.value || 0.0;
7321 # var rgbParams = [red, green, blue].join(',');
7322 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
7323 # };
7324 #
7325 # var rgbToCssColor_ = function(red, green, blue) {
7326 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
7327 # var hexString = rgbNumber.toString(16);
7328 # var missingZeros = 6 - hexString.length;
7329 # var resultBuilder = ['#'];
7330 # for (var i = 0; i < missingZeros; i++) {
7331 # resultBuilder.push('0');
7332 # }
7333 # resultBuilder.push(hexString);
7334 # return resultBuilder.join('');
7335 # };
7336 #
7337 # // ...
7338 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
7339 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
7340 # the final pixel color is defined by the equation:
7341 #
7342 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
7343 #
7344 # This means that a value of 1.0 corresponds to a solid color, whereas
7345 # a value of 0.0 corresponds to a completely transparent color. This
7346 # uses a wrapper message rather than a simple float scalar so that it is
7347 # possible to distinguish between a default value and the value being unset.
7348 # If omitted, this color object is to be rendered as a solid color
7349 # (as if the alpha value had been explicitly given with a value of 1.0).
7350 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
7351 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
7352 },
7353 "width": 42, # The width of the border, in pixels.
7354 # Border widths must be between 0 and 3 pixels.
7355 "style": "A String", # The style of the border.
7356 },
7357 "right": { # A border along a cell. # The right border of the cell.
7358 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
7359 # for simplicity of conversion to/from color representations in various
7360 # languages over compactness; for example, the fields of this representation
7361 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
7362 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
7363 # method in iOS; and, with just a little work, it can be easily formatted into
7364 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
7365 #
7366 # Example (Java):
7367 #
7368 # import com.google.type.Color;
7369 #
7370 # // ...
7371 # public static java.awt.Color fromProto(Color protocolor) {
7372 # float alpha = protocolor.hasAlpha()
7373 # ? protocolor.getAlpha().getValue()
7374 # : 1.0;
7375 #
7376 # return new java.awt.Color(
7377 # protocolor.getRed(),
7378 # protocolor.getGreen(),
7379 # protocolor.getBlue(),
7380 # alpha);
7381 # }
7382 #
7383 # public static Color toProto(java.awt.Color color) {
7384 # float red = (float) color.getRed();
7385 # float green = (float) color.getGreen();
7386 # float blue = (float) color.getBlue();
7387 # float denominator = 255.0;
7388 # Color.Builder resultBuilder =
7389 # Color
7390 # .newBuilder()
7391 # .setRed(red / denominator)
7392 # .setGreen(green / denominator)
7393 # .setBlue(blue / denominator);
7394 # int alpha = color.getAlpha();
7395 # if (alpha != 255) {
7396 # result.setAlpha(
7397 # FloatValue
7398 # .newBuilder()
7399 # .setValue(((float) alpha) / denominator)
7400 # .build());
7401 # }
7402 # return resultBuilder.build();
7403 # }
7404 # // ...
7405 #
7406 # Example (iOS / Obj-C):
7407 #
7408 # // ...
7409 # static UIColor* fromProto(Color* protocolor) {
7410 # float red = [protocolor red];
7411 # float green = [protocolor green];
7412 # float blue = [protocolor blue];
7413 # FloatValue* alpha_wrapper = [protocolor alpha];
7414 # float alpha = 1.0;
7415 # if (alpha_wrapper != nil) {
7416 # alpha = [alpha_wrapper value];
7417 # }
7418 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
7419 # }
7420 #
7421 # static Color* toProto(UIColor* color) {
7422 # CGFloat red, green, blue, alpha;
7423 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
7424 # return nil;
7425 # }
7426 # Color* result = [Color alloc] init];
7427 # [result setRed:red];
7428 # [result setGreen:green];
7429 # [result setBlue:blue];
7430 # if (alpha <= 0.9999) {
7431 # [result setAlpha:floatWrapperWithValue(alpha)];
7432 # }
7433 # [result autorelease];
7434 # return result;
7435 # }
7436 # // ...
7437 #
7438 # Example (JavaScript):
7439 #
7440 # // ...
7441 #
7442 # var protoToCssColor = function(rgb_color) {
7443 # var redFrac = rgb_color.red || 0.0;
7444 # var greenFrac = rgb_color.green || 0.0;
7445 # var blueFrac = rgb_color.blue || 0.0;
7446 # var red = Math.floor(redFrac * 255);
7447 # var green = Math.floor(greenFrac * 255);
7448 # var blue = Math.floor(blueFrac * 255);
7449 #
7450 # if (!('alpha' in rgb_color)) {
7451 # return rgbToCssColor_(red, green, blue);
7452 # }
7453 #
7454 # var alphaFrac = rgb_color.alpha.value || 0.0;
7455 # var rgbParams = [red, green, blue].join(',');
7456 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
7457 # };
7458 #
7459 # var rgbToCssColor_ = function(red, green, blue) {
7460 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
7461 # var hexString = rgbNumber.toString(16);
7462 # var missingZeros = 6 - hexString.length;
7463 # var resultBuilder = ['#'];
7464 # for (var i = 0; i < missingZeros; i++) {
7465 # resultBuilder.push('0');
7466 # }
7467 # resultBuilder.push(hexString);
7468 # return resultBuilder.join('');
7469 # };
7470 #
7471 # // ...
7472 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
7473 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
7474 # the final pixel color is defined by the equation:
7475 #
7476 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
7477 #
7478 # This means that a value of 1.0 corresponds to a solid color, whereas
7479 # a value of 0.0 corresponds to a completely transparent color. This
7480 # uses a wrapper message rather than a simple float scalar so that it is
7481 # possible to distinguish between a default value and the value being unset.
7482 # If omitted, this color object is to be rendered as a solid color
7483 # (as if the alpha value had been explicitly given with a value of 1.0).
7484 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
7485 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
7486 },
7487 "width": 42, # The width of the border, in pixels.
7488 # Border widths must be between 0 and 3 pixels.
7489 "style": "A String", # The style of the border.
7490 },
7491 "bottom": { # A border along a cell. # The bottom border of the cell.
7492 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
7493 # for simplicity of conversion to/from color representations in various
7494 # languages over compactness; for example, the fields of this representation
7495 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
7496 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
7497 # method in iOS; and, with just a little work, it can be easily formatted into
7498 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
7499 #
7500 # Example (Java):
7501 #
7502 # import com.google.type.Color;
7503 #
7504 # // ...
7505 # public static java.awt.Color fromProto(Color protocolor) {
7506 # float alpha = protocolor.hasAlpha()
7507 # ? protocolor.getAlpha().getValue()
7508 # : 1.0;
7509 #
7510 # return new java.awt.Color(
7511 # protocolor.getRed(),
7512 # protocolor.getGreen(),
7513 # protocolor.getBlue(),
7514 # alpha);
7515 # }
7516 #
7517 # public static Color toProto(java.awt.Color color) {
7518 # float red = (float) color.getRed();
7519 # float green = (float) color.getGreen();
7520 # float blue = (float) color.getBlue();
7521 # float denominator = 255.0;
7522 # Color.Builder resultBuilder =
7523 # Color
7524 # .newBuilder()
7525 # .setRed(red / denominator)
7526 # .setGreen(green / denominator)
7527 # .setBlue(blue / denominator);
7528 # int alpha = color.getAlpha();
7529 # if (alpha != 255) {
7530 # result.setAlpha(
7531 # FloatValue
7532 # .newBuilder()
7533 # .setValue(((float) alpha) / denominator)
7534 # .build());
7535 # }
7536 # return resultBuilder.build();
7537 # }
7538 # // ...
7539 #
7540 # Example (iOS / Obj-C):
7541 #
7542 # // ...
7543 # static UIColor* fromProto(Color* protocolor) {
7544 # float red = [protocolor red];
7545 # float green = [protocolor green];
7546 # float blue = [protocolor blue];
7547 # FloatValue* alpha_wrapper = [protocolor alpha];
7548 # float alpha = 1.0;
7549 # if (alpha_wrapper != nil) {
7550 # alpha = [alpha_wrapper value];
7551 # }
7552 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
7553 # }
7554 #
7555 # static Color* toProto(UIColor* color) {
7556 # CGFloat red, green, blue, alpha;
7557 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
7558 # return nil;
7559 # }
7560 # Color* result = [Color alloc] init];
7561 # [result setRed:red];
7562 # [result setGreen:green];
7563 # [result setBlue:blue];
7564 # if (alpha <= 0.9999) {
7565 # [result setAlpha:floatWrapperWithValue(alpha)];
7566 # }
7567 # [result autorelease];
7568 # return result;
7569 # }
7570 # // ...
7571 #
7572 # Example (JavaScript):
7573 #
7574 # // ...
7575 #
7576 # var protoToCssColor = function(rgb_color) {
7577 # var redFrac = rgb_color.red || 0.0;
7578 # var greenFrac = rgb_color.green || 0.0;
7579 # var blueFrac = rgb_color.blue || 0.0;
7580 # var red = Math.floor(redFrac * 255);
7581 # var green = Math.floor(greenFrac * 255);
7582 # var blue = Math.floor(blueFrac * 255);
7583 #
7584 # if (!('alpha' in rgb_color)) {
7585 # return rgbToCssColor_(red, green, blue);
7586 # }
7587 #
7588 # var alphaFrac = rgb_color.alpha.value || 0.0;
7589 # var rgbParams = [red, green, blue].join(',');
7590 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
7591 # };
7592 #
7593 # var rgbToCssColor_ = function(red, green, blue) {
7594 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
7595 # var hexString = rgbNumber.toString(16);
7596 # var missingZeros = 6 - hexString.length;
7597 # var resultBuilder = ['#'];
7598 # for (var i = 0; i < missingZeros; i++) {
7599 # resultBuilder.push('0');
7600 # }
7601 # resultBuilder.push(hexString);
7602 # return resultBuilder.join('');
7603 # };
7604 #
7605 # // ...
7606 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
7607 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
7608 # the final pixel color is defined by the equation:
7609 #
7610 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
7611 #
7612 # This means that a value of 1.0 corresponds to a solid color, whereas
7613 # a value of 0.0 corresponds to a completely transparent color. This
7614 # uses a wrapper message rather than a simple float scalar so that it is
7615 # possible to distinguish between a default value and the value being unset.
7616 # If omitted, this color object is to be rendered as a solid color
7617 # (as if the alpha value had been explicitly given with a value of 1.0).
7618 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
7619 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
7620 },
7621 "width": 42, # The width of the border, in pixels.
7622 # Border widths must be between 0 and 3 pixels.
7623 "style": "A String", # The style of the border.
7624 },
7625 "left": { # A border along a cell. # The left border of the cell.
7626 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
7627 # for simplicity of conversion to/from color representations in various
7628 # languages over compactness; for example, the fields of this representation
7629 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
7630 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
7631 # method in iOS; and, with just a little work, it can be easily formatted into
7632 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
7633 #
7634 # Example (Java):
7635 #
7636 # import com.google.type.Color;
7637 #
7638 # // ...
7639 # public static java.awt.Color fromProto(Color protocolor) {
7640 # float alpha = protocolor.hasAlpha()
7641 # ? protocolor.getAlpha().getValue()
7642 # : 1.0;
7643 #
7644 # return new java.awt.Color(
7645 # protocolor.getRed(),
7646 # protocolor.getGreen(),
7647 # protocolor.getBlue(),
7648 # alpha);
7649 # }
7650 #
7651 # public static Color toProto(java.awt.Color color) {
7652 # float red = (float) color.getRed();
7653 # float green = (float) color.getGreen();
7654 # float blue = (float) color.getBlue();
7655 # float denominator = 255.0;
7656 # Color.Builder resultBuilder =
7657 # Color
7658 # .newBuilder()
7659 # .setRed(red / denominator)
7660 # .setGreen(green / denominator)
7661 # .setBlue(blue / denominator);
7662 # int alpha = color.getAlpha();
7663 # if (alpha != 255) {
7664 # result.setAlpha(
7665 # FloatValue
7666 # .newBuilder()
7667 # .setValue(((float) alpha) / denominator)
7668 # .build());
7669 # }
7670 # return resultBuilder.build();
7671 # }
7672 # // ...
7673 #
7674 # Example (iOS / Obj-C):
7675 #
7676 # // ...
7677 # static UIColor* fromProto(Color* protocolor) {
7678 # float red = [protocolor red];
7679 # float green = [protocolor green];
7680 # float blue = [protocolor blue];
7681 # FloatValue* alpha_wrapper = [protocolor alpha];
7682 # float alpha = 1.0;
7683 # if (alpha_wrapper != nil) {
7684 # alpha = [alpha_wrapper value];
7685 # }
7686 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
7687 # }
7688 #
7689 # static Color* toProto(UIColor* color) {
7690 # CGFloat red, green, blue, alpha;
7691 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
7692 # return nil;
7693 # }
7694 # Color* result = [Color alloc] init];
7695 # [result setRed:red];
7696 # [result setGreen:green];
7697 # [result setBlue:blue];
7698 # if (alpha <= 0.9999) {
7699 # [result setAlpha:floatWrapperWithValue(alpha)];
7700 # }
7701 # [result autorelease];
7702 # return result;
7703 # }
7704 # // ...
7705 #
7706 # Example (JavaScript):
7707 #
7708 # // ...
7709 #
7710 # var protoToCssColor = function(rgb_color) {
7711 # var redFrac = rgb_color.red || 0.0;
7712 # var greenFrac = rgb_color.green || 0.0;
7713 # var blueFrac = rgb_color.blue || 0.0;
7714 # var red = Math.floor(redFrac * 255);
7715 # var green = Math.floor(greenFrac * 255);
7716 # var blue = Math.floor(blueFrac * 255);
7717 #
7718 # if (!('alpha' in rgb_color)) {
7719 # return rgbToCssColor_(red, green, blue);
7720 # }
7721 #
7722 # var alphaFrac = rgb_color.alpha.value || 0.0;
7723 # var rgbParams = [red, green, blue].join(',');
7724 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
7725 # };
7726 #
7727 # var rgbToCssColor_ = function(red, green, blue) {
7728 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
7729 # var hexString = rgbNumber.toString(16);
7730 # var missingZeros = 6 - hexString.length;
7731 # var resultBuilder = ['#'];
7732 # for (var i = 0; i < missingZeros; i++) {
7733 # resultBuilder.push('0');
7734 # }
7735 # resultBuilder.push(hexString);
7736 # return resultBuilder.join('');
7737 # };
7738 #
7739 # // ...
7740 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
7741 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
7742 # the final pixel color is defined by the equation:
7743 #
7744 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
7745 #
7746 # This means that a value of 1.0 corresponds to a solid color, whereas
7747 # a value of 0.0 corresponds to a completely transparent color. This
7748 # uses a wrapper message rather than a simple float scalar so that it is
7749 # possible to distinguish between a default value and the value being unset.
7750 # If omitted, this color object is to be rendered as a solid color
7751 # (as if the alpha value had been explicitly given with a value of 1.0).
7752 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
7753 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
7754 },
7755 "width": 42, # The width of the border, in pixels.
7756 # Border widths must be between 0 and 3 pixels.
7757 "style": "A String", # The style of the border.
7758 },
7759 },
7760 "wrapStrategy": "A String", # The wrap strategy for the value in the cell.
7761 },
7762 "dataValidation": { # A data validation rule. # A data validation rule on the cell, if any.
7763 #
7764 # When writing, the new data validation rule will overwrite any prior rule.
7765 "showCustomUi": True or False, # True if the UI should be customized based on the kind of condition.
7766 # If true, "List" conditions will show a dropdown.
7767 "strict": True or False, # True if invalid data should be rejected.
7768 "inputMessage": "A String", # A message to show the user when adding data to the cell.
7769 "condition": { # A condition that can evaluate to true or false. # The condition that data in the cell must match.
7770 # BooleanConditions are used by conditional formatting,
7771 # data validation, and the criteria in filters.
7772 "type": "A String", # The type of condition.
7773 "values": [ # The values of the condition. The number of supported values depends
7774 # on the condition type. Some support zero values,
7775 # others one or two values,
7776 # and ConditionType.ONE_OF_LIST supports an arbitrary number of values.
7777 { # The value of the condition.
7778 "relativeDate": "A String", # A relative date (based on the current date).
7779 # Valid only if the type is
7780 # DATE_BEFORE,
7781 # DATE_AFTER,
7782 # DATE_ON_OR_BEFORE or
7783 # DATE_ON_OR_AFTER.
7784 #
7785 # Relative dates are not supported in data validation.
7786 # They are supported only in conditional formatting and
7787 # conditional filters.
7788 "userEnteredValue": "A String", # A value the condition is based on.
7789 # The value will be parsed as if the user typed into a cell.
7790 # Formulas are supported (and must begin with an `=`).
7791 },
7792 ],
7793 },
7794 },
7795 "textFormatRuns": [ # Runs of rich text applied to subsections of the cell.
7796 # Runs start at specific indexes in the text and continue until the next
7797 # run. Properties of a run will continue unless explicitly changed
7798 # in a subsequent run (and properties of the first run will continue
7799 # the properties of the cell unless explicitly changed).
7800 #
7801 # When writing, the new runs will overwrite any prior runs.
7802 { # A run of a text format. The format of this run continues until explicitly
7803 # overridden in the next run.
7804 # When updating, all fields must be set.
7805 "startIndex": 42, # The character index where this run starts.
7806 "format": { # The format of a run of text in a cell. # The format of this run. Absent values inherit the cell's format.
7807 # Absent values indicate that the field isn't specified.
7808 "foregroundColor": { # Represents a color in the RGBA color space. This representation is designed # The foreground color of the text.
7809 # for simplicity of conversion to/from color representations in various
7810 # languages over compactness; for example, the fields of this representation
7811 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
7812 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
7813 # method in iOS; and, with just a little work, it can be easily formatted into
7814 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
7815 #
7816 # Example (Java):
7817 #
7818 # import com.google.type.Color;
7819 #
7820 # // ...
7821 # public static java.awt.Color fromProto(Color protocolor) {
7822 # float alpha = protocolor.hasAlpha()
7823 # ? protocolor.getAlpha().getValue()
7824 # : 1.0;
7825 #
7826 # return new java.awt.Color(
7827 # protocolor.getRed(),
7828 # protocolor.getGreen(),
7829 # protocolor.getBlue(),
7830 # alpha);
7831 # }
7832 #
7833 # public static Color toProto(java.awt.Color color) {
7834 # float red = (float) color.getRed();
7835 # float green = (float) color.getGreen();
7836 # float blue = (float) color.getBlue();
7837 # float denominator = 255.0;
7838 # Color.Builder resultBuilder =
7839 # Color
7840 # .newBuilder()
7841 # .setRed(red / denominator)
7842 # .setGreen(green / denominator)
7843 # .setBlue(blue / denominator);
7844 # int alpha = color.getAlpha();
7845 # if (alpha != 255) {
7846 # result.setAlpha(
7847 # FloatValue
7848 # .newBuilder()
7849 # .setValue(((float) alpha) / denominator)
7850 # .build());
7851 # }
7852 # return resultBuilder.build();
7853 # }
7854 # // ...
7855 #
7856 # Example (iOS / Obj-C):
7857 #
7858 # // ...
7859 # static UIColor* fromProto(Color* protocolor) {
7860 # float red = [protocolor red];
7861 # float green = [protocolor green];
7862 # float blue = [protocolor blue];
7863 # FloatValue* alpha_wrapper = [protocolor alpha];
7864 # float alpha = 1.0;
7865 # if (alpha_wrapper != nil) {
7866 # alpha = [alpha_wrapper value];
7867 # }
7868 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
7869 # }
7870 #
7871 # static Color* toProto(UIColor* color) {
7872 # CGFloat red, green, blue, alpha;
7873 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
7874 # return nil;
7875 # }
7876 # Color* result = [Color alloc] init];
7877 # [result setRed:red];
7878 # [result setGreen:green];
7879 # [result setBlue:blue];
7880 # if (alpha <= 0.9999) {
7881 # [result setAlpha:floatWrapperWithValue(alpha)];
7882 # }
7883 # [result autorelease];
7884 # return result;
7885 # }
7886 # // ...
7887 #
7888 # Example (JavaScript):
7889 #
7890 # // ...
7891 #
7892 # var protoToCssColor = function(rgb_color) {
7893 # var redFrac = rgb_color.red || 0.0;
7894 # var greenFrac = rgb_color.green || 0.0;
7895 # var blueFrac = rgb_color.blue || 0.0;
7896 # var red = Math.floor(redFrac * 255);
7897 # var green = Math.floor(greenFrac * 255);
7898 # var blue = Math.floor(blueFrac * 255);
7899 #
7900 # if (!('alpha' in rgb_color)) {
7901 # return rgbToCssColor_(red, green, blue);
7902 # }
7903 #
7904 # var alphaFrac = rgb_color.alpha.value || 0.0;
7905 # var rgbParams = [red, green, blue].join(',');
7906 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
7907 # };
7908 #
7909 # var rgbToCssColor_ = function(red, green, blue) {
7910 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
7911 # var hexString = rgbNumber.toString(16);
7912 # var missingZeros = 6 - hexString.length;
7913 # var resultBuilder = ['#'];
7914 # for (var i = 0; i < missingZeros; i++) {
7915 # resultBuilder.push('0');
7916 # }
7917 # resultBuilder.push(hexString);
7918 # return resultBuilder.join('');
7919 # };
7920 #
7921 # // ...
7922 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
7923 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
7924 # the final pixel color is defined by the equation:
7925 #
7926 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
7927 #
7928 # This means that a value of 1.0 corresponds to a solid color, whereas
7929 # a value of 0.0 corresponds to a completely transparent color. This
7930 # uses a wrapper message rather than a simple float scalar so that it is
7931 # possible to distinguish between a default value and the value being unset.
7932 # If omitted, this color object is to be rendered as a solid color
7933 # (as if the alpha value had been explicitly given with a value of 1.0).
7934 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
7935 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
7936 },
7937 "bold": True or False, # True if the text is bold.
7938 "strikethrough": True or False, # True if the text has a strikethrough.
7939 "fontFamily": "A String", # The font family.
7940 "fontSize": 42, # The size of the font.
7941 "italic": True or False, # True if the text is italicized.
7942 "underline": True or False, # True if the text is underlined.
7943 },
7944 },
7945 ],
7946 },
7947 "fields": "A String", # The fields that should be updated. At least one field must be specified.
7948 # The root `cell` is implied and should not be specified.
7949 # A single `"*"` can be used as short-hand for listing every field.
7950 "range": { # A range on a sheet. # The range to repeat the cell in.
7951 # All indexes are zero-based.
7952 # Indexes are half open, e.g the start index is inclusive
7953 # and the end index is exclusive -- [start_index, end_index).
7954 # Missing indexes indicate the range is unbounded on that side.
7955 #
7956 # For example, if "Sheet1" is grid ID 0, then:
7957 #
7958 # Sheet1!A1:A1 == sheet_id: 0,
7959 # start_row_index: 0, end_row_index: 1,
7960 # start_column_index: 0, end_column_index: 1
7961 #
7962 # Sheet1!A3:B4 == sheet_id: 0,
7963 # start_row_index: 2, end_row_index: 4,
7964 # start_column_index: 0, end_column_index: 2
7965 #
7966 # Sheet1!A:B == sheet_id: 0,
7967 # start_column_index: 0, end_column_index: 2
7968 #
7969 # Sheet1!A5:B == sheet_id: 0,
7970 # start_row_index: 4,
7971 # start_column_index: 0, end_column_index: 2
7972 #
7973 # Sheet1 == sheet_id:0
7974 #
7975 # The start index must always be less than or equal to the end index.
7976 # If the start index equals the end index, then the range is empty.
7977 # Empty ranges are typically not meaningful and are usually rendered in the
7978 # UI as `#REF!`.
7979 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
7980 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
7981 "sheetId": 42, # The sheet this range is on.
7982 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
7983 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
7984 },
7985 },
7986 "findReplace": { # Finds and replaces data in cells over a range, sheet, or all sheets. # Finds and replace occurrences of some text with other text.
7987 "includeFormulas": True or False, # True if the search should include cells with formulas.
7988 # False to skip cells with formulas.
7989 "matchEntireCell": True or False, # True if the find value should match the entire cell.
7990 "allSheets": True or False, # True to find/replace over all sheets.
7991 "matchCase": True or False, # True if the search is case sensitive.
7992 "sheetId": 42, # The sheet to find/replace over.
7993 "range": { # A range on a sheet. # The range to find/replace over.
7994 # All indexes are zero-based.
7995 # Indexes are half open, e.g the start index is inclusive
7996 # and the end index is exclusive -- [start_index, end_index).
7997 # Missing indexes indicate the range is unbounded on that side.
7998 #
7999 # For example, if "Sheet1" is grid ID 0, then:
8000 #
8001 # Sheet1!A1:A1 == sheet_id: 0,
8002 # start_row_index: 0, end_row_index: 1,
8003 # start_column_index: 0, end_column_index: 1
8004 #
8005 # Sheet1!A3:B4 == sheet_id: 0,
8006 # start_row_index: 2, end_row_index: 4,
8007 # start_column_index: 0, end_column_index: 2
8008 #
8009 # Sheet1!A:B == sheet_id: 0,
8010 # start_column_index: 0, end_column_index: 2
8011 #
8012 # Sheet1!A5:B == sheet_id: 0,
8013 # start_row_index: 4,
8014 # start_column_index: 0, end_column_index: 2
8015 #
8016 # Sheet1 == sheet_id:0
8017 #
8018 # The start index must always be less than or equal to the end index.
8019 # If the start index equals the end index, then the range is empty.
8020 # Empty ranges are typically not meaningful and are usually rendered in the
8021 # UI as `#REF!`.
8022 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
8023 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
8024 "sheetId": 42, # The sheet this range is on.
8025 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
8026 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
8027 },
8028 "searchByRegex": True or False, # True if the find value is a regex.
8029 # The regular expression and replacement should follow Java regex rules
8030 # at https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html.
8031 # The replacement string is allowed to refer to capturing groups.
8032 # For example, if one cell has the contents "`Google Sheets`" and another
8033 # has "`Google Docs`", then searching for `"o.* (.*)"` with a replacement of
8034 # `"$1 Rocks`"` would change the contents of the cells to
8035 # "`GSheets Rocks`" and "`GDocs Rocks`" respectively.
8036 "find": "A String", # The value to search.
8037 "replacement": "A String", # The value to use as the replacement.
8038 },
8039 "setBasicFilter": { # Sets the basic filter associated with a sheet. # Sets the basic filter on a sheet.
8040 "filter": { # The default filter associated with a sheet. # The filter to set.
8041 "range": { # A range on a sheet. # The range the filter covers.
8042 # All indexes are zero-based.
8043 # Indexes are half open, e.g the start index is inclusive
8044 # and the end index is exclusive -- [start_index, end_index).
8045 # Missing indexes indicate the range is unbounded on that side.
8046 #
8047 # For example, if "Sheet1" is grid ID 0, then:
8048 #
8049 # Sheet1!A1:A1 == sheet_id: 0,
8050 # start_row_index: 0, end_row_index: 1,
8051 # start_column_index: 0, end_column_index: 1
8052 #
8053 # Sheet1!A3:B4 == sheet_id: 0,
8054 # start_row_index: 2, end_row_index: 4,
8055 # start_column_index: 0, end_column_index: 2
8056 #
8057 # Sheet1!A:B == sheet_id: 0,
8058 # start_column_index: 0, end_column_index: 2
8059 #
8060 # Sheet1!A5:B == sheet_id: 0,
8061 # start_row_index: 4,
8062 # start_column_index: 0, end_column_index: 2
8063 #
8064 # Sheet1 == sheet_id:0
8065 #
8066 # The start index must always be less than or equal to the end index.
8067 # If the start index equals the end index, then the range is empty.
8068 # Empty ranges are typically not meaningful and are usually rendered in the
8069 # UI as `#REF!`.
8070 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
8071 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
8072 "sheetId": 42, # The sheet this range is on.
8073 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
8074 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
8075 },
8076 "sortSpecs": [ # The sort order per column. Later specifications are used when values
8077 # are equal in the earlier specifications.
8078 { # A sort order associated with a specific column or row.
8079 "sortOrder": "A String", # The order data should be sorted.
8080 "dimensionIndex": 42, # The dimension the sort should be applied to.
8081 },
8082 ],
8083 "criteria": { # The criteria for showing/hiding values per column.
8084 # The map's key is the column index, and the value is the criteria for
8085 # that column.
8086 "a_key": { # Criteria for showing/hiding rows in a filter, filter view.
8087 "hiddenValues": [ # Values that should be hidden.
8088 "A String",
8089 ],
8090 "condition": { # A condition that can evaluate to true or false. # A condition that must be true for values to be shown.
8091 # (This does not override hiddenValues -- if a value is listed there,
8092 # it will still be hidden.)
8093 # BooleanConditions are used by conditional formatting,
8094 # data validation, and the criteria in filters.
8095 "type": "A String", # The type of condition.
8096 "values": [ # The values of the condition. The number of supported values depends
8097 # on the condition type. Some support zero values,
8098 # others one or two values,
8099 # and ConditionType.ONE_OF_LIST supports an arbitrary number of values.
8100 { # The value of the condition.
8101 "relativeDate": "A String", # A relative date (based on the current date).
8102 # Valid only if the type is
8103 # DATE_BEFORE,
8104 # DATE_AFTER,
8105 # DATE_ON_OR_BEFORE or
8106 # DATE_ON_OR_AFTER.
8107 #
8108 # Relative dates are not supported in data validation.
8109 # They are supported only in conditional formatting and
8110 # conditional filters.
8111 "userEnteredValue": "A String", # A value the condition is based on.
8112 # The value will be parsed as if the user typed into a cell.
8113 # Formulas are supported (and must begin with an `=`).
8114 },
8115 ],
8116 },
8117 },
8118 },
8119 },
8120 },
8121 "updateSpreadsheetProperties": { # Updates properties of a spreadsheet. # Updates the spreadsheet's properties.
8122 # It is an error to specify read only fields in the field mask.
8123 "fields": "A String", # The fields that should be updated. At least one field must be specified.
8124 # The root 'properties' is implied and should not be specified.
8125 # A single `"*"` can be used as short-hand for listing every field.
8126 "properties": { # Properties of a spreadsheet. # The properties to update.
8127 "locale": "A String", # The locale of the spreadsheet in one of the following formats:
8128 # * an ISO 639-1 language code such as `en`
8129 # * an ISO 639-2 language code such as `fil`, if no 639-1 code exists
8130 # * a combination of the ISO language code and country code, such as `en_US`
8131 # Note: when updating this field, not all locales/languages are supported.
8132 "timeZone": "A String", # The time zone of the spreadsheet, in CLDR format such as
8133 # `America/New_York`. If the time zone isn't recognized, this may
8134 # be a custom time zone such as `GMT-07:00`.
8135 "autoRecalc": "A String", # The amount of time to wait before volatile functions are recalculated.
8136 "defaultFormat": { # The format of a cell. # The default format of all cells in the spreadsheet.
8137 # CellData.effectiveFormat will not be set if the cell's format is equal
8138 # to this default format.
8139 # This field is read-only.
8140 "numberFormat": { # The number format of a cell. # A format describing how number values should be represented to the user.
8141 # When updating, all fields must be set.
8142 "pattern": "A String", # Pattern string used for formatting.
8143 "type": "A String", # The type of the number format.
8144 },
8145 "textDirection": "A String", # The direction of the text in the cell.
8146 "padding": { # The amount of padding around the cell, in pixels. # The padding of the cell.
8147 # When updating padding, every field must be specified.
8148 "top": 42, # The top padding of the cell.
8149 "right": 42, # The right padding of the cell.
8150 "bottom": 42, # The bottom padding of the cell.
8151 "left": 42, # The left padding of the cell.
8152 },
8153 "horizontalAlignment": "A String", # The horizontal alignment of the value in cell.
8154 "backgroundColor": { # Represents a color in the RGBA color space. This representation is designed # The background color of the cell.
8155 # for simplicity of conversion to/from color representations in various
8156 # languages over compactness; for example, the fields of this representation
8157 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
8158 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
8159 # method in iOS; and, with just a little work, it can be easily formatted into
8160 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
8161 #
8162 # Example (Java):
8163 #
8164 # import com.google.type.Color;
8165 #
8166 # // ...
8167 # public static java.awt.Color fromProto(Color protocolor) {
8168 # float alpha = protocolor.hasAlpha()
8169 # ? protocolor.getAlpha().getValue()
8170 # : 1.0;
8171 #
8172 # return new java.awt.Color(
8173 # protocolor.getRed(),
8174 # protocolor.getGreen(),
8175 # protocolor.getBlue(),
8176 # alpha);
8177 # }
8178 #
8179 # public static Color toProto(java.awt.Color color) {
8180 # float red = (float) color.getRed();
8181 # float green = (float) color.getGreen();
8182 # float blue = (float) color.getBlue();
8183 # float denominator = 255.0;
8184 # Color.Builder resultBuilder =
8185 # Color
8186 # .newBuilder()
8187 # .setRed(red / denominator)
8188 # .setGreen(green / denominator)
8189 # .setBlue(blue / denominator);
8190 # int alpha = color.getAlpha();
8191 # if (alpha != 255) {
8192 # result.setAlpha(
8193 # FloatValue
8194 # .newBuilder()
8195 # .setValue(((float) alpha) / denominator)
8196 # .build());
8197 # }
8198 # return resultBuilder.build();
8199 # }
8200 # // ...
8201 #
8202 # Example (iOS / Obj-C):
8203 #
8204 # // ...
8205 # static UIColor* fromProto(Color* protocolor) {
8206 # float red = [protocolor red];
8207 # float green = [protocolor green];
8208 # float blue = [protocolor blue];
8209 # FloatValue* alpha_wrapper = [protocolor alpha];
8210 # float alpha = 1.0;
8211 # if (alpha_wrapper != nil) {
8212 # alpha = [alpha_wrapper value];
8213 # }
8214 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
8215 # }
8216 #
8217 # static Color* toProto(UIColor* color) {
8218 # CGFloat red, green, blue, alpha;
8219 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
8220 # return nil;
8221 # }
8222 # Color* result = [Color alloc] init];
8223 # [result setRed:red];
8224 # [result setGreen:green];
8225 # [result setBlue:blue];
8226 # if (alpha <= 0.9999) {
8227 # [result setAlpha:floatWrapperWithValue(alpha)];
8228 # }
8229 # [result autorelease];
8230 # return result;
8231 # }
8232 # // ...
8233 #
8234 # Example (JavaScript):
8235 #
8236 # // ...
8237 #
8238 # var protoToCssColor = function(rgb_color) {
8239 # var redFrac = rgb_color.red || 0.0;
8240 # var greenFrac = rgb_color.green || 0.0;
8241 # var blueFrac = rgb_color.blue || 0.0;
8242 # var red = Math.floor(redFrac * 255);
8243 # var green = Math.floor(greenFrac * 255);
8244 # var blue = Math.floor(blueFrac * 255);
8245 #
8246 # if (!('alpha' in rgb_color)) {
8247 # return rgbToCssColor_(red, green, blue);
8248 # }
8249 #
8250 # var alphaFrac = rgb_color.alpha.value || 0.0;
8251 # var rgbParams = [red, green, blue].join(',');
8252 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
8253 # };
8254 #
8255 # var rgbToCssColor_ = function(red, green, blue) {
8256 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
8257 # var hexString = rgbNumber.toString(16);
8258 # var missingZeros = 6 - hexString.length;
8259 # var resultBuilder = ['#'];
8260 # for (var i = 0; i < missingZeros; i++) {
8261 # resultBuilder.push('0');
8262 # }
8263 # resultBuilder.push(hexString);
8264 # return resultBuilder.join('');
8265 # };
8266 #
8267 # // ...
8268 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
8269 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
8270 # the final pixel color is defined by the equation:
8271 #
8272 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
8273 #
8274 # This means that a value of 1.0 corresponds to a solid color, whereas
8275 # a value of 0.0 corresponds to a completely transparent color. This
8276 # uses a wrapper message rather than a simple float scalar so that it is
8277 # possible to distinguish between a default value and the value being unset.
8278 # If omitted, this color object is to be rendered as a solid color
8279 # (as if the alpha value had been explicitly given with a value of 1.0).
8280 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
8281 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
8282 },
8283 "verticalAlignment": "A String", # The vertical alignment of the value in cell.
8284 "textFormat": { # The format of a run of text in a cell. # The format of the text in the cell (unless overridden by a format run).
8285 # Absent values indicate that the field isn't specified.
8286 "foregroundColor": { # Represents a color in the RGBA color space. This representation is designed # The foreground color of the text.
8287 # for simplicity of conversion to/from color representations in various
8288 # languages over compactness; for example, the fields of this representation
8289 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
8290 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
8291 # method in iOS; and, with just a little work, it can be easily formatted into
8292 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
8293 #
8294 # Example (Java):
8295 #
8296 # import com.google.type.Color;
8297 #
8298 # // ...
8299 # public static java.awt.Color fromProto(Color protocolor) {
8300 # float alpha = protocolor.hasAlpha()
8301 # ? protocolor.getAlpha().getValue()
8302 # : 1.0;
8303 #
8304 # return new java.awt.Color(
8305 # protocolor.getRed(),
8306 # protocolor.getGreen(),
8307 # protocolor.getBlue(),
8308 # alpha);
8309 # }
8310 #
8311 # public static Color toProto(java.awt.Color color) {
8312 # float red = (float) color.getRed();
8313 # float green = (float) color.getGreen();
8314 # float blue = (float) color.getBlue();
8315 # float denominator = 255.0;
8316 # Color.Builder resultBuilder =
8317 # Color
8318 # .newBuilder()
8319 # .setRed(red / denominator)
8320 # .setGreen(green / denominator)
8321 # .setBlue(blue / denominator);
8322 # int alpha = color.getAlpha();
8323 # if (alpha != 255) {
8324 # result.setAlpha(
8325 # FloatValue
8326 # .newBuilder()
8327 # .setValue(((float) alpha) / denominator)
8328 # .build());
8329 # }
8330 # return resultBuilder.build();
8331 # }
8332 # // ...
8333 #
8334 # Example (iOS / Obj-C):
8335 #
8336 # // ...
8337 # static UIColor* fromProto(Color* protocolor) {
8338 # float red = [protocolor red];
8339 # float green = [protocolor green];
8340 # float blue = [protocolor blue];
8341 # FloatValue* alpha_wrapper = [protocolor alpha];
8342 # float alpha = 1.0;
8343 # if (alpha_wrapper != nil) {
8344 # alpha = [alpha_wrapper value];
8345 # }
8346 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
8347 # }
8348 #
8349 # static Color* toProto(UIColor* color) {
8350 # CGFloat red, green, blue, alpha;
8351 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
8352 # return nil;
8353 # }
8354 # Color* result = [Color alloc] init];
8355 # [result setRed:red];
8356 # [result setGreen:green];
8357 # [result setBlue:blue];
8358 # if (alpha <= 0.9999) {
8359 # [result setAlpha:floatWrapperWithValue(alpha)];
8360 # }
8361 # [result autorelease];
8362 # return result;
8363 # }
8364 # // ...
8365 #
8366 # Example (JavaScript):
8367 #
8368 # // ...
8369 #
8370 # var protoToCssColor = function(rgb_color) {
8371 # var redFrac = rgb_color.red || 0.0;
8372 # var greenFrac = rgb_color.green || 0.0;
8373 # var blueFrac = rgb_color.blue || 0.0;
8374 # var red = Math.floor(redFrac * 255);
8375 # var green = Math.floor(greenFrac * 255);
8376 # var blue = Math.floor(blueFrac * 255);
8377 #
8378 # if (!('alpha' in rgb_color)) {
8379 # return rgbToCssColor_(red, green, blue);
8380 # }
8381 #
8382 # var alphaFrac = rgb_color.alpha.value || 0.0;
8383 # var rgbParams = [red, green, blue].join(',');
8384 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
8385 # };
8386 #
8387 # var rgbToCssColor_ = function(red, green, blue) {
8388 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
8389 # var hexString = rgbNumber.toString(16);
8390 # var missingZeros = 6 - hexString.length;
8391 # var resultBuilder = ['#'];
8392 # for (var i = 0; i < missingZeros; i++) {
8393 # resultBuilder.push('0');
8394 # }
8395 # resultBuilder.push(hexString);
8396 # return resultBuilder.join('');
8397 # };
8398 #
8399 # // ...
8400 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
8401 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
8402 # the final pixel color is defined by the equation:
8403 #
8404 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
8405 #
8406 # This means that a value of 1.0 corresponds to a solid color, whereas
8407 # a value of 0.0 corresponds to a completely transparent color. This
8408 # uses a wrapper message rather than a simple float scalar so that it is
8409 # possible to distinguish between a default value and the value being unset.
8410 # If omitted, this color object is to be rendered as a solid color
8411 # (as if the alpha value had been explicitly given with a value of 1.0).
8412 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
8413 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
8414 },
8415 "bold": True or False, # True if the text is bold.
8416 "strikethrough": True or False, # True if the text has a strikethrough.
8417 "fontFamily": "A String", # The font family.
8418 "fontSize": 42, # The size of the font.
8419 "italic": True or False, # True if the text is italicized.
8420 "underline": True or False, # True if the text is underlined.
8421 },
8422 "hyperlinkDisplayType": "A String", # How a hyperlink, if it exists, should be displayed in the cell.
8423 "borders": { # The borders of the cell. # The borders of the cell.
8424 "top": { # A border along a cell. # The top border of the cell.
8425 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
8426 # for simplicity of conversion to/from color representations in various
8427 # languages over compactness; for example, the fields of this representation
8428 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
8429 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
8430 # method in iOS; and, with just a little work, it can be easily formatted into
8431 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
8432 #
8433 # Example (Java):
8434 #
8435 # import com.google.type.Color;
8436 #
8437 # // ...
8438 # public static java.awt.Color fromProto(Color protocolor) {
8439 # float alpha = protocolor.hasAlpha()
8440 # ? protocolor.getAlpha().getValue()
8441 # : 1.0;
8442 #
8443 # return new java.awt.Color(
8444 # protocolor.getRed(),
8445 # protocolor.getGreen(),
8446 # protocolor.getBlue(),
8447 # alpha);
8448 # }
8449 #
8450 # public static Color toProto(java.awt.Color color) {
8451 # float red = (float) color.getRed();
8452 # float green = (float) color.getGreen();
8453 # float blue = (float) color.getBlue();
8454 # float denominator = 255.0;
8455 # Color.Builder resultBuilder =
8456 # Color
8457 # .newBuilder()
8458 # .setRed(red / denominator)
8459 # .setGreen(green / denominator)
8460 # .setBlue(blue / denominator);
8461 # int alpha = color.getAlpha();
8462 # if (alpha != 255) {
8463 # result.setAlpha(
8464 # FloatValue
8465 # .newBuilder()
8466 # .setValue(((float) alpha) / denominator)
8467 # .build());
8468 # }
8469 # return resultBuilder.build();
8470 # }
8471 # // ...
8472 #
8473 # Example (iOS / Obj-C):
8474 #
8475 # // ...
8476 # static UIColor* fromProto(Color* protocolor) {
8477 # float red = [protocolor red];
8478 # float green = [protocolor green];
8479 # float blue = [protocolor blue];
8480 # FloatValue* alpha_wrapper = [protocolor alpha];
8481 # float alpha = 1.0;
8482 # if (alpha_wrapper != nil) {
8483 # alpha = [alpha_wrapper value];
8484 # }
8485 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
8486 # }
8487 #
8488 # static Color* toProto(UIColor* color) {
8489 # CGFloat red, green, blue, alpha;
8490 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
8491 # return nil;
8492 # }
8493 # Color* result = [Color alloc] init];
8494 # [result setRed:red];
8495 # [result setGreen:green];
8496 # [result setBlue:blue];
8497 # if (alpha <= 0.9999) {
8498 # [result setAlpha:floatWrapperWithValue(alpha)];
8499 # }
8500 # [result autorelease];
8501 # return result;
8502 # }
8503 # // ...
8504 #
8505 # Example (JavaScript):
8506 #
8507 # // ...
8508 #
8509 # var protoToCssColor = function(rgb_color) {
8510 # var redFrac = rgb_color.red || 0.0;
8511 # var greenFrac = rgb_color.green || 0.0;
8512 # var blueFrac = rgb_color.blue || 0.0;
8513 # var red = Math.floor(redFrac * 255);
8514 # var green = Math.floor(greenFrac * 255);
8515 # var blue = Math.floor(blueFrac * 255);
8516 #
8517 # if (!('alpha' in rgb_color)) {
8518 # return rgbToCssColor_(red, green, blue);
8519 # }
8520 #
8521 # var alphaFrac = rgb_color.alpha.value || 0.0;
8522 # var rgbParams = [red, green, blue].join(',');
8523 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
8524 # };
8525 #
8526 # var rgbToCssColor_ = function(red, green, blue) {
8527 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
8528 # var hexString = rgbNumber.toString(16);
8529 # var missingZeros = 6 - hexString.length;
8530 # var resultBuilder = ['#'];
8531 # for (var i = 0; i < missingZeros; i++) {
8532 # resultBuilder.push('0');
8533 # }
8534 # resultBuilder.push(hexString);
8535 # return resultBuilder.join('');
8536 # };
8537 #
8538 # // ...
8539 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
8540 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
8541 # the final pixel color is defined by the equation:
8542 #
8543 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
8544 #
8545 # This means that a value of 1.0 corresponds to a solid color, whereas
8546 # a value of 0.0 corresponds to a completely transparent color. This
8547 # uses a wrapper message rather than a simple float scalar so that it is
8548 # possible to distinguish between a default value and the value being unset.
8549 # If omitted, this color object is to be rendered as a solid color
8550 # (as if the alpha value had been explicitly given with a value of 1.0).
8551 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
8552 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
8553 },
8554 "width": 42, # The width of the border, in pixels.
8555 # Border widths must be between 0 and 3 pixels.
8556 "style": "A String", # The style of the border.
8557 },
8558 "right": { # A border along a cell. # The right border of the cell.
8559 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
8560 # for simplicity of conversion to/from color representations in various
8561 # languages over compactness; for example, the fields of this representation
8562 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
8563 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
8564 # method in iOS; and, with just a little work, it can be easily formatted into
8565 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
8566 #
8567 # Example (Java):
8568 #
8569 # import com.google.type.Color;
8570 #
8571 # // ...
8572 # public static java.awt.Color fromProto(Color protocolor) {
8573 # float alpha = protocolor.hasAlpha()
8574 # ? protocolor.getAlpha().getValue()
8575 # : 1.0;
8576 #
8577 # return new java.awt.Color(
8578 # protocolor.getRed(),
8579 # protocolor.getGreen(),
8580 # protocolor.getBlue(),
8581 # alpha);
8582 # }
8583 #
8584 # public static Color toProto(java.awt.Color color) {
8585 # float red = (float) color.getRed();
8586 # float green = (float) color.getGreen();
8587 # float blue = (float) color.getBlue();
8588 # float denominator = 255.0;
8589 # Color.Builder resultBuilder =
8590 # Color
8591 # .newBuilder()
8592 # .setRed(red / denominator)
8593 # .setGreen(green / denominator)
8594 # .setBlue(blue / denominator);
8595 # int alpha = color.getAlpha();
8596 # if (alpha != 255) {
8597 # result.setAlpha(
8598 # FloatValue
8599 # .newBuilder()
8600 # .setValue(((float) alpha) / denominator)
8601 # .build());
8602 # }
8603 # return resultBuilder.build();
8604 # }
8605 # // ...
8606 #
8607 # Example (iOS / Obj-C):
8608 #
8609 # // ...
8610 # static UIColor* fromProto(Color* protocolor) {
8611 # float red = [protocolor red];
8612 # float green = [protocolor green];
8613 # float blue = [protocolor blue];
8614 # FloatValue* alpha_wrapper = [protocolor alpha];
8615 # float alpha = 1.0;
8616 # if (alpha_wrapper != nil) {
8617 # alpha = [alpha_wrapper value];
8618 # }
8619 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
8620 # }
8621 #
8622 # static Color* toProto(UIColor* color) {
8623 # CGFloat red, green, blue, alpha;
8624 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
8625 # return nil;
8626 # }
8627 # Color* result = [Color alloc] init];
8628 # [result setRed:red];
8629 # [result setGreen:green];
8630 # [result setBlue:blue];
8631 # if (alpha <= 0.9999) {
8632 # [result setAlpha:floatWrapperWithValue(alpha)];
8633 # }
8634 # [result autorelease];
8635 # return result;
8636 # }
8637 # // ...
8638 #
8639 # Example (JavaScript):
8640 #
8641 # // ...
8642 #
8643 # var protoToCssColor = function(rgb_color) {
8644 # var redFrac = rgb_color.red || 0.0;
8645 # var greenFrac = rgb_color.green || 0.0;
8646 # var blueFrac = rgb_color.blue || 0.0;
8647 # var red = Math.floor(redFrac * 255);
8648 # var green = Math.floor(greenFrac * 255);
8649 # var blue = Math.floor(blueFrac * 255);
8650 #
8651 # if (!('alpha' in rgb_color)) {
8652 # return rgbToCssColor_(red, green, blue);
8653 # }
8654 #
8655 # var alphaFrac = rgb_color.alpha.value || 0.0;
8656 # var rgbParams = [red, green, blue].join(',');
8657 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
8658 # };
8659 #
8660 # var rgbToCssColor_ = function(red, green, blue) {
8661 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
8662 # var hexString = rgbNumber.toString(16);
8663 # var missingZeros = 6 - hexString.length;
8664 # var resultBuilder = ['#'];
8665 # for (var i = 0; i < missingZeros; i++) {
8666 # resultBuilder.push('0');
8667 # }
8668 # resultBuilder.push(hexString);
8669 # return resultBuilder.join('');
8670 # };
8671 #
8672 # // ...
8673 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
8674 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
8675 # the final pixel color is defined by the equation:
8676 #
8677 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
8678 #
8679 # This means that a value of 1.0 corresponds to a solid color, whereas
8680 # a value of 0.0 corresponds to a completely transparent color. This
8681 # uses a wrapper message rather than a simple float scalar so that it is
8682 # possible to distinguish between a default value and the value being unset.
8683 # If omitted, this color object is to be rendered as a solid color
8684 # (as if the alpha value had been explicitly given with a value of 1.0).
8685 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
8686 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
8687 },
8688 "width": 42, # The width of the border, in pixels.
8689 # Border widths must be between 0 and 3 pixels.
8690 "style": "A String", # The style of the border.
8691 },
8692 "bottom": { # A border along a cell. # The bottom border of the cell.
8693 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
8694 # for simplicity of conversion to/from color representations in various
8695 # languages over compactness; for example, the fields of this representation
8696 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
8697 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
8698 # method in iOS; and, with just a little work, it can be easily formatted into
8699 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
8700 #
8701 # Example (Java):
8702 #
8703 # import com.google.type.Color;
8704 #
8705 # // ...
8706 # public static java.awt.Color fromProto(Color protocolor) {
8707 # float alpha = protocolor.hasAlpha()
8708 # ? protocolor.getAlpha().getValue()
8709 # : 1.0;
8710 #
8711 # return new java.awt.Color(
8712 # protocolor.getRed(),
8713 # protocolor.getGreen(),
8714 # protocolor.getBlue(),
8715 # alpha);
8716 # }
8717 #
8718 # public static Color toProto(java.awt.Color color) {
8719 # float red = (float) color.getRed();
8720 # float green = (float) color.getGreen();
8721 # float blue = (float) color.getBlue();
8722 # float denominator = 255.0;
8723 # Color.Builder resultBuilder =
8724 # Color
8725 # .newBuilder()
8726 # .setRed(red / denominator)
8727 # .setGreen(green / denominator)
8728 # .setBlue(blue / denominator);
8729 # int alpha = color.getAlpha();
8730 # if (alpha != 255) {
8731 # result.setAlpha(
8732 # FloatValue
8733 # .newBuilder()
8734 # .setValue(((float) alpha) / denominator)
8735 # .build());
8736 # }
8737 # return resultBuilder.build();
8738 # }
8739 # // ...
8740 #
8741 # Example (iOS / Obj-C):
8742 #
8743 # // ...
8744 # static UIColor* fromProto(Color* protocolor) {
8745 # float red = [protocolor red];
8746 # float green = [protocolor green];
8747 # float blue = [protocolor blue];
8748 # FloatValue* alpha_wrapper = [protocolor alpha];
8749 # float alpha = 1.0;
8750 # if (alpha_wrapper != nil) {
8751 # alpha = [alpha_wrapper value];
8752 # }
8753 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
8754 # }
8755 #
8756 # static Color* toProto(UIColor* color) {
8757 # CGFloat red, green, blue, alpha;
8758 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
8759 # return nil;
8760 # }
8761 # Color* result = [Color alloc] init];
8762 # [result setRed:red];
8763 # [result setGreen:green];
8764 # [result setBlue:blue];
8765 # if (alpha <= 0.9999) {
8766 # [result setAlpha:floatWrapperWithValue(alpha)];
8767 # }
8768 # [result autorelease];
8769 # return result;
8770 # }
8771 # // ...
8772 #
8773 # Example (JavaScript):
8774 #
8775 # // ...
8776 #
8777 # var protoToCssColor = function(rgb_color) {
8778 # var redFrac = rgb_color.red || 0.0;
8779 # var greenFrac = rgb_color.green || 0.0;
8780 # var blueFrac = rgb_color.blue || 0.0;
8781 # var red = Math.floor(redFrac * 255);
8782 # var green = Math.floor(greenFrac * 255);
8783 # var blue = Math.floor(blueFrac * 255);
8784 #
8785 # if (!('alpha' in rgb_color)) {
8786 # return rgbToCssColor_(red, green, blue);
8787 # }
8788 #
8789 # var alphaFrac = rgb_color.alpha.value || 0.0;
8790 # var rgbParams = [red, green, blue].join(',');
8791 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
8792 # };
8793 #
8794 # var rgbToCssColor_ = function(red, green, blue) {
8795 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
8796 # var hexString = rgbNumber.toString(16);
8797 # var missingZeros = 6 - hexString.length;
8798 # var resultBuilder = ['#'];
8799 # for (var i = 0; i < missingZeros; i++) {
8800 # resultBuilder.push('0');
8801 # }
8802 # resultBuilder.push(hexString);
8803 # return resultBuilder.join('');
8804 # };
8805 #
8806 # // ...
8807 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
8808 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
8809 # the final pixel color is defined by the equation:
8810 #
8811 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
8812 #
8813 # This means that a value of 1.0 corresponds to a solid color, whereas
8814 # a value of 0.0 corresponds to a completely transparent color. This
8815 # uses a wrapper message rather than a simple float scalar so that it is
8816 # possible to distinguish between a default value and the value being unset.
8817 # If omitted, this color object is to be rendered as a solid color
8818 # (as if the alpha value had been explicitly given with a value of 1.0).
8819 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
8820 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
8821 },
8822 "width": 42, # The width of the border, in pixels.
8823 # Border widths must be between 0 and 3 pixels.
8824 "style": "A String", # The style of the border.
8825 },
8826 "left": { # A border along a cell. # The left border of the cell.
8827 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
8828 # for simplicity of conversion to/from color representations in various
8829 # languages over compactness; for example, the fields of this representation
8830 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
8831 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
8832 # method in iOS; and, with just a little work, it can be easily formatted into
8833 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
8834 #
8835 # Example (Java):
8836 #
8837 # import com.google.type.Color;
8838 #
8839 # // ...
8840 # public static java.awt.Color fromProto(Color protocolor) {
8841 # float alpha = protocolor.hasAlpha()
8842 # ? protocolor.getAlpha().getValue()
8843 # : 1.0;
8844 #
8845 # return new java.awt.Color(
8846 # protocolor.getRed(),
8847 # protocolor.getGreen(),
8848 # protocolor.getBlue(),
8849 # alpha);
8850 # }
8851 #
8852 # public static Color toProto(java.awt.Color color) {
8853 # float red = (float) color.getRed();
8854 # float green = (float) color.getGreen();
8855 # float blue = (float) color.getBlue();
8856 # float denominator = 255.0;
8857 # Color.Builder resultBuilder =
8858 # Color
8859 # .newBuilder()
8860 # .setRed(red / denominator)
8861 # .setGreen(green / denominator)
8862 # .setBlue(blue / denominator);
8863 # int alpha = color.getAlpha();
8864 # if (alpha != 255) {
8865 # result.setAlpha(
8866 # FloatValue
8867 # .newBuilder()
8868 # .setValue(((float) alpha) / denominator)
8869 # .build());
8870 # }
8871 # return resultBuilder.build();
8872 # }
8873 # // ...
8874 #
8875 # Example (iOS / Obj-C):
8876 #
8877 # // ...
8878 # static UIColor* fromProto(Color* protocolor) {
8879 # float red = [protocolor red];
8880 # float green = [protocolor green];
8881 # float blue = [protocolor blue];
8882 # FloatValue* alpha_wrapper = [protocolor alpha];
8883 # float alpha = 1.0;
8884 # if (alpha_wrapper != nil) {
8885 # alpha = [alpha_wrapper value];
8886 # }
8887 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
8888 # }
8889 #
8890 # static Color* toProto(UIColor* color) {
8891 # CGFloat red, green, blue, alpha;
8892 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
8893 # return nil;
8894 # }
8895 # Color* result = [Color alloc] init];
8896 # [result setRed:red];
8897 # [result setGreen:green];
8898 # [result setBlue:blue];
8899 # if (alpha <= 0.9999) {
8900 # [result setAlpha:floatWrapperWithValue(alpha)];
8901 # }
8902 # [result autorelease];
8903 # return result;
8904 # }
8905 # // ...
8906 #
8907 # Example (JavaScript):
8908 #
8909 # // ...
8910 #
8911 # var protoToCssColor = function(rgb_color) {
8912 # var redFrac = rgb_color.red || 0.0;
8913 # var greenFrac = rgb_color.green || 0.0;
8914 # var blueFrac = rgb_color.blue || 0.0;
8915 # var red = Math.floor(redFrac * 255);
8916 # var green = Math.floor(greenFrac * 255);
8917 # var blue = Math.floor(blueFrac * 255);
8918 #
8919 # if (!('alpha' in rgb_color)) {
8920 # return rgbToCssColor_(red, green, blue);
8921 # }
8922 #
8923 # var alphaFrac = rgb_color.alpha.value || 0.0;
8924 # var rgbParams = [red, green, blue].join(',');
8925 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
8926 # };
8927 #
8928 # var rgbToCssColor_ = function(red, green, blue) {
8929 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
8930 # var hexString = rgbNumber.toString(16);
8931 # var missingZeros = 6 - hexString.length;
8932 # var resultBuilder = ['#'];
8933 # for (var i = 0; i < missingZeros; i++) {
8934 # resultBuilder.push('0');
8935 # }
8936 # resultBuilder.push(hexString);
8937 # return resultBuilder.join('');
8938 # };
8939 #
8940 # // ...
8941 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
8942 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
8943 # the final pixel color is defined by the equation:
8944 #
8945 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
8946 #
8947 # This means that a value of 1.0 corresponds to a solid color, whereas
8948 # a value of 0.0 corresponds to a completely transparent color. This
8949 # uses a wrapper message rather than a simple float scalar so that it is
8950 # possible to distinguish between a default value and the value being unset.
8951 # If omitted, this color object is to be rendered as a solid color
8952 # (as if the alpha value had been explicitly given with a value of 1.0).
8953 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
8954 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
8955 },
8956 "width": 42, # The width of the border, in pixels.
8957 # Border widths must be between 0 and 3 pixels.
8958 "style": "A String", # The style of the border.
8959 },
8960 },
8961 "wrapStrategy": "A String", # The wrap strategy for the value in the cell.
8962 },
8963 "title": "A String", # The title of the spreadsheet.
8964 },
8965 },
8966 "updateCells": { # Updates all cells in a range with new data. # Updates many cells at once.
8967 "fields": "A String", # The fields of CellData that should be updated.
8968 # At least one field must be specified.
8969 # The root is the CellData; 'row.values.' should not be specified.
8970 # A single `"*"` can be used as short-hand for listing every field.
8971 "range": { # A range on a sheet. # The range to write data to.
8972 #
8973 # If the data in rows does not cover the entire requested range,
8974 # the fields matching those set in fields will be cleared.
8975 # All indexes are zero-based.
8976 # Indexes are half open, e.g the start index is inclusive
8977 # and the end index is exclusive -- [start_index, end_index).
8978 # Missing indexes indicate the range is unbounded on that side.
8979 #
8980 # For example, if "Sheet1" is grid ID 0, then:
8981 #
8982 # Sheet1!A1:A1 == sheet_id: 0,
8983 # start_row_index: 0, end_row_index: 1,
8984 # start_column_index: 0, end_column_index: 1
8985 #
8986 # Sheet1!A3:B4 == sheet_id: 0,
8987 # start_row_index: 2, end_row_index: 4,
8988 # start_column_index: 0, end_column_index: 2
8989 #
8990 # Sheet1!A:B == sheet_id: 0,
8991 # start_column_index: 0, end_column_index: 2
8992 #
8993 # Sheet1!A5:B == sheet_id: 0,
8994 # start_row_index: 4,
8995 # start_column_index: 0, end_column_index: 2
8996 #
8997 # Sheet1 == sheet_id:0
8998 #
8999 # The start index must always be less than or equal to the end index.
9000 # If the start index equals the end index, then the range is empty.
9001 # Empty ranges are typically not meaningful and are usually rendered in the
9002 # UI as `#REF!`.
9003 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
9004 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
9005 "sheetId": 42, # The sheet this range is on.
9006 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
9007 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
9008 },
9009 "rows": [ # The data to write.
9010 { # Data about each cell in a row.
9011 "values": [ # The values in the row, one per column.
9012 { # Data about a specific cell.
9013 "pivotTable": { # A pivot table. # A pivot table anchored at this cell. The size of pivot table itself
9014 # is computed dynamically based on its data, grouping, filters, values,
9015 # etc... Only the top-left cell of the pivot table contains the pivot table
9016 # definition. The other cells will contain the calculated values of the
9017 # results of the pivot in their effectiveValue fields.
9018 "valueLayout": "A String", # Whether values should be listed horizontally (as columns)
9019 # or vertically (as rows).
9020 "rows": [ # Each row grouping in the pivot table.
9021 { # A single grouping (either row or column) in a pivot table.
9022 "showTotals": True or False, # True if the pivot table should include the totals for this grouping.
9023 "valueMetadata": [ # Metadata about values in the grouping.
9024 { # Metadata about a value in a pivot grouping.
9025 "collapsed": True or False, # True if the data corresponding to the value is collapsed.
9026 "value": { # The kinds of value that a cell in a spreadsheet can have. # The calculated value the metadata corresponds to.
9027 # (Note that formulaValue is not valid,
9028 # because the values will be calculated.)
9029 "numberValue": 3.14, # Represents a double value.
9030 # Note: Dates, Times and DateTimes are represented as doubles in
9031 # "serial number" format.
9032 "boolValue": True or False, # Represents a boolean value.
9033 "formulaValue": "A String", # Represents a formula.
9034 "stringValue": "A String", # Represents a string value.
9035 # Leading single quotes are not included. For example, if the user typed
9036 # `'123` into the UI, this would be represented as a `stringValue` of
9037 # `"123"`.
9038 "errorValue": { # An error in a cell. # Represents an error.
9039 # This field is read-only.
9040 "message": "A String", # A message with more information about the error
9041 # (in the spreadsheet's locale).
9042 "type": "A String", # The type of error.
9043 },
9044 },
9045 },
9046 ],
9047 "valueBucket": { # Information about which values in a pivot group should be used for sorting. # The bucket of the opposite pivot group to sort by.
9048 # If not specified, sorting is alphabetical by this group's values.
9049 "buckets": [ # Determines the bucket from which values are chosen to sort.
9050 #
9051 # For example, in a pivot table with one row group & two column groups,
9052 # the row group can list up to two values. The first value corresponds
9053 # to a value within the first column group, and the second value
9054 # corresponds to a value in the second column group. If no values
9055 # are listed, this would indicate that the row should be sorted according
9056 # to the "Grand Total" over the column groups. If a single value is listed,
9057 # this would correspond to using the "Total" of that bucket.
9058 { # The kinds of value that a cell in a spreadsheet can have.
9059 "numberValue": 3.14, # Represents a double value.
9060 # Note: Dates, Times and DateTimes are represented as doubles in
9061 # "serial number" format.
9062 "boolValue": True or False, # Represents a boolean value.
9063 "formulaValue": "A String", # Represents a formula.
9064 "stringValue": "A String", # Represents a string value.
9065 # Leading single quotes are not included. For example, if the user typed
9066 # `'123` into the UI, this would be represented as a `stringValue` of
9067 # `"123"`.
9068 "errorValue": { # An error in a cell. # Represents an error.
9069 # This field is read-only.
9070 "message": "A String", # A message with more information about the error
9071 # (in the spreadsheet's locale).
9072 "type": "A String", # The type of error.
9073 },
9074 },
9075 ],
9076 "valuesIndex": 42, # The offset in the [PivotTable.values] list which the values in this
9077 # grouping should be sorted by.
9078 },
9079 "sortOrder": "A String", # The order the values in this group should be sorted.
9080 "sourceColumnOffset": 42, # The column offset of the source range that this grouping is based on.
9081 #
9082 # For example, if the source was `C10:E15', a `sourceColumnOffset` of `0`
9083 # means this group refers to column `C`, whereas the offset `1` would refer
9084 # to column `D`.
9085 },
9086 ],
9087 "source": { # A range on a sheet. # The range the pivot table is reading data from.
9088 # All indexes are zero-based.
9089 # Indexes are half open, e.g the start index is inclusive
9090 # and the end index is exclusive -- [start_index, end_index).
9091 # Missing indexes indicate the range is unbounded on that side.
9092 #
9093 # For example, if "Sheet1" is grid ID 0, then:
9094 #
9095 # Sheet1!A1:A1 == sheet_id: 0,
9096 # start_row_index: 0, end_row_index: 1,
9097 # start_column_index: 0, end_column_index: 1
9098 #
9099 # Sheet1!A3:B4 == sheet_id: 0,
9100 # start_row_index: 2, end_row_index: 4,
9101 # start_column_index: 0, end_column_index: 2
9102 #
9103 # Sheet1!A:B == sheet_id: 0,
9104 # start_column_index: 0, end_column_index: 2
9105 #
9106 # Sheet1!A5:B == sheet_id: 0,
9107 # start_row_index: 4,
9108 # start_column_index: 0, end_column_index: 2
9109 #
9110 # Sheet1 == sheet_id:0
9111 #
9112 # The start index must always be less than or equal to the end index.
9113 # If the start index equals the end index, then the range is empty.
9114 # Empty ranges are typically not meaningful and are usually rendered in the
9115 # UI as `#REF!`.
9116 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
9117 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
9118 "sheetId": 42, # The sheet this range is on.
9119 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
9120 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
9121 },
9122 "values": [ # A list of values to include in the pivot table.
9123 { # The definition of how a value in a pivot table should be calculated.
9124 "formula": "A String", # A custom formula to calculate the value. The formula must start
9125 # with an `=` character.
9126 "summarizeFunction": "A String", # A function to summarize the value.
9127 # If formula is set, the only supported values are
9128 # SUM and
9129 # CUSTOM.
9130 # If sourceColumnOffset is set, then `CUSTOM`
9131 # is not supported.
9132 "sourceColumnOffset": 42, # The column offset of the source range that this value reads from.
9133 #
9134 # For example, if the source was `C10:E15', a `sourceColumnOffset` of `0`
9135 # means this value refers to column `C`, whereas the offset `1` would
9136 # refer to column `D`.
9137 "name": "A String", # A name to use for the value. This is only used if formula was set.
9138 # Otherwise, the column name is used.
9139 },
9140 ],
9141 "criteria": { # An optional mapping of filters per source column offset.
9142 #
9143 # The filters will be applied before aggregating data into the pivot table.
9144 # The map's key is the column offset of the source range that you want to
9145 # filter, and the value is the criteria for that column.
9146 #
9147 # For example, if the source was `C10:E15', a key of `0` will have the filter
9148 # for column `C`, whereas the key `1` is for column `D`.
9149 "a_key": { # Criteria for showing/hiding rows in a pivot table.
9150 "visibleValues": [ # Values that should be included. Values not listed here are excluded.
9151 "A String",
9152 ],
9153 },
9154 },
9155 "columns": [ # Each column grouping in the pivot table.
9156 { # A single grouping (either row or column) in a pivot table.
9157 "showTotals": True or False, # True if the pivot table should include the totals for this grouping.
9158 "valueMetadata": [ # Metadata about values in the grouping.
9159 { # Metadata about a value in a pivot grouping.
9160 "collapsed": True or False, # True if the data corresponding to the value is collapsed.
9161 "value": { # The kinds of value that a cell in a spreadsheet can have. # The calculated value the metadata corresponds to.
9162 # (Note that formulaValue is not valid,
9163 # because the values will be calculated.)
9164 "numberValue": 3.14, # Represents a double value.
9165 # Note: Dates, Times and DateTimes are represented as doubles in
9166 # "serial number" format.
9167 "boolValue": True or False, # Represents a boolean value.
9168 "formulaValue": "A String", # Represents a formula.
9169 "stringValue": "A String", # Represents a string value.
9170 # Leading single quotes are not included. For example, if the user typed
9171 # `'123` into the UI, this would be represented as a `stringValue` of
9172 # `"123"`.
9173 "errorValue": { # An error in a cell. # Represents an error.
9174 # This field is read-only.
9175 "message": "A String", # A message with more information about the error
9176 # (in the spreadsheet's locale).
9177 "type": "A String", # The type of error.
9178 },
9179 },
9180 },
9181 ],
9182 "valueBucket": { # Information about which values in a pivot group should be used for sorting. # The bucket of the opposite pivot group to sort by.
9183 # If not specified, sorting is alphabetical by this group's values.
9184 "buckets": [ # Determines the bucket from which values are chosen to sort.
9185 #
9186 # For example, in a pivot table with one row group & two column groups,
9187 # the row group can list up to two values. The first value corresponds
9188 # to a value within the first column group, and the second value
9189 # corresponds to a value in the second column group. If no values
9190 # are listed, this would indicate that the row should be sorted according
9191 # to the "Grand Total" over the column groups. If a single value is listed,
9192 # this would correspond to using the "Total" of that bucket.
9193 { # The kinds of value that a cell in a spreadsheet can have.
9194 "numberValue": 3.14, # Represents a double value.
9195 # Note: Dates, Times and DateTimes are represented as doubles in
9196 # "serial number" format.
9197 "boolValue": True or False, # Represents a boolean value.
9198 "formulaValue": "A String", # Represents a formula.
9199 "stringValue": "A String", # Represents a string value.
9200 # Leading single quotes are not included. For example, if the user typed
9201 # `'123` into the UI, this would be represented as a `stringValue` of
9202 # `"123"`.
9203 "errorValue": { # An error in a cell. # Represents an error.
9204 # This field is read-only.
9205 "message": "A String", # A message with more information about the error
9206 # (in the spreadsheet's locale).
9207 "type": "A String", # The type of error.
9208 },
9209 },
9210 ],
9211 "valuesIndex": 42, # The offset in the [PivotTable.values] list which the values in this
9212 # grouping should be sorted by.
9213 },
9214 "sortOrder": "A String", # The order the values in this group should be sorted.
9215 "sourceColumnOffset": 42, # The column offset of the source range that this grouping is based on.
9216 #
9217 # For example, if the source was `C10:E15', a `sourceColumnOffset` of `0`
9218 # means this group refers to column `C`, whereas the offset `1` would refer
9219 # to column `D`.
9220 },
9221 ],
9222 },
9223 "hyperlink": "A String", # A hyperlink this cell points to, if any.
9224 # This field is read-only. (To set it, use a `=HYPERLINK` formula.)
9225 "effectiveValue": { # The kinds of value that a cell in a spreadsheet can have. # The effective value of the cell. For cells with formulas, this will be
9226 # the calculated value. For cells with literals, this will be
9227 # the same as the user_entered_value.
9228 # This field is read-only.
9229 "numberValue": 3.14, # Represents a double value.
9230 # Note: Dates, Times and DateTimes are represented as doubles in
9231 # "serial number" format.
9232 "boolValue": True or False, # Represents a boolean value.
9233 "formulaValue": "A String", # Represents a formula.
9234 "stringValue": "A String", # Represents a string value.
9235 # Leading single quotes are not included. For example, if the user typed
9236 # `'123` into the UI, this would be represented as a `stringValue` of
9237 # `"123"`.
9238 "errorValue": { # An error in a cell. # Represents an error.
9239 # This field is read-only.
9240 "message": "A String", # A message with more information about the error
9241 # (in the spreadsheet's locale).
9242 "type": "A String", # The type of error.
9243 },
9244 },
9245 "formattedValue": "A String", # The formatted value of the cell.
9246 # This is the value as it's shown to the user.
9247 # This field is read-only.
9248 "userEnteredValue": { # The kinds of value that a cell in a spreadsheet can have. # The value the user entered in the cell. e.g, `1234`, `'Hello'`, or `=NOW()`
9249 # Note: Dates, Times and DateTimes are represented as doubles in
9250 # serial number format.
9251 "numberValue": 3.14, # Represents a double value.
9252 # Note: Dates, Times and DateTimes are represented as doubles in
9253 # "serial number" format.
9254 "boolValue": True or False, # Represents a boolean value.
9255 "formulaValue": "A String", # Represents a formula.
9256 "stringValue": "A String", # Represents a string value.
9257 # Leading single quotes are not included. For example, if the user typed
9258 # `'123` into the UI, this would be represented as a `stringValue` of
9259 # `"123"`.
9260 "errorValue": { # An error in a cell. # Represents an error.
9261 # This field is read-only.
9262 "message": "A String", # A message with more information about the error
9263 # (in the spreadsheet's locale).
9264 "type": "A String", # The type of error.
9265 },
9266 },
9267 "note": "A String", # Any note on the cell.
9268 "effectiveFormat": { # The format of a cell. # The effective format being used by the cell.
9269 # This includes the results of applying any conditional formatting and,
9270 # if the cell contains a formula, the computed number format.
9271 # If the effective format is the default format, effective format will
9272 # not be written.
9273 # This field is read-only.
9274 "numberFormat": { # The number format of a cell. # A format describing how number values should be represented to the user.
9275 # When updating, all fields must be set.
9276 "pattern": "A String", # Pattern string used for formatting.
9277 "type": "A String", # The type of the number format.
9278 },
9279 "textDirection": "A String", # The direction of the text in the cell.
9280 "padding": { # The amount of padding around the cell, in pixels. # The padding of the cell.
9281 # When updating padding, every field must be specified.
9282 "top": 42, # The top padding of the cell.
9283 "right": 42, # The right padding of the cell.
9284 "bottom": 42, # The bottom padding of the cell.
9285 "left": 42, # The left padding of the cell.
9286 },
9287 "horizontalAlignment": "A String", # The horizontal alignment of the value in cell.
9288 "backgroundColor": { # Represents a color in the RGBA color space. This representation is designed # The background color of the cell.
9289 # for simplicity of conversion to/from color representations in various
9290 # languages over compactness; for example, the fields of this representation
9291 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
9292 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
9293 # method in iOS; and, with just a little work, it can be easily formatted into
9294 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
9295 #
9296 # Example (Java):
9297 #
9298 # import com.google.type.Color;
9299 #
9300 # // ...
9301 # public static java.awt.Color fromProto(Color protocolor) {
9302 # float alpha = protocolor.hasAlpha()
9303 # ? protocolor.getAlpha().getValue()
9304 # : 1.0;
9305 #
9306 # return new java.awt.Color(
9307 # protocolor.getRed(),
9308 # protocolor.getGreen(),
9309 # protocolor.getBlue(),
9310 # alpha);
9311 # }
9312 #
9313 # public static Color toProto(java.awt.Color color) {
9314 # float red = (float) color.getRed();
9315 # float green = (float) color.getGreen();
9316 # float blue = (float) color.getBlue();
9317 # float denominator = 255.0;
9318 # Color.Builder resultBuilder =
9319 # Color
9320 # .newBuilder()
9321 # .setRed(red / denominator)
9322 # .setGreen(green / denominator)
9323 # .setBlue(blue / denominator);
9324 # int alpha = color.getAlpha();
9325 # if (alpha != 255) {
9326 # result.setAlpha(
9327 # FloatValue
9328 # .newBuilder()
9329 # .setValue(((float) alpha) / denominator)
9330 # .build());
9331 # }
9332 # return resultBuilder.build();
9333 # }
9334 # // ...
9335 #
9336 # Example (iOS / Obj-C):
9337 #
9338 # // ...
9339 # static UIColor* fromProto(Color* protocolor) {
9340 # float red = [protocolor red];
9341 # float green = [protocolor green];
9342 # float blue = [protocolor blue];
9343 # FloatValue* alpha_wrapper = [protocolor alpha];
9344 # float alpha = 1.0;
9345 # if (alpha_wrapper != nil) {
9346 # alpha = [alpha_wrapper value];
9347 # }
9348 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
9349 # }
9350 #
9351 # static Color* toProto(UIColor* color) {
9352 # CGFloat red, green, blue, alpha;
9353 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
9354 # return nil;
9355 # }
9356 # Color* result = [Color alloc] init];
9357 # [result setRed:red];
9358 # [result setGreen:green];
9359 # [result setBlue:blue];
9360 # if (alpha <= 0.9999) {
9361 # [result setAlpha:floatWrapperWithValue(alpha)];
9362 # }
9363 # [result autorelease];
9364 # return result;
9365 # }
9366 # // ...
9367 #
9368 # Example (JavaScript):
9369 #
9370 # // ...
9371 #
9372 # var protoToCssColor = function(rgb_color) {
9373 # var redFrac = rgb_color.red || 0.0;
9374 # var greenFrac = rgb_color.green || 0.0;
9375 # var blueFrac = rgb_color.blue || 0.0;
9376 # var red = Math.floor(redFrac * 255);
9377 # var green = Math.floor(greenFrac * 255);
9378 # var blue = Math.floor(blueFrac * 255);
9379 #
9380 # if (!('alpha' in rgb_color)) {
9381 # return rgbToCssColor_(red, green, blue);
9382 # }
9383 #
9384 # var alphaFrac = rgb_color.alpha.value || 0.0;
9385 # var rgbParams = [red, green, blue].join(',');
9386 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
9387 # };
9388 #
9389 # var rgbToCssColor_ = function(red, green, blue) {
9390 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
9391 # var hexString = rgbNumber.toString(16);
9392 # var missingZeros = 6 - hexString.length;
9393 # var resultBuilder = ['#'];
9394 # for (var i = 0; i < missingZeros; i++) {
9395 # resultBuilder.push('0');
9396 # }
9397 # resultBuilder.push(hexString);
9398 # return resultBuilder.join('');
9399 # };
9400 #
9401 # // ...
9402 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
9403 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
9404 # the final pixel color is defined by the equation:
9405 #
9406 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
9407 #
9408 # This means that a value of 1.0 corresponds to a solid color, whereas
9409 # a value of 0.0 corresponds to a completely transparent color. This
9410 # uses a wrapper message rather than a simple float scalar so that it is
9411 # possible to distinguish between a default value and the value being unset.
9412 # If omitted, this color object is to be rendered as a solid color
9413 # (as if the alpha value had been explicitly given with a value of 1.0).
9414 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
9415 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
9416 },
9417 "verticalAlignment": "A String", # The vertical alignment of the value in cell.
9418 "textFormat": { # The format of a run of text in a cell. # The format of the text in the cell (unless overridden by a format run).
9419 # Absent values indicate that the field isn't specified.
9420 "foregroundColor": { # Represents a color in the RGBA color space. This representation is designed # The foreground color of the text.
9421 # for simplicity of conversion to/from color representations in various
9422 # languages over compactness; for example, the fields of this representation
9423 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
9424 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
9425 # method in iOS; and, with just a little work, it can be easily formatted into
9426 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
9427 #
9428 # Example (Java):
9429 #
9430 # import com.google.type.Color;
9431 #
9432 # // ...
9433 # public static java.awt.Color fromProto(Color protocolor) {
9434 # float alpha = protocolor.hasAlpha()
9435 # ? protocolor.getAlpha().getValue()
9436 # : 1.0;
9437 #
9438 # return new java.awt.Color(
9439 # protocolor.getRed(),
9440 # protocolor.getGreen(),
9441 # protocolor.getBlue(),
9442 # alpha);
9443 # }
9444 #
9445 # public static Color toProto(java.awt.Color color) {
9446 # float red = (float) color.getRed();
9447 # float green = (float) color.getGreen();
9448 # float blue = (float) color.getBlue();
9449 # float denominator = 255.0;
9450 # Color.Builder resultBuilder =
9451 # Color
9452 # .newBuilder()
9453 # .setRed(red / denominator)
9454 # .setGreen(green / denominator)
9455 # .setBlue(blue / denominator);
9456 # int alpha = color.getAlpha();
9457 # if (alpha != 255) {
9458 # result.setAlpha(
9459 # FloatValue
9460 # .newBuilder()
9461 # .setValue(((float) alpha) / denominator)
9462 # .build());
9463 # }
9464 # return resultBuilder.build();
9465 # }
9466 # // ...
9467 #
9468 # Example (iOS / Obj-C):
9469 #
9470 # // ...
9471 # static UIColor* fromProto(Color* protocolor) {
9472 # float red = [protocolor red];
9473 # float green = [protocolor green];
9474 # float blue = [protocolor blue];
9475 # FloatValue* alpha_wrapper = [protocolor alpha];
9476 # float alpha = 1.0;
9477 # if (alpha_wrapper != nil) {
9478 # alpha = [alpha_wrapper value];
9479 # }
9480 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
9481 # }
9482 #
9483 # static Color* toProto(UIColor* color) {
9484 # CGFloat red, green, blue, alpha;
9485 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
9486 # return nil;
9487 # }
9488 # Color* result = [Color alloc] init];
9489 # [result setRed:red];
9490 # [result setGreen:green];
9491 # [result setBlue:blue];
9492 # if (alpha <= 0.9999) {
9493 # [result setAlpha:floatWrapperWithValue(alpha)];
9494 # }
9495 # [result autorelease];
9496 # return result;
9497 # }
9498 # // ...
9499 #
9500 # Example (JavaScript):
9501 #
9502 # // ...
9503 #
9504 # var protoToCssColor = function(rgb_color) {
9505 # var redFrac = rgb_color.red || 0.0;
9506 # var greenFrac = rgb_color.green || 0.0;
9507 # var blueFrac = rgb_color.blue || 0.0;
9508 # var red = Math.floor(redFrac * 255);
9509 # var green = Math.floor(greenFrac * 255);
9510 # var blue = Math.floor(blueFrac * 255);
9511 #
9512 # if (!('alpha' in rgb_color)) {
9513 # return rgbToCssColor_(red, green, blue);
9514 # }
9515 #
9516 # var alphaFrac = rgb_color.alpha.value || 0.0;
9517 # var rgbParams = [red, green, blue].join(',');
9518 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
9519 # };
9520 #
9521 # var rgbToCssColor_ = function(red, green, blue) {
9522 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
9523 # var hexString = rgbNumber.toString(16);
9524 # var missingZeros = 6 - hexString.length;
9525 # var resultBuilder = ['#'];
9526 # for (var i = 0; i < missingZeros; i++) {
9527 # resultBuilder.push('0');
9528 # }
9529 # resultBuilder.push(hexString);
9530 # return resultBuilder.join('');
9531 # };
9532 #
9533 # // ...
9534 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
9535 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
9536 # the final pixel color is defined by the equation:
9537 #
9538 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
9539 #
9540 # This means that a value of 1.0 corresponds to a solid color, whereas
9541 # a value of 0.0 corresponds to a completely transparent color. This
9542 # uses a wrapper message rather than a simple float scalar so that it is
9543 # possible to distinguish between a default value and the value being unset.
9544 # If omitted, this color object is to be rendered as a solid color
9545 # (as if the alpha value had been explicitly given with a value of 1.0).
9546 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
9547 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
9548 },
9549 "bold": True or False, # True if the text is bold.
9550 "strikethrough": True or False, # True if the text has a strikethrough.
9551 "fontFamily": "A String", # The font family.
9552 "fontSize": 42, # The size of the font.
9553 "italic": True or False, # True if the text is italicized.
9554 "underline": True or False, # True if the text is underlined.
9555 },
9556 "hyperlinkDisplayType": "A String", # How a hyperlink, if it exists, should be displayed in the cell.
9557 "borders": { # The borders of the cell. # The borders of the cell.
9558 "top": { # A border along a cell. # The top border of the cell.
9559 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
9560 # for simplicity of conversion to/from color representations in various
9561 # languages over compactness; for example, the fields of this representation
9562 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
9563 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
9564 # method in iOS; and, with just a little work, it can be easily formatted into
9565 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
9566 #
9567 # Example (Java):
9568 #
9569 # import com.google.type.Color;
9570 #
9571 # // ...
9572 # public static java.awt.Color fromProto(Color protocolor) {
9573 # float alpha = protocolor.hasAlpha()
9574 # ? protocolor.getAlpha().getValue()
9575 # : 1.0;
9576 #
9577 # return new java.awt.Color(
9578 # protocolor.getRed(),
9579 # protocolor.getGreen(),
9580 # protocolor.getBlue(),
9581 # alpha);
9582 # }
9583 #
9584 # public static Color toProto(java.awt.Color color) {
9585 # float red = (float) color.getRed();
9586 # float green = (float) color.getGreen();
9587 # float blue = (float) color.getBlue();
9588 # float denominator = 255.0;
9589 # Color.Builder resultBuilder =
9590 # Color
9591 # .newBuilder()
9592 # .setRed(red / denominator)
9593 # .setGreen(green / denominator)
9594 # .setBlue(blue / denominator);
9595 # int alpha = color.getAlpha();
9596 # if (alpha != 255) {
9597 # result.setAlpha(
9598 # FloatValue
9599 # .newBuilder()
9600 # .setValue(((float) alpha) / denominator)
9601 # .build());
9602 # }
9603 # return resultBuilder.build();
9604 # }
9605 # // ...
9606 #
9607 # Example (iOS / Obj-C):
9608 #
9609 # // ...
9610 # static UIColor* fromProto(Color* protocolor) {
9611 # float red = [protocolor red];
9612 # float green = [protocolor green];
9613 # float blue = [protocolor blue];
9614 # FloatValue* alpha_wrapper = [protocolor alpha];
9615 # float alpha = 1.0;
9616 # if (alpha_wrapper != nil) {
9617 # alpha = [alpha_wrapper value];
9618 # }
9619 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
9620 # }
9621 #
9622 # static Color* toProto(UIColor* color) {
9623 # CGFloat red, green, blue, alpha;
9624 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
9625 # return nil;
9626 # }
9627 # Color* result = [Color alloc] init];
9628 # [result setRed:red];
9629 # [result setGreen:green];
9630 # [result setBlue:blue];
9631 # if (alpha <= 0.9999) {
9632 # [result setAlpha:floatWrapperWithValue(alpha)];
9633 # }
9634 # [result autorelease];
9635 # return result;
9636 # }
9637 # // ...
9638 #
9639 # Example (JavaScript):
9640 #
9641 # // ...
9642 #
9643 # var protoToCssColor = function(rgb_color) {
9644 # var redFrac = rgb_color.red || 0.0;
9645 # var greenFrac = rgb_color.green || 0.0;
9646 # var blueFrac = rgb_color.blue || 0.0;
9647 # var red = Math.floor(redFrac * 255);
9648 # var green = Math.floor(greenFrac * 255);
9649 # var blue = Math.floor(blueFrac * 255);
9650 #
9651 # if (!('alpha' in rgb_color)) {
9652 # return rgbToCssColor_(red, green, blue);
9653 # }
9654 #
9655 # var alphaFrac = rgb_color.alpha.value || 0.0;
9656 # var rgbParams = [red, green, blue].join(',');
9657 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
9658 # };
9659 #
9660 # var rgbToCssColor_ = function(red, green, blue) {
9661 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
9662 # var hexString = rgbNumber.toString(16);
9663 # var missingZeros = 6 - hexString.length;
9664 # var resultBuilder = ['#'];
9665 # for (var i = 0; i < missingZeros; i++) {
9666 # resultBuilder.push('0');
9667 # }
9668 # resultBuilder.push(hexString);
9669 # return resultBuilder.join('');
9670 # };
9671 #
9672 # // ...
9673 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
9674 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
9675 # the final pixel color is defined by the equation:
9676 #
9677 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
9678 #
9679 # This means that a value of 1.0 corresponds to a solid color, whereas
9680 # a value of 0.0 corresponds to a completely transparent color. This
9681 # uses a wrapper message rather than a simple float scalar so that it is
9682 # possible to distinguish between a default value and the value being unset.
9683 # If omitted, this color object is to be rendered as a solid color
9684 # (as if the alpha value had been explicitly given with a value of 1.0).
9685 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
9686 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
9687 },
9688 "width": 42, # The width of the border, in pixels.
9689 # Border widths must be between 0 and 3 pixels.
9690 "style": "A String", # The style of the border.
9691 },
9692 "right": { # A border along a cell. # The right border of the cell.
9693 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
9694 # for simplicity of conversion to/from color representations in various
9695 # languages over compactness; for example, the fields of this representation
9696 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
9697 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
9698 # method in iOS; and, with just a little work, it can be easily formatted into
9699 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
9700 #
9701 # Example (Java):
9702 #
9703 # import com.google.type.Color;
9704 #
9705 # // ...
9706 # public static java.awt.Color fromProto(Color protocolor) {
9707 # float alpha = protocolor.hasAlpha()
9708 # ? protocolor.getAlpha().getValue()
9709 # : 1.0;
9710 #
9711 # return new java.awt.Color(
9712 # protocolor.getRed(),
9713 # protocolor.getGreen(),
9714 # protocolor.getBlue(),
9715 # alpha);
9716 # }
9717 #
9718 # public static Color toProto(java.awt.Color color) {
9719 # float red = (float) color.getRed();
9720 # float green = (float) color.getGreen();
9721 # float blue = (float) color.getBlue();
9722 # float denominator = 255.0;
9723 # Color.Builder resultBuilder =
9724 # Color
9725 # .newBuilder()
9726 # .setRed(red / denominator)
9727 # .setGreen(green / denominator)
9728 # .setBlue(blue / denominator);
9729 # int alpha = color.getAlpha();
9730 # if (alpha != 255) {
9731 # result.setAlpha(
9732 # FloatValue
9733 # .newBuilder()
9734 # .setValue(((float) alpha) / denominator)
9735 # .build());
9736 # }
9737 # return resultBuilder.build();
9738 # }
9739 # // ...
9740 #
9741 # Example (iOS / Obj-C):
9742 #
9743 # // ...
9744 # static UIColor* fromProto(Color* protocolor) {
9745 # float red = [protocolor red];
9746 # float green = [protocolor green];
9747 # float blue = [protocolor blue];
9748 # FloatValue* alpha_wrapper = [protocolor alpha];
9749 # float alpha = 1.0;
9750 # if (alpha_wrapper != nil) {
9751 # alpha = [alpha_wrapper value];
9752 # }
9753 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
9754 # }
9755 #
9756 # static Color* toProto(UIColor* color) {
9757 # CGFloat red, green, blue, alpha;
9758 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
9759 # return nil;
9760 # }
9761 # Color* result = [Color alloc] init];
9762 # [result setRed:red];
9763 # [result setGreen:green];
9764 # [result setBlue:blue];
9765 # if (alpha <= 0.9999) {
9766 # [result setAlpha:floatWrapperWithValue(alpha)];
9767 # }
9768 # [result autorelease];
9769 # return result;
9770 # }
9771 # // ...
9772 #
9773 # Example (JavaScript):
9774 #
9775 # // ...
9776 #
9777 # var protoToCssColor = function(rgb_color) {
9778 # var redFrac = rgb_color.red || 0.0;
9779 # var greenFrac = rgb_color.green || 0.0;
9780 # var blueFrac = rgb_color.blue || 0.0;
9781 # var red = Math.floor(redFrac * 255);
9782 # var green = Math.floor(greenFrac * 255);
9783 # var blue = Math.floor(blueFrac * 255);
9784 #
9785 # if (!('alpha' in rgb_color)) {
9786 # return rgbToCssColor_(red, green, blue);
9787 # }
9788 #
9789 # var alphaFrac = rgb_color.alpha.value || 0.0;
9790 # var rgbParams = [red, green, blue].join(',');
9791 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
9792 # };
9793 #
9794 # var rgbToCssColor_ = function(red, green, blue) {
9795 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
9796 # var hexString = rgbNumber.toString(16);
9797 # var missingZeros = 6 - hexString.length;
9798 # var resultBuilder = ['#'];
9799 # for (var i = 0; i < missingZeros; i++) {
9800 # resultBuilder.push('0');
9801 # }
9802 # resultBuilder.push(hexString);
9803 # return resultBuilder.join('');
9804 # };
9805 #
9806 # // ...
9807 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
9808 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
9809 # the final pixel color is defined by the equation:
9810 #
9811 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
9812 #
9813 # This means that a value of 1.0 corresponds to a solid color, whereas
9814 # a value of 0.0 corresponds to a completely transparent color. This
9815 # uses a wrapper message rather than a simple float scalar so that it is
9816 # possible to distinguish between a default value and the value being unset.
9817 # If omitted, this color object is to be rendered as a solid color
9818 # (as if the alpha value had been explicitly given with a value of 1.0).
9819 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
9820 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
9821 },
9822 "width": 42, # The width of the border, in pixels.
9823 # Border widths must be between 0 and 3 pixels.
9824 "style": "A String", # The style of the border.
9825 },
9826 "bottom": { # A border along a cell. # The bottom border of the cell.
9827 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
9828 # for simplicity of conversion to/from color representations in various
9829 # languages over compactness; for example, the fields of this representation
9830 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
9831 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
9832 # method in iOS; and, with just a little work, it can be easily formatted into
9833 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
9834 #
9835 # Example (Java):
9836 #
9837 # import com.google.type.Color;
9838 #
9839 # // ...
9840 # public static java.awt.Color fromProto(Color protocolor) {
9841 # float alpha = protocolor.hasAlpha()
9842 # ? protocolor.getAlpha().getValue()
9843 # : 1.0;
9844 #
9845 # return new java.awt.Color(
9846 # protocolor.getRed(),
9847 # protocolor.getGreen(),
9848 # protocolor.getBlue(),
9849 # alpha);
9850 # }
9851 #
9852 # public static Color toProto(java.awt.Color color) {
9853 # float red = (float) color.getRed();
9854 # float green = (float) color.getGreen();
9855 # float blue = (float) color.getBlue();
9856 # float denominator = 255.0;
9857 # Color.Builder resultBuilder =
9858 # Color
9859 # .newBuilder()
9860 # .setRed(red / denominator)
9861 # .setGreen(green / denominator)
9862 # .setBlue(blue / denominator);
9863 # int alpha = color.getAlpha();
9864 # if (alpha != 255) {
9865 # result.setAlpha(
9866 # FloatValue
9867 # .newBuilder()
9868 # .setValue(((float) alpha) / denominator)
9869 # .build());
9870 # }
9871 # return resultBuilder.build();
9872 # }
9873 # // ...
9874 #
9875 # Example (iOS / Obj-C):
9876 #
9877 # // ...
9878 # static UIColor* fromProto(Color* protocolor) {
9879 # float red = [protocolor red];
9880 # float green = [protocolor green];
9881 # float blue = [protocolor blue];
9882 # FloatValue* alpha_wrapper = [protocolor alpha];
9883 # float alpha = 1.0;
9884 # if (alpha_wrapper != nil) {
9885 # alpha = [alpha_wrapper value];
9886 # }
9887 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
9888 # }
9889 #
9890 # static Color* toProto(UIColor* color) {
9891 # CGFloat red, green, blue, alpha;
9892 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
9893 # return nil;
9894 # }
9895 # Color* result = [Color alloc] init];
9896 # [result setRed:red];
9897 # [result setGreen:green];
9898 # [result setBlue:blue];
9899 # if (alpha <= 0.9999) {
9900 # [result setAlpha:floatWrapperWithValue(alpha)];
9901 # }
9902 # [result autorelease];
9903 # return result;
9904 # }
9905 # // ...
9906 #
9907 # Example (JavaScript):
9908 #
9909 # // ...
9910 #
9911 # var protoToCssColor = function(rgb_color) {
9912 # var redFrac = rgb_color.red || 0.0;
9913 # var greenFrac = rgb_color.green || 0.0;
9914 # var blueFrac = rgb_color.blue || 0.0;
9915 # var red = Math.floor(redFrac * 255);
9916 # var green = Math.floor(greenFrac * 255);
9917 # var blue = Math.floor(blueFrac * 255);
9918 #
9919 # if (!('alpha' in rgb_color)) {
9920 # return rgbToCssColor_(red, green, blue);
9921 # }
9922 #
9923 # var alphaFrac = rgb_color.alpha.value || 0.0;
9924 # var rgbParams = [red, green, blue].join(',');
9925 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
9926 # };
9927 #
9928 # var rgbToCssColor_ = function(red, green, blue) {
9929 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
9930 # var hexString = rgbNumber.toString(16);
9931 # var missingZeros = 6 - hexString.length;
9932 # var resultBuilder = ['#'];
9933 # for (var i = 0; i < missingZeros; i++) {
9934 # resultBuilder.push('0');
9935 # }
9936 # resultBuilder.push(hexString);
9937 # return resultBuilder.join('');
9938 # };
9939 #
9940 # // ...
9941 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
9942 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
9943 # the final pixel color is defined by the equation:
9944 #
9945 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
9946 #
9947 # This means that a value of 1.0 corresponds to a solid color, whereas
9948 # a value of 0.0 corresponds to a completely transparent color. This
9949 # uses a wrapper message rather than a simple float scalar so that it is
9950 # possible to distinguish between a default value and the value being unset.
9951 # If omitted, this color object is to be rendered as a solid color
9952 # (as if the alpha value had been explicitly given with a value of 1.0).
9953 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
9954 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
9955 },
9956 "width": 42, # The width of the border, in pixels.
9957 # Border widths must be between 0 and 3 pixels.
9958 "style": "A String", # The style of the border.
9959 },
9960 "left": { # A border along a cell. # The left border of the cell.
9961 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
9962 # for simplicity of conversion to/from color representations in various
9963 # languages over compactness; for example, the fields of this representation
9964 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
9965 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
9966 # method in iOS; and, with just a little work, it can be easily formatted into
9967 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
9968 #
9969 # Example (Java):
9970 #
9971 # import com.google.type.Color;
9972 #
9973 # // ...
9974 # public static java.awt.Color fromProto(Color protocolor) {
9975 # float alpha = protocolor.hasAlpha()
9976 # ? protocolor.getAlpha().getValue()
9977 # : 1.0;
9978 #
9979 # return new java.awt.Color(
9980 # protocolor.getRed(),
9981 # protocolor.getGreen(),
9982 # protocolor.getBlue(),
9983 # alpha);
9984 # }
9985 #
9986 # public static Color toProto(java.awt.Color color) {
9987 # float red = (float) color.getRed();
9988 # float green = (float) color.getGreen();
9989 # float blue = (float) color.getBlue();
9990 # float denominator = 255.0;
9991 # Color.Builder resultBuilder =
9992 # Color
9993 # .newBuilder()
9994 # .setRed(red / denominator)
9995 # .setGreen(green / denominator)
9996 # .setBlue(blue / denominator);
9997 # int alpha = color.getAlpha();
9998 # if (alpha != 255) {
9999 # result.setAlpha(
10000 # FloatValue
10001 # .newBuilder()
10002 # .setValue(((float) alpha) / denominator)
10003 # .build());
10004 # }
10005 # return resultBuilder.build();
10006 # }
10007 # // ...
10008 #
10009 # Example (iOS / Obj-C):
10010 #
10011 # // ...
10012 # static UIColor* fromProto(Color* protocolor) {
10013 # float red = [protocolor red];
10014 # float green = [protocolor green];
10015 # float blue = [protocolor blue];
10016 # FloatValue* alpha_wrapper = [protocolor alpha];
10017 # float alpha = 1.0;
10018 # if (alpha_wrapper != nil) {
10019 # alpha = [alpha_wrapper value];
10020 # }
10021 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
10022 # }
10023 #
10024 # static Color* toProto(UIColor* color) {
10025 # CGFloat red, green, blue, alpha;
10026 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
10027 # return nil;
10028 # }
10029 # Color* result = [Color alloc] init];
10030 # [result setRed:red];
10031 # [result setGreen:green];
10032 # [result setBlue:blue];
10033 # if (alpha <= 0.9999) {
10034 # [result setAlpha:floatWrapperWithValue(alpha)];
10035 # }
10036 # [result autorelease];
10037 # return result;
10038 # }
10039 # // ...
10040 #
10041 # Example (JavaScript):
10042 #
10043 # // ...
10044 #
10045 # var protoToCssColor = function(rgb_color) {
10046 # var redFrac = rgb_color.red || 0.0;
10047 # var greenFrac = rgb_color.green || 0.0;
10048 # var blueFrac = rgb_color.blue || 0.0;
10049 # var red = Math.floor(redFrac * 255);
10050 # var green = Math.floor(greenFrac * 255);
10051 # var blue = Math.floor(blueFrac * 255);
10052 #
10053 # if (!('alpha' in rgb_color)) {
10054 # return rgbToCssColor_(red, green, blue);
10055 # }
10056 #
10057 # var alphaFrac = rgb_color.alpha.value || 0.0;
10058 # var rgbParams = [red, green, blue].join(',');
10059 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
10060 # };
10061 #
10062 # var rgbToCssColor_ = function(red, green, blue) {
10063 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
10064 # var hexString = rgbNumber.toString(16);
10065 # var missingZeros = 6 - hexString.length;
10066 # var resultBuilder = ['#'];
10067 # for (var i = 0; i < missingZeros; i++) {
10068 # resultBuilder.push('0');
10069 # }
10070 # resultBuilder.push(hexString);
10071 # return resultBuilder.join('');
10072 # };
10073 #
10074 # // ...
10075 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
10076 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
10077 # the final pixel color is defined by the equation:
10078 #
10079 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
10080 #
10081 # This means that a value of 1.0 corresponds to a solid color, whereas
10082 # a value of 0.0 corresponds to a completely transparent color. This
10083 # uses a wrapper message rather than a simple float scalar so that it is
10084 # possible to distinguish between a default value and the value being unset.
10085 # If omitted, this color object is to be rendered as a solid color
10086 # (as if the alpha value had been explicitly given with a value of 1.0).
10087 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
10088 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
10089 },
10090 "width": 42, # The width of the border, in pixels.
10091 # Border widths must be between 0 and 3 pixels.
10092 "style": "A String", # The style of the border.
10093 },
10094 },
10095 "wrapStrategy": "A String", # The wrap strategy for the value in the cell.
10096 },
10097 "userEnteredFormat": { # The format of a cell. # The format the user entered for the cell.
10098 #
10099 # When writing, the new format will be merged with the existing format.
10100 "numberFormat": { # The number format of a cell. # A format describing how number values should be represented to the user.
10101 # When updating, all fields must be set.
10102 "pattern": "A String", # Pattern string used for formatting.
10103 "type": "A String", # The type of the number format.
10104 },
10105 "textDirection": "A String", # The direction of the text in the cell.
10106 "padding": { # The amount of padding around the cell, in pixels. # The padding of the cell.
10107 # When updating padding, every field must be specified.
10108 "top": 42, # The top padding of the cell.
10109 "right": 42, # The right padding of the cell.
10110 "bottom": 42, # The bottom padding of the cell.
10111 "left": 42, # The left padding of the cell.
10112 },
10113 "horizontalAlignment": "A String", # The horizontal alignment of the value in cell.
10114 "backgroundColor": { # Represents a color in the RGBA color space. This representation is designed # The background color of the cell.
10115 # for simplicity of conversion to/from color representations in various
10116 # languages over compactness; for example, the fields of this representation
10117 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
10118 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
10119 # method in iOS; and, with just a little work, it can be easily formatted into
10120 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
10121 #
10122 # Example (Java):
10123 #
10124 # import com.google.type.Color;
10125 #
10126 # // ...
10127 # public static java.awt.Color fromProto(Color protocolor) {
10128 # float alpha = protocolor.hasAlpha()
10129 # ? protocolor.getAlpha().getValue()
10130 # : 1.0;
10131 #
10132 # return new java.awt.Color(
10133 # protocolor.getRed(),
10134 # protocolor.getGreen(),
10135 # protocolor.getBlue(),
10136 # alpha);
10137 # }
10138 #
10139 # public static Color toProto(java.awt.Color color) {
10140 # float red = (float) color.getRed();
10141 # float green = (float) color.getGreen();
10142 # float blue = (float) color.getBlue();
10143 # float denominator = 255.0;
10144 # Color.Builder resultBuilder =
10145 # Color
10146 # .newBuilder()
10147 # .setRed(red / denominator)
10148 # .setGreen(green / denominator)
10149 # .setBlue(blue / denominator);
10150 # int alpha = color.getAlpha();
10151 # if (alpha != 255) {
10152 # result.setAlpha(
10153 # FloatValue
10154 # .newBuilder()
10155 # .setValue(((float) alpha) / denominator)
10156 # .build());
10157 # }
10158 # return resultBuilder.build();
10159 # }
10160 # // ...
10161 #
10162 # Example (iOS / Obj-C):
10163 #
10164 # // ...
10165 # static UIColor* fromProto(Color* protocolor) {
10166 # float red = [protocolor red];
10167 # float green = [protocolor green];
10168 # float blue = [protocolor blue];
10169 # FloatValue* alpha_wrapper = [protocolor alpha];
10170 # float alpha = 1.0;
10171 # if (alpha_wrapper != nil) {
10172 # alpha = [alpha_wrapper value];
10173 # }
10174 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
10175 # }
10176 #
10177 # static Color* toProto(UIColor* color) {
10178 # CGFloat red, green, blue, alpha;
10179 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
10180 # return nil;
10181 # }
10182 # Color* result = [Color alloc] init];
10183 # [result setRed:red];
10184 # [result setGreen:green];
10185 # [result setBlue:blue];
10186 # if (alpha <= 0.9999) {
10187 # [result setAlpha:floatWrapperWithValue(alpha)];
10188 # }
10189 # [result autorelease];
10190 # return result;
10191 # }
10192 # // ...
10193 #
10194 # Example (JavaScript):
10195 #
10196 # // ...
10197 #
10198 # var protoToCssColor = function(rgb_color) {
10199 # var redFrac = rgb_color.red || 0.0;
10200 # var greenFrac = rgb_color.green || 0.0;
10201 # var blueFrac = rgb_color.blue || 0.0;
10202 # var red = Math.floor(redFrac * 255);
10203 # var green = Math.floor(greenFrac * 255);
10204 # var blue = Math.floor(blueFrac * 255);
10205 #
10206 # if (!('alpha' in rgb_color)) {
10207 # return rgbToCssColor_(red, green, blue);
10208 # }
10209 #
10210 # var alphaFrac = rgb_color.alpha.value || 0.0;
10211 # var rgbParams = [red, green, blue].join(',');
10212 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
10213 # };
10214 #
10215 # var rgbToCssColor_ = function(red, green, blue) {
10216 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
10217 # var hexString = rgbNumber.toString(16);
10218 # var missingZeros = 6 - hexString.length;
10219 # var resultBuilder = ['#'];
10220 # for (var i = 0; i < missingZeros; i++) {
10221 # resultBuilder.push('0');
10222 # }
10223 # resultBuilder.push(hexString);
10224 # return resultBuilder.join('');
10225 # };
10226 #
10227 # // ...
10228 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
10229 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
10230 # the final pixel color is defined by the equation:
10231 #
10232 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
10233 #
10234 # This means that a value of 1.0 corresponds to a solid color, whereas
10235 # a value of 0.0 corresponds to a completely transparent color. This
10236 # uses a wrapper message rather than a simple float scalar so that it is
10237 # possible to distinguish between a default value and the value being unset.
10238 # If omitted, this color object is to be rendered as a solid color
10239 # (as if the alpha value had been explicitly given with a value of 1.0).
10240 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
10241 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
10242 },
10243 "verticalAlignment": "A String", # The vertical alignment of the value in cell.
10244 "textFormat": { # The format of a run of text in a cell. # The format of the text in the cell (unless overridden by a format run).
10245 # Absent values indicate that the field isn't specified.
10246 "foregroundColor": { # Represents a color in the RGBA color space. This representation is designed # The foreground color of the text.
10247 # for simplicity of conversion to/from color representations in various
10248 # languages over compactness; for example, the fields of this representation
10249 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
10250 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
10251 # method in iOS; and, with just a little work, it can be easily formatted into
10252 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
10253 #
10254 # Example (Java):
10255 #
10256 # import com.google.type.Color;
10257 #
10258 # // ...
10259 # public static java.awt.Color fromProto(Color protocolor) {
10260 # float alpha = protocolor.hasAlpha()
10261 # ? protocolor.getAlpha().getValue()
10262 # : 1.0;
10263 #
10264 # return new java.awt.Color(
10265 # protocolor.getRed(),
10266 # protocolor.getGreen(),
10267 # protocolor.getBlue(),
10268 # alpha);
10269 # }
10270 #
10271 # public static Color toProto(java.awt.Color color) {
10272 # float red = (float) color.getRed();
10273 # float green = (float) color.getGreen();
10274 # float blue = (float) color.getBlue();
10275 # float denominator = 255.0;
10276 # Color.Builder resultBuilder =
10277 # Color
10278 # .newBuilder()
10279 # .setRed(red / denominator)
10280 # .setGreen(green / denominator)
10281 # .setBlue(blue / denominator);
10282 # int alpha = color.getAlpha();
10283 # if (alpha != 255) {
10284 # result.setAlpha(
10285 # FloatValue
10286 # .newBuilder()
10287 # .setValue(((float) alpha) / denominator)
10288 # .build());
10289 # }
10290 # return resultBuilder.build();
10291 # }
10292 # // ...
10293 #
10294 # Example (iOS / Obj-C):
10295 #
10296 # // ...
10297 # static UIColor* fromProto(Color* protocolor) {
10298 # float red = [protocolor red];
10299 # float green = [protocolor green];
10300 # float blue = [protocolor blue];
10301 # FloatValue* alpha_wrapper = [protocolor alpha];
10302 # float alpha = 1.0;
10303 # if (alpha_wrapper != nil) {
10304 # alpha = [alpha_wrapper value];
10305 # }
10306 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
10307 # }
10308 #
10309 # static Color* toProto(UIColor* color) {
10310 # CGFloat red, green, blue, alpha;
10311 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
10312 # return nil;
10313 # }
10314 # Color* result = [Color alloc] init];
10315 # [result setRed:red];
10316 # [result setGreen:green];
10317 # [result setBlue:blue];
10318 # if (alpha <= 0.9999) {
10319 # [result setAlpha:floatWrapperWithValue(alpha)];
10320 # }
10321 # [result autorelease];
10322 # return result;
10323 # }
10324 # // ...
10325 #
10326 # Example (JavaScript):
10327 #
10328 # // ...
10329 #
10330 # var protoToCssColor = function(rgb_color) {
10331 # var redFrac = rgb_color.red || 0.0;
10332 # var greenFrac = rgb_color.green || 0.0;
10333 # var blueFrac = rgb_color.blue || 0.0;
10334 # var red = Math.floor(redFrac * 255);
10335 # var green = Math.floor(greenFrac * 255);
10336 # var blue = Math.floor(blueFrac * 255);
10337 #
10338 # if (!('alpha' in rgb_color)) {
10339 # return rgbToCssColor_(red, green, blue);
10340 # }
10341 #
10342 # var alphaFrac = rgb_color.alpha.value || 0.0;
10343 # var rgbParams = [red, green, blue].join(',');
10344 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
10345 # };
10346 #
10347 # var rgbToCssColor_ = function(red, green, blue) {
10348 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
10349 # var hexString = rgbNumber.toString(16);
10350 # var missingZeros = 6 - hexString.length;
10351 # var resultBuilder = ['#'];
10352 # for (var i = 0; i < missingZeros; i++) {
10353 # resultBuilder.push('0');
10354 # }
10355 # resultBuilder.push(hexString);
10356 # return resultBuilder.join('');
10357 # };
10358 #
10359 # // ...
10360 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
10361 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
10362 # the final pixel color is defined by the equation:
10363 #
10364 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
10365 #
10366 # This means that a value of 1.0 corresponds to a solid color, whereas
10367 # a value of 0.0 corresponds to a completely transparent color. This
10368 # uses a wrapper message rather than a simple float scalar so that it is
10369 # possible to distinguish between a default value and the value being unset.
10370 # If omitted, this color object is to be rendered as a solid color
10371 # (as if the alpha value had been explicitly given with a value of 1.0).
10372 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
10373 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
10374 },
10375 "bold": True or False, # True if the text is bold.
10376 "strikethrough": True or False, # True if the text has a strikethrough.
10377 "fontFamily": "A String", # The font family.
10378 "fontSize": 42, # The size of the font.
10379 "italic": True or False, # True if the text is italicized.
10380 "underline": True or False, # True if the text is underlined.
10381 },
10382 "hyperlinkDisplayType": "A String", # How a hyperlink, if it exists, should be displayed in the cell.
10383 "borders": { # The borders of the cell. # The borders of the cell.
10384 "top": { # A border along a cell. # The top border of the cell.
10385 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
10386 # for simplicity of conversion to/from color representations in various
10387 # languages over compactness; for example, the fields of this representation
10388 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
10389 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
10390 # method in iOS; and, with just a little work, it can be easily formatted into
10391 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
10392 #
10393 # Example (Java):
10394 #
10395 # import com.google.type.Color;
10396 #
10397 # // ...
10398 # public static java.awt.Color fromProto(Color protocolor) {
10399 # float alpha = protocolor.hasAlpha()
10400 # ? protocolor.getAlpha().getValue()
10401 # : 1.0;
10402 #
10403 # return new java.awt.Color(
10404 # protocolor.getRed(),
10405 # protocolor.getGreen(),
10406 # protocolor.getBlue(),
10407 # alpha);
10408 # }
10409 #
10410 # public static Color toProto(java.awt.Color color) {
10411 # float red = (float) color.getRed();
10412 # float green = (float) color.getGreen();
10413 # float blue = (float) color.getBlue();
10414 # float denominator = 255.0;
10415 # Color.Builder resultBuilder =
10416 # Color
10417 # .newBuilder()
10418 # .setRed(red / denominator)
10419 # .setGreen(green / denominator)
10420 # .setBlue(blue / denominator);
10421 # int alpha = color.getAlpha();
10422 # if (alpha != 255) {
10423 # result.setAlpha(
10424 # FloatValue
10425 # .newBuilder()
10426 # .setValue(((float) alpha) / denominator)
10427 # .build());
10428 # }
10429 # return resultBuilder.build();
10430 # }
10431 # // ...
10432 #
10433 # Example (iOS / Obj-C):
10434 #
10435 # // ...
10436 # static UIColor* fromProto(Color* protocolor) {
10437 # float red = [protocolor red];
10438 # float green = [protocolor green];
10439 # float blue = [protocolor blue];
10440 # FloatValue* alpha_wrapper = [protocolor alpha];
10441 # float alpha = 1.0;
10442 # if (alpha_wrapper != nil) {
10443 # alpha = [alpha_wrapper value];
10444 # }
10445 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
10446 # }
10447 #
10448 # static Color* toProto(UIColor* color) {
10449 # CGFloat red, green, blue, alpha;
10450 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
10451 # return nil;
10452 # }
10453 # Color* result = [Color alloc] init];
10454 # [result setRed:red];
10455 # [result setGreen:green];
10456 # [result setBlue:blue];
10457 # if (alpha <= 0.9999) {
10458 # [result setAlpha:floatWrapperWithValue(alpha)];
10459 # }
10460 # [result autorelease];
10461 # return result;
10462 # }
10463 # // ...
10464 #
10465 # Example (JavaScript):
10466 #
10467 # // ...
10468 #
10469 # var protoToCssColor = function(rgb_color) {
10470 # var redFrac = rgb_color.red || 0.0;
10471 # var greenFrac = rgb_color.green || 0.0;
10472 # var blueFrac = rgb_color.blue || 0.0;
10473 # var red = Math.floor(redFrac * 255);
10474 # var green = Math.floor(greenFrac * 255);
10475 # var blue = Math.floor(blueFrac * 255);
10476 #
10477 # if (!('alpha' in rgb_color)) {
10478 # return rgbToCssColor_(red, green, blue);
10479 # }
10480 #
10481 # var alphaFrac = rgb_color.alpha.value || 0.0;
10482 # var rgbParams = [red, green, blue].join(',');
10483 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
10484 # };
10485 #
10486 # var rgbToCssColor_ = function(red, green, blue) {
10487 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
10488 # var hexString = rgbNumber.toString(16);
10489 # var missingZeros = 6 - hexString.length;
10490 # var resultBuilder = ['#'];
10491 # for (var i = 0; i < missingZeros; i++) {
10492 # resultBuilder.push('0');
10493 # }
10494 # resultBuilder.push(hexString);
10495 # return resultBuilder.join('');
10496 # };
10497 #
10498 # // ...
10499 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
10500 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
10501 # the final pixel color is defined by the equation:
10502 #
10503 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
10504 #
10505 # This means that a value of 1.0 corresponds to a solid color, whereas
10506 # a value of 0.0 corresponds to a completely transparent color. This
10507 # uses a wrapper message rather than a simple float scalar so that it is
10508 # possible to distinguish between a default value and the value being unset.
10509 # If omitted, this color object is to be rendered as a solid color
10510 # (as if the alpha value had been explicitly given with a value of 1.0).
10511 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
10512 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
10513 },
10514 "width": 42, # The width of the border, in pixels.
10515 # Border widths must be between 0 and 3 pixels.
10516 "style": "A String", # The style of the border.
10517 },
10518 "right": { # A border along a cell. # The right border of the cell.
10519 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
10520 # for simplicity of conversion to/from color representations in various
10521 # languages over compactness; for example, the fields of this representation
10522 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
10523 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
10524 # method in iOS; and, with just a little work, it can be easily formatted into
10525 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
10526 #
10527 # Example (Java):
10528 #
10529 # import com.google.type.Color;
10530 #
10531 # // ...
10532 # public static java.awt.Color fromProto(Color protocolor) {
10533 # float alpha = protocolor.hasAlpha()
10534 # ? protocolor.getAlpha().getValue()
10535 # : 1.0;
10536 #
10537 # return new java.awt.Color(
10538 # protocolor.getRed(),
10539 # protocolor.getGreen(),
10540 # protocolor.getBlue(),
10541 # alpha);
10542 # }
10543 #
10544 # public static Color toProto(java.awt.Color color) {
10545 # float red = (float) color.getRed();
10546 # float green = (float) color.getGreen();
10547 # float blue = (float) color.getBlue();
10548 # float denominator = 255.0;
10549 # Color.Builder resultBuilder =
10550 # Color
10551 # .newBuilder()
10552 # .setRed(red / denominator)
10553 # .setGreen(green / denominator)
10554 # .setBlue(blue / denominator);
10555 # int alpha = color.getAlpha();
10556 # if (alpha != 255) {
10557 # result.setAlpha(
10558 # FloatValue
10559 # .newBuilder()
10560 # .setValue(((float) alpha) / denominator)
10561 # .build());
10562 # }
10563 # return resultBuilder.build();
10564 # }
10565 # // ...
10566 #
10567 # Example (iOS / Obj-C):
10568 #
10569 # // ...
10570 # static UIColor* fromProto(Color* protocolor) {
10571 # float red = [protocolor red];
10572 # float green = [protocolor green];
10573 # float blue = [protocolor blue];
10574 # FloatValue* alpha_wrapper = [protocolor alpha];
10575 # float alpha = 1.0;
10576 # if (alpha_wrapper != nil) {
10577 # alpha = [alpha_wrapper value];
10578 # }
10579 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
10580 # }
10581 #
10582 # static Color* toProto(UIColor* color) {
10583 # CGFloat red, green, blue, alpha;
10584 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
10585 # return nil;
10586 # }
10587 # Color* result = [Color alloc] init];
10588 # [result setRed:red];
10589 # [result setGreen:green];
10590 # [result setBlue:blue];
10591 # if (alpha <= 0.9999) {
10592 # [result setAlpha:floatWrapperWithValue(alpha)];
10593 # }
10594 # [result autorelease];
10595 # return result;
10596 # }
10597 # // ...
10598 #
10599 # Example (JavaScript):
10600 #
10601 # // ...
10602 #
10603 # var protoToCssColor = function(rgb_color) {
10604 # var redFrac = rgb_color.red || 0.0;
10605 # var greenFrac = rgb_color.green || 0.0;
10606 # var blueFrac = rgb_color.blue || 0.0;
10607 # var red = Math.floor(redFrac * 255);
10608 # var green = Math.floor(greenFrac * 255);
10609 # var blue = Math.floor(blueFrac * 255);
10610 #
10611 # if (!('alpha' in rgb_color)) {
10612 # return rgbToCssColor_(red, green, blue);
10613 # }
10614 #
10615 # var alphaFrac = rgb_color.alpha.value || 0.0;
10616 # var rgbParams = [red, green, blue].join(',');
10617 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
10618 # };
10619 #
10620 # var rgbToCssColor_ = function(red, green, blue) {
10621 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
10622 # var hexString = rgbNumber.toString(16);
10623 # var missingZeros = 6 - hexString.length;
10624 # var resultBuilder = ['#'];
10625 # for (var i = 0; i < missingZeros; i++) {
10626 # resultBuilder.push('0');
10627 # }
10628 # resultBuilder.push(hexString);
10629 # return resultBuilder.join('');
10630 # };
10631 #
10632 # // ...
10633 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
10634 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
10635 # the final pixel color is defined by the equation:
10636 #
10637 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
10638 #
10639 # This means that a value of 1.0 corresponds to a solid color, whereas
10640 # a value of 0.0 corresponds to a completely transparent color. This
10641 # uses a wrapper message rather than a simple float scalar so that it is
10642 # possible to distinguish between a default value and the value being unset.
10643 # If omitted, this color object is to be rendered as a solid color
10644 # (as if the alpha value had been explicitly given with a value of 1.0).
10645 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
10646 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
10647 },
10648 "width": 42, # The width of the border, in pixels.
10649 # Border widths must be between 0 and 3 pixels.
10650 "style": "A String", # The style of the border.
10651 },
10652 "bottom": { # A border along a cell. # The bottom border of the cell.
10653 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
10654 # for simplicity of conversion to/from color representations in various
10655 # languages over compactness; for example, the fields of this representation
10656 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
10657 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
10658 # method in iOS; and, with just a little work, it can be easily formatted into
10659 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
10660 #
10661 # Example (Java):
10662 #
10663 # import com.google.type.Color;
10664 #
10665 # // ...
10666 # public static java.awt.Color fromProto(Color protocolor) {
10667 # float alpha = protocolor.hasAlpha()
10668 # ? protocolor.getAlpha().getValue()
10669 # : 1.0;
10670 #
10671 # return new java.awt.Color(
10672 # protocolor.getRed(),
10673 # protocolor.getGreen(),
10674 # protocolor.getBlue(),
10675 # alpha);
10676 # }
10677 #
10678 # public static Color toProto(java.awt.Color color) {
10679 # float red = (float) color.getRed();
10680 # float green = (float) color.getGreen();
10681 # float blue = (float) color.getBlue();
10682 # float denominator = 255.0;
10683 # Color.Builder resultBuilder =
10684 # Color
10685 # .newBuilder()
10686 # .setRed(red / denominator)
10687 # .setGreen(green / denominator)
10688 # .setBlue(blue / denominator);
10689 # int alpha = color.getAlpha();
10690 # if (alpha != 255) {
10691 # result.setAlpha(
10692 # FloatValue
10693 # .newBuilder()
10694 # .setValue(((float) alpha) / denominator)
10695 # .build());
10696 # }
10697 # return resultBuilder.build();
10698 # }
10699 # // ...
10700 #
10701 # Example (iOS / Obj-C):
10702 #
10703 # // ...
10704 # static UIColor* fromProto(Color* protocolor) {
10705 # float red = [protocolor red];
10706 # float green = [protocolor green];
10707 # float blue = [protocolor blue];
10708 # FloatValue* alpha_wrapper = [protocolor alpha];
10709 # float alpha = 1.0;
10710 # if (alpha_wrapper != nil) {
10711 # alpha = [alpha_wrapper value];
10712 # }
10713 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
10714 # }
10715 #
10716 # static Color* toProto(UIColor* color) {
10717 # CGFloat red, green, blue, alpha;
10718 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
10719 # return nil;
10720 # }
10721 # Color* result = [Color alloc] init];
10722 # [result setRed:red];
10723 # [result setGreen:green];
10724 # [result setBlue:blue];
10725 # if (alpha <= 0.9999) {
10726 # [result setAlpha:floatWrapperWithValue(alpha)];
10727 # }
10728 # [result autorelease];
10729 # return result;
10730 # }
10731 # // ...
10732 #
10733 # Example (JavaScript):
10734 #
10735 # // ...
10736 #
10737 # var protoToCssColor = function(rgb_color) {
10738 # var redFrac = rgb_color.red || 0.0;
10739 # var greenFrac = rgb_color.green || 0.0;
10740 # var blueFrac = rgb_color.blue || 0.0;
10741 # var red = Math.floor(redFrac * 255);
10742 # var green = Math.floor(greenFrac * 255);
10743 # var blue = Math.floor(blueFrac * 255);
10744 #
10745 # if (!('alpha' in rgb_color)) {
10746 # return rgbToCssColor_(red, green, blue);
10747 # }
10748 #
10749 # var alphaFrac = rgb_color.alpha.value || 0.0;
10750 # var rgbParams = [red, green, blue].join(',');
10751 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
10752 # };
10753 #
10754 # var rgbToCssColor_ = function(red, green, blue) {
10755 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
10756 # var hexString = rgbNumber.toString(16);
10757 # var missingZeros = 6 - hexString.length;
10758 # var resultBuilder = ['#'];
10759 # for (var i = 0; i < missingZeros; i++) {
10760 # resultBuilder.push('0');
10761 # }
10762 # resultBuilder.push(hexString);
10763 # return resultBuilder.join('');
10764 # };
10765 #
10766 # // ...
10767 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
10768 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
10769 # the final pixel color is defined by the equation:
10770 #
10771 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
10772 #
10773 # This means that a value of 1.0 corresponds to a solid color, whereas
10774 # a value of 0.0 corresponds to a completely transparent color. This
10775 # uses a wrapper message rather than a simple float scalar so that it is
10776 # possible to distinguish between a default value and the value being unset.
10777 # If omitted, this color object is to be rendered as a solid color
10778 # (as if the alpha value had been explicitly given with a value of 1.0).
10779 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
10780 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
10781 },
10782 "width": 42, # The width of the border, in pixels.
10783 # Border widths must be between 0 and 3 pixels.
10784 "style": "A String", # The style of the border.
10785 },
10786 "left": { # A border along a cell. # The left border of the cell.
10787 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
10788 # for simplicity of conversion to/from color representations in various
10789 # languages over compactness; for example, the fields of this representation
10790 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
10791 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
10792 # method in iOS; and, with just a little work, it can be easily formatted into
10793 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
10794 #
10795 # Example (Java):
10796 #
10797 # import com.google.type.Color;
10798 #
10799 # // ...
10800 # public static java.awt.Color fromProto(Color protocolor) {
10801 # float alpha = protocolor.hasAlpha()
10802 # ? protocolor.getAlpha().getValue()
10803 # : 1.0;
10804 #
10805 # return new java.awt.Color(
10806 # protocolor.getRed(),
10807 # protocolor.getGreen(),
10808 # protocolor.getBlue(),
10809 # alpha);
10810 # }
10811 #
10812 # public static Color toProto(java.awt.Color color) {
10813 # float red = (float) color.getRed();
10814 # float green = (float) color.getGreen();
10815 # float blue = (float) color.getBlue();
10816 # float denominator = 255.0;
10817 # Color.Builder resultBuilder =
10818 # Color
10819 # .newBuilder()
10820 # .setRed(red / denominator)
10821 # .setGreen(green / denominator)
10822 # .setBlue(blue / denominator);
10823 # int alpha = color.getAlpha();
10824 # if (alpha != 255) {
10825 # result.setAlpha(
10826 # FloatValue
10827 # .newBuilder()
10828 # .setValue(((float) alpha) / denominator)
10829 # .build());
10830 # }
10831 # return resultBuilder.build();
10832 # }
10833 # // ...
10834 #
10835 # Example (iOS / Obj-C):
10836 #
10837 # // ...
10838 # static UIColor* fromProto(Color* protocolor) {
10839 # float red = [protocolor red];
10840 # float green = [protocolor green];
10841 # float blue = [protocolor blue];
10842 # FloatValue* alpha_wrapper = [protocolor alpha];
10843 # float alpha = 1.0;
10844 # if (alpha_wrapper != nil) {
10845 # alpha = [alpha_wrapper value];
10846 # }
10847 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
10848 # }
10849 #
10850 # static Color* toProto(UIColor* color) {
10851 # CGFloat red, green, blue, alpha;
10852 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
10853 # return nil;
10854 # }
10855 # Color* result = [Color alloc] init];
10856 # [result setRed:red];
10857 # [result setGreen:green];
10858 # [result setBlue:blue];
10859 # if (alpha <= 0.9999) {
10860 # [result setAlpha:floatWrapperWithValue(alpha)];
10861 # }
10862 # [result autorelease];
10863 # return result;
10864 # }
10865 # // ...
10866 #
10867 # Example (JavaScript):
10868 #
10869 # // ...
10870 #
10871 # var protoToCssColor = function(rgb_color) {
10872 # var redFrac = rgb_color.red || 0.0;
10873 # var greenFrac = rgb_color.green || 0.0;
10874 # var blueFrac = rgb_color.blue || 0.0;
10875 # var red = Math.floor(redFrac * 255);
10876 # var green = Math.floor(greenFrac * 255);
10877 # var blue = Math.floor(blueFrac * 255);
10878 #
10879 # if (!('alpha' in rgb_color)) {
10880 # return rgbToCssColor_(red, green, blue);
10881 # }
10882 #
10883 # var alphaFrac = rgb_color.alpha.value || 0.0;
10884 # var rgbParams = [red, green, blue].join(',');
10885 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
10886 # };
10887 #
10888 # var rgbToCssColor_ = function(red, green, blue) {
10889 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
10890 # var hexString = rgbNumber.toString(16);
10891 # var missingZeros = 6 - hexString.length;
10892 # var resultBuilder = ['#'];
10893 # for (var i = 0; i < missingZeros; i++) {
10894 # resultBuilder.push('0');
10895 # }
10896 # resultBuilder.push(hexString);
10897 # return resultBuilder.join('');
10898 # };
10899 #
10900 # // ...
10901 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
10902 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
10903 # the final pixel color is defined by the equation:
10904 #
10905 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
10906 #
10907 # This means that a value of 1.0 corresponds to a solid color, whereas
10908 # a value of 0.0 corresponds to a completely transparent color. This
10909 # uses a wrapper message rather than a simple float scalar so that it is
10910 # possible to distinguish between a default value and the value being unset.
10911 # If omitted, this color object is to be rendered as a solid color
10912 # (as if the alpha value had been explicitly given with a value of 1.0).
10913 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
10914 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
10915 },
10916 "width": 42, # The width of the border, in pixels.
10917 # Border widths must be between 0 and 3 pixels.
10918 "style": "A String", # The style of the border.
10919 },
10920 },
10921 "wrapStrategy": "A String", # The wrap strategy for the value in the cell.
10922 },
10923 "dataValidation": { # A data validation rule. # A data validation rule on the cell, if any.
10924 #
10925 # When writing, the new data validation rule will overwrite any prior rule.
10926 "showCustomUi": True or False, # True if the UI should be customized based on the kind of condition.
10927 # If true, "List" conditions will show a dropdown.
10928 "strict": True or False, # True if invalid data should be rejected.
10929 "inputMessage": "A String", # A message to show the user when adding data to the cell.
10930 "condition": { # A condition that can evaluate to true or false. # The condition that data in the cell must match.
10931 # BooleanConditions are used by conditional formatting,
10932 # data validation, and the criteria in filters.
10933 "type": "A String", # The type of condition.
10934 "values": [ # The values of the condition. The number of supported values depends
10935 # on the condition type. Some support zero values,
10936 # others one or two values,
10937 # and ConditionType.ONE_OF_LIST supports an arbitrary number of values.
10938 { # The value of the condition.
10939 "relativeDate": "A String", # A relative date (based on the current date).
10940 # Valid only if the type is
10941 # DATE_BEFORE,
10942 # DATE_AFTER,
10943 # DATE_ON_OR_BEFORE or
10944 # DATE_ON_OR_AFTER.
10945 #
10946 # Relative dates are not supported in data validation.
10947 # They are supported only in conditional formatting and
10948 # conditional filters.
10949 "userEnteredValue": "A String", # A value the condition is based on.
10950 # The value will be parsed as if the user typed into a cell.
10951 # Formulas are supported (and must begin with an `=`).
10952 },
10953 ],
10954 },
10955 },
10956 "textFormatRuns": [ # Runs of rich text applied to subsections of the cell.
10957 # Runs start at specific indexes in the text and continue until the next
10958 # run. Properties of a run will continue unless explicitly changed
10959 # in a subsequent run (and properties of the first run will continue
10960 # the properties of the cell unless explicitly changed).
10961 #
10962 # When writing, the new runs will overwrite any prior runs.
10963 { # A run of a text format. The format of this run continues until explicitly
10964 # overridden in the next run.
10965 # When updating, all fields must be set.
10966 "startIndex": 42, # The character index where this run starts.
10967 "format": { # The format of a run of text in a cell. # The format of this run. Absent values inherit the cell's format.
10968 # Absent values indicate that the field isn't specified.
10969 "foregroundColor": { # Represents a color in the RGBA color space. This representation is designed # The foreground color of the text.
10970 # for simplicity of conversion to/from color representations in various
10971 # languages over compactness; for example, the fields of this representation
10972 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
10973 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
10974 # method in iOS; and, with just a little work, it can be easily formatted into
10975 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
10976 #
10977 # Example (Java):
10978 #
10979 # import com.google.type.Color;
10980 #
10981 # // ...
10982 # public static java.awt.Color fromProto(Color protocolor) {
10983 # float alpha = protocolor.hasAlpha()
10984 # ? protocolor.getAlpha().getValue()
10985 # : 1.0;
10986 #
10987 # return new java.awt.Color(
10988 # protocolor.getRed(),
10989 # protocolor.getGreen(),
10990 # protocolor.getBlue(),
10991 # alpha);
10992 # }
10993 #
10994 # public static Color toProto(java.awt.Color color) {
10995 # float red = (float) color.getRed();
10996 # float green = (float) color.getGreen();
10997 # float blue = (float) color.getBlue();
10998 # float denominator = 255.0;
10999 # Color.Builder resultBuilder =
11000 # Color
11001 # .newBuilder()
11002 # .setRed(red / denominator)
11003 # .setGreen(green / denominator)
11004 # .setBlue(blue / denominator);
11005 # int alpha = color.getAlpha();
11006 # if (alpha != 255) {
11007 # result.setAlpha(
11008 # FloatValue
11009 # .newBuilder()
11010 # .setValue(((float) alpha) / denominator)
11011 # .build());
11012 # }
11013 # return resultBuilder.build();
11014 # }
11015 # // ...
11016 #
11017 # Example (iOS / Obj-C):
11018 #
11019 # // ...
11020 # static UIColor* fromProto(Color* protocolor) {
11021 # float red = [protocolor red];
11022 # float green = [protocolor green];
11023 # float blue = [protocolor blue];
11024 # FloatValue* alpha_wrapper = [protocolor alpha];
11025 # float alpha = 1.0;
11026 # if (alpha_wrapper != nil) {
11027 # alpha = [alpha_wrapper value];
11028 # }
11029 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
11030 # }
11031 #
11032 # static Color* toProto(UIColor* color) {
11033 # CGFloat red, green, blue, alpha;
11034 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
11035 # return nil;
11036 # }
11037 # Color* result = [Color alloc] init];
11038 # [result setRed:red];
11039 # [result setGreen:green];
11040 # [result setBlue:blue];
11041 # if (alpha <= 0.9999) {
11042 # [result setAlpha:floatWrapperWithValue(alpha)];
11043 # }
11044 # [result autorelease];
11045 # return result;
11046 # }
11047 # // ...
11048 #
11049 # Example (JavaScript):
11050 #
11051 # // ...
11052 #
11053 # var protoToCssColor = function(rgb_color) {
11054 # var redFrac = rgb_color.red || 0.0;
11055 # var greenFrac = rgb_color.green || 0.0;
11056 # var blueFrac = rgb_color.blue || 0.0;
11057 # var red = Math.floor(redFrac * 255);
11058 # var green = Math.floor(greenFrac * 255);
11059 # var blue = Math.floor(blueFrac * 255);
11060 #
11061 # if (!('alpha' in rgb_color)) {
11062 # return rgbToCssColor_(red, green, blue);
11063 # }
11064 #
11065 # var alphaFrac = rgb_color.alpha.value || 0.0;
11066 # var rgbParams = [red, green, blue].join(',');
11067 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
11068 # };
11069 #
11070 # var rgbToCssColor_ = function(red, green, blue) {
11071 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
11072 # var hexString = rgbNumber.toString(16);
11073 # var missingZeros = 6 - hexString.length;
11074 # var resultBuilder = ['#'];
11075 # for (var i = 0; i < missingZeros; i++) {
11076 # resultBuilder.push('0');
11077 # }
11078 # resultBuilder.push(hexString);
11079 # return resultBuilder.join('');
11080 # };
11081 #
11082 # // ...
11083 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
11084 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
11085 # the final pixel color is defined by the equation:
11086 #
11087 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
11088 #
11089 # This means that a value of 1.0 corresponds to a solid color, whereas
11090 # a value of 0.0 corresponds to a completely transparent color. This
11091 # uses a wrapper message rather than a simple float scalar so that it is
11092 # possible to distinguish between a default value and the value being unset.
11093 # If omitted, this color object is to be rendered as a solid color
11094 # (as if the alpha value had been explicitly given with a value of 1.0).
11095 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
11096 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
11097 },
11098 "bold": True or False, # True if the text is bold.
11099 "strikethrough": True or False, # True if the text has a strikethrough.
11100 "fontFamily": "A String", # The font family.
11101 "fontSize": 42, # The size of the font.
11102 "italic": True or False, # True if the text is italicized.
11103 "underline": True or False, # True if the text is underlined.
11104 },
11105 },
11106 ],
11107 },
11108 ],
11109 },
11110 ],
11111 "start": { # A coordinate in a sheet. # The coordinate to start writing data at.
11112 # Any number of rows and columns (including a different number of
11113 # columns per row) may be written.
11114 # All indexes are zero-based.
11115 "rowIndex": 42, # The row index of the coordinate.
11116 "columnIndex": 42, # The column index of the coordinate.
11117 "sheetId": 42, # The sheet this coordinate is on.
11118 },
11119 },
11120 "autoFill": { # Fills in more data based on existing data. # Automatically fills in more data based on existing data.
11121 "useAlternateSeries": True or False, # True if we should generate data with the "alternate" series.
11122 # This differs based on the type and amount of source data.
11123 "range": { # A range on a sheet. # The range to autofill. This will examine the range and detect
11124 # the location that has data and automatically fill that data
11125 # in to the rest of the range.
11126 # All indexes are zero-based.
11127 # Indexes are half open, e.g the start index is inclusive
11128 # and the end index is exclusive -- [start_index, end_index).
11129 # Missing indexes indicate the range is unbounded on that side.
11130 #
11131 # For example, if "Sheet1" is grid ID 0, then:
11132 #
11133 # Sheet1!A1:A1 == sheet_id: 0,
11134 # start_row_index: 0, end_row_index: 1,
11135 # start_column_index: 0, end_column_index: 1
11136 #
11137 # Sheet1!A3:B4 == sheet_id: 0,
11138 # start_row_index: 2, end_row_index: 4,
11139 # start_column_index: 0, end_column_index: 2
11140 #
11141 # Sheet1!A:B == sheet_id: 0,
11142 # start_column_index: 0, end_column_index: 2
11143 #
11144 # Sheet1!A5:B == sheet_id: 0,
11145 # start_row_index: 4,
11146 # start_column_index: 0, end_column_index: 2
11147 #
11148 # Sheet1 == sheet_id:0
11149 #
11150 # The start index must always be less than or equal to the end index.
11151 # If the start index equals the end index, then the range is empty.
11152 # Empty ranges are typically not meaningful and are usually rendered in the
11153 # UI as `#REF!`.
11154 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
11155 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
11156 "sheetId": 42, # The sheet this range is on.
11157 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
11158 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
11159 },
11160 "sourceAndDestination": { # A combination of a source range and how to extend that source. # The source and destination areas to autofill.
11161 # This explicitly lists the source of the autofill and where to
11162 # extend that data.
11163 "source": { # A range on a sheet. # The location of the data to use as the source of the autofill.
11164 # All indexes are zero-based.
11165 # Indexes are half open, e.g the start index is inclusive
11166 # and the end index is exclusive -- [start_index, end_index).
11167 # Missing indexes indicate the range is unbounded on that side.
11168 #
11169 # For example, if "Sheet1" is grid ID 0, then:
11170 #
11171 # Sheet1!A1:A1 == sheet_id: 0,
11172 # start_row_index: 0, end_row_index: 1,
11173 # start_column_index: 0, end_column_index: 1
11174 #
11175 # Sheet1!A3:B4 == sheet_id: 0,
11176 # start_row_index: 2, end_row_index: 4,
11177 # start_column_index: 0, end_column_index: 2
11178 #
11179 # Sheet1!A:B == sheet_id: 0,
11180 # start_column_index: 0, end_column_index: 2
11181 #
11182 # Sheet1!A5:B == sheet_id: 0,
11183 # start_row_index: 4,
11184 # start_column_index: 0, end_column_index: 2
11185 #
11186 # Sheet1 == sheet_id:0
11187 #
11188 # The start index must always be less than or equal to the end index.
11189 # If the start index equals the end index, then the range is empty.
11190 # Empty ranges are typically not meaningful and are usually rendered in the
11191 # UI as `#REF!`.
11192 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
11193 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
11194 "sheetId": 42, # The sheet this range is on.
11195 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
11196 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
11197 },
11198 "dimension": "A String", # The dimension that data should be filled into.
11199 "fillLength": 42, # The number of rows or columns that data should be filled into.
11200 # Positive numbers expand beyond the last row or last column
11201 # of the source. Negative numbers expand before the first row
11202 # or first column of the source.
11203 },
11204 },
11205 "appendDimension": { # Appends rows or columns to the end of a sheet. # Appends dimensions to the end of a sheet.
11206 "length": 42, # The number of rows or columns to append.
11207 "sheetId": 42, # The sheet to append rows or columns to.
11208 "dimension": "A String", # Whether rows or columns should be appended.
11209 },
11210 "autoResizeDimensions": { # Automatically resizes one or more dimensions based on the contents # Automatically resizes one or more dimensions based on the contents
11211 # of the cells in that dimension.
11212 # of the cells in that dimension.
11213 "dimensions": { # A range along a single dimension on a sheet. # The dimensions to automatically resize.
11214 # Only COLUMNS are supported.
11215 # All indexes are zero-based.
11216 # Indexes are half open: the start index is inclusive
11217 # and the end index is exclusive.
11218 # Missing indexes indicate the range is unbounded on that side.
11219 "endIndex": 42, # The end (exclusive) of the span, or not set if unbounded.
11220 "startIndex": 42, # The start (inclusive) of the span, or not set if unbounded.
11221 "sheetId": 42, # The sheet this span is on.
11222 "dimension": "A String", # The dimension of the span.
11223 },
11224 },
11225 "updateDimensionProperties": { # Updates properties of dimensions within the specified range. # Updates dimensions' properties.
11226 # It is an error to specify read only fields in the field mask.
11227 "fields": "A String", # The fields that should be updated. At least one field must be specified.
11228 # The root `properties` is implied and should not be specified.
11229 # A single `"*"` can be used as short-hand for listing every field.
11230 "range": { # A range along a single dimension on a sheet. # The rows or columns to update.
11231 # All indexes are zero-based.
11232 # Indexes are half open: the start index is inclusive
11233 # and the end index is exclusive.
11234 # Missing indexes indicate the range is unbounded on that side.
11235 "endIndex": 42, # The end (exclusive) of the span, or not set if unbounded.
11236 "startIndex": 42, # The start (inclusive) of the span, or not set if unbounded.
11237 "sheetId": 42, # The sheet this span is on.
11238 "dimension": "A String", # The dimension of the span.
11239 },
11240 "properties": { # Properties about a dimension. # Properties to update.
11241 "pixelSize": 42, # The height (if a row) or width (if a column) of the dimension in pixels.
11242 "hiddenByUser": True or False, # True if this dimension is explicitly hidden.
11243 "hiddenByFilter": True or False, # True if this dimension is being filtered.
11244 # This field is read-only.
11245 },
11246 },
11247 "unmergeCells": { # Unmerges cells in the given range. # Unmerges merged cells.
11248 "range": { # A range on a sheet. # The range within which all cells should be unmerged.
11249 # If the range spans multiple merges, all will be unmerged.
11250 # The range must not partially span any merge.
11251 # All indexes are zero-based.
11252 # Indexes are half open, e.g the start index is inclusive
11253 # and the end index is exclusive -- [start_index, end_index).
11254 # Missing indexes indicate the range is unbounded on that side.
11255 #
11256 # For example, if "Sheet1" is grid ID 0, then:
11257 #
11258 # Sheet1!A1:A1 == sheet_id: 0,
11259 # start_row_index: 0, end_row_index: 1,
11260 # start_column_index: 0, end_column_index: 1
11261 #
11262 # Sheet1!A3:B4 == sheet_id: 0,
11263 # start_row_index: 2, end_row_index: 4,
11264 # start_column_index: 0, end_column_index: 2
11265 #
11266 # Sheet1!A:B == sheet_id: 0,
11267 # start_column_index: 0, end_column_index: 2
11268 #
11269 # Sheet1!A5:B == sheet_id: 0,
11270 # start_row_index: 4,
11271 # start_column_index: 0, end_column_index: 2
11272 #
11273 # Sheet1 == sheet_id:0
11274 #
11275 # The start index must always be less than or equal to the end index.
11276 # If the start index equals the end index, then the range is empty.
11277 # Empty ranges are typically not meaningful and are usually rendered in the
11278 # UI as `#REF!`.
11279 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
11280 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
11281 "sheetId": 42, # The sheet this range is on.
11282 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
11283 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
11284 },
11285 },
11286 "setDataValidation": { # Sets a data validation rule to every cell in the range. # Sets data validation for one or more cells.
11287 # To clear validation in a range, call this with no rule specified.
11288 "range": { # A range on a sheet. # The range the data validation rule should apply to.
11289 # All indexes are zero-based.
11290 # Indexes are half open, e.g the start index is inclusive
11291 # and the end index is exclusive -- [start_index, end_index).
11292 # Missing indexes indicate the range is unbounded on that side.
11293 #
11294 # For example, if "Sheet1" is grid ID 0, then:
11295 #
11296 # Sheet1!A1:A1 == sheet_id: 0,
11297 # start_row_index: 0, end_row_index: 1,
11298 # start_column_index: 0, end_column_index: 1
11299 #
11300 # Sheet1!A3:B4 == sheet_id: 0,
11301 # start_row_index: 2, end_row_index: 4,
11302 # start_column_index: 0, end_column_index: 2
11303 #
11304 # Sheet1!A:B == sheet_id: 0,
11305 # start_column_index: 0, end_column_index: 2
11306 #
11307 # Sheet1!A5:B == sheet_id: 0,
11308 # start_row_index: 4,
11309 # start_column_index: 0, end_column_index: 2
11310 #
11311 # Sheet1 == sheet_id:0
11312 #
11313 # The start index must always be less than or equal to the end index.
11314 # If the start index equals the end index, then the range is empty.
11315 # Empty ranges are typically not meaningful and are usually rendered in the
11316 # UI as `#REF!`.
11317 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
11318 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
11319 "sheetId": 42, # The sheet this range is on.
11320 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
11321 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
11322 },
11323 "rule": { # A data validation rule. # The data validation rule to set on each cell in the range,
11324 # or empty to clear the data validation in the range.
11325 "showCustomUi": True or False, # True if the UI should be customized based on the kind of condition.
11326 # If true, "List" conditions will show a dropdown.
11327 "strict": True or False, # True if invalid data should be rejected.
11328 "inputMessage": "A String", # A message to show the user when adding data to the cell.
11329 "condition": { # A condition that can evaluate to true or false. # The condition that data in the cell must match.
11330 # BooleanConditions are used by conditional formatting,
11331 # data validation, and the criteria in filters.
11332 "type": "A String", # The type of condition.
11333 "values": [ # The values of the condition. The number of supported values depends
11334 # on the condition type. Some support zero values,
11335 # others one or two values,
11336 # and ConditionType.ONE_OF_LIST supports an arbitrary number of values.
11337 { # The value of the condition.
11338 "relativeDate": "A String", # A relative date (based on the current date).
11339 # Valid only if the type is
11340 # DATE_BEFORE,
11341 # DATE_AFTER,
11342 # DATE_ON_OR_BEFORE or
11343 # DATE_ON_OR_AFTER.
11344 #
11345 # Relative dates are not supported in data validation.
11346 # They are supported only in conditional formatting and
11347 # conditional filters.
11348 "userEnteredValue": "A String", # A value the condition is based on.
11349 # The value will be parsed as if the user typed into a cell.
11350 # Formulas are supported (and must begin with an `=`).
11351 },
11352 ],
11353 },
11354 },
11355 },
11356 "clearBasicFilter": { # Clears the basic filter, if any exists on the sheet. # Clears the basic filter on a sheet.
11357 "sheetId": 42, # The sheet ID on which the basic filter should be cleared.
11358 },
11359 "addNamedRange": { # Adds a named range to the spreadsheet. # Adds a named range.
11360 "namedRange": { # A named range. # The named range to add. If a non-empty
11361 # namedRangeId is specified, the named range
11362 # will use that ID. (It is an error to specify the ID of a named
11363 # range that already exists.)
11364 "namedRangeId": "A String", # The ID of the named range.
11365 "range": { # A range on a sheet. # The range this represents.
11366 # All indexes are zero-based.
11367 # Indexes are half open, e.g the start index is inclusive
11368 # and the end index is exclusive -- [start_index, end_index).
11369 # Missing indexes indicate the range is unbounded on that side.
11370 #
11371 # For example, if "Sheet1" is grid ID 0, then:
11372 #
11373 # Sheet1!A1:A1 == sheet_id: 0,
11374 # start_row_index: 0, end_row_index: 1,
11375 # start_column_index: 0, end_column_index: 1
11376 #
11377 # Sheet1!A3:B4 == sheet_id: 0,
11378 # start_row_index: 2, end_row_index: 4,
11379 # start_column_index: 0, end_column_index: 2
11380 #
11381 # Sheet1!A:B == sheet_id: 0,
11382 # start_column_index: 0, end_column_index: 2
11383 #
11384 # Sheet1!A5:B == sheet_id: 0,
11385 # start_row_index: 4,
11386 # start_column_index: 0, end_column_index: 2
11387 #
11388 # Sheet1 == sheet_id:0
11389 #
11390 # The start index must always be less than or equal to the end index.
11391 # If the start index equals the end index, then the range is empty.
11392 # Empty ranges are typically not meaningful and are usually rendered in the
11393 # UI as `#REF!`.
11394 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
11395 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
11396 "sheetId": 42, # The sheet this range is on.
11397 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
11398 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
11399 },
11400 "name": "A String", # The name of the named range.
11401 },
11402 },
11403 "updateChartSpec": { # Updates a chart's specifications. # Updates a chart's specifications.
11404 # (This does not move or resize a chart. To move or resize a chart, use
11405 # UpdateEmbeddedObjectPositionRequest.)
11406 "chartId": 42, # The ID of the chart to update.
11407 "spec": { # The specifications of a chart. # The specification to apply to the chart.
11408 "hiddenDimensionStrategy": "A String", # Determines how the charts will use hidden rows or columns.
11409 # This value is only meaningful if the
11410 # ChartData.sourceRange
11411 # is used for a domain or series.
11412 "pieChart": { # A <a href="/chart/interactive/docs/gallery/piechart">pie chart</a>. # A pie chart specification.
11413 "series": { # The data included in a domain or series. # The data that covers the one and only series of the pie chart.
11414 "sourceRange": { # Source ranges for a chart. # The source ranges of the data.
11415 "sources": [ # The ranges of data for a series or domain.
11416 # Exactly one dimension must have a length of 1,
11417 # and all sources in the list must have the same dimension
11418 # with length 1.
11419 # The domain (if it exists) & all series must have the same number
11420 # of source ranges. If using more than one source range, then the source
11421 # range at a given offset must be contiguous across the domain and series.
11422 #
11423 # For example, these are valid configurations:
11424 #
11425 # domain sources: A1:A5
11426 # series1 sources: B1:B5
11427 # series2 sources: D6:D10
11428 #
11429 # domain sources: A1:A5, C10:C12
11430 # series1 sources: B1:B5, D10:D12
11431 # series2 sources: C1:C5, E10:E12
11432 { # A range on a sheet.
11433 # All indexes are zero-based.
11434 # Indexes are half open, e.g the start index is inclusive
11435 # and the end index is exclusive -- [start_index, end_index).
11436 # Missing indexes indicate the range is unbounded on that side.
11437 #
11438 # For example, if "Sheet1" is grid ID 0, then:
11439 #
11440 # Sheet1!A1:A1 == sheet_id: 0,
11441 # start_row_index: 0, end_row_index: 1,
11442 # start_column_index: 0, end_column_index: 1
11443 #
11444 # Sheet1!A3:B4 == sheet_id: 0,
11445 # start_row_index: 2, end_row_index: 4,
11446 # start_column_index: 0, end_column_index: 2
11447 #
11448 # Sheet1!A:B == sheet_id: 0,
11449 # start_column_index: 0, end_column_index: 2
11450 #
11451 # Sheet1!A5:B == sheet_id: 0,
11452 # start_row_index: 4,
11453 # start_column_index: 0, end_column_index: 2
11454 #
11455 # Sheet1 == sheet_id:0
11456 #
11457 # The start index must always be less than or equal to the end index.
11458 # If the start index equals the end index, then the range is empty.
11459 # Empty ranges are typically not meaningful and are usually rendered in the
11460 # UI as `#REF!`.
11461 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
11462 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
11463 "sheetId": 42, # The sheet this range is on.
11464 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
11465 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
11466 },
11467 ],
11468 },
11469 },
11470 "domain": { # The data included in a domain or series. # The data that covers the domain of the pie chart.
11471 "sourceRange": { # Source ranges for a chart. # The source ranges of the data.
11472 "sources": [ # The ranges of data for a series or domain.
11473 # Exactly one dimension must have a length of 1,
11474 # and all sources in the list must have the same dimension
11475 # with length 1.
11476 # The domain (if it exists) & all series must have the same number
11477 # of source ranges. If using more than one source range, then the source
11478 # range at a given offset must be contiguous across the domain and series.
11479 #
11480 # For example, these are valid configurations:
11481 #
11482 # domain sources: A1:A5
11483 # series1 sources: B1:B5
11484 # series2 sources: D6:D10
11485 #
11486 # domain sources: A1:A5, C10:C12
11487 # series1 sources: B1:B5, D10:D12
11488 # series2 sources: C1:C5, E10:E12
11489 { # A range on a sheet.
11490 # All indexes are zero-based.
11491 # Indexes are half open, e.g the start index is inclusive
11492 # and the end index is exclusive -- [start_index, end_index).
11493 # Missing indexes indicate the range is unbounded on that side.
11494 #
11495 # For example, if "Sheet1" is grid ID 0, then:
11496 #
11497 # Sheet1!A1:A1 == sheet_id: 0,
11498 # start_row_index: 0, end_row_index: 1,
11499 # start_column_index: 0, end_column_index: 1
11500 #
11501 # Sheet1!A3:B4 == sheet_id: 0,
11502 # start_row_index: 2, end_row_index: 4,
11503 # start_column_index: 0, end_column_index: 2
11504 #
11505 # Sheet1!A:B == sheet_id: 0,
11506 # start_column_index: 0, end_column_index: 2
11507 #
11508 # Sheet1!A5:B == sheet_id: 0,
11509 # start_row_index: 4,
11510 # start_column_index: 0, end_column_index: 2
11511 #
11512 # Sheet1 == sheet_id:0
11513 #
11514 # The start index must always be less than or equal to the end index.
11515 # If the start index equals the end index, then the range is empty.
11516 # Empty ranges are typically not meaningful and are usually rendered in the
11517 # UI as `#REF!`.
11518 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
11519 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
11520 "sheetId": 42, # The sheet this range is on.
11521 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
11522 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
11523 },
11524 ],
11525 },
11526 },
11527 "threeDimensional": True or False, # True if the pie is three dimensional.
11528 "legendPosition": "A String", # Where the legend of the pie chart should be drawn.
11529 "pieHole": 3.14, # The size of the hole in the pie chart.
11530 },
11531 "basicChart": { # The specification for a basic chart. See BasicChartType for the list # A basic chart specification, can be one of many kinds of charts.
11532 # See BasicChartType for the list of all charts this supports.
11533 # of charts this supports.
11534 "headerCount": 42, # The number of rows or columns in the data that are "headers".
11535 # If not set, Google Sheets will guess how many rows are headers based
11536 # on the data.
11537 #
11538 # (Note that BasicChartAxis.title may override the axis title
11539 # inferred from the header values.)
11540 "series": [ # The data this chart is visualizing.
11541 { # A single series of data in a chart.
11542 # For example, if charting stock prices over time, multiple series may exist,
11543 # one for the "Open Price", "High Price", "Low Price" and "Close Price".
11544 "series": { # The data included in a domain or series. # The data being visualized in this chart series.
11545 "sourceRange": { # Source ranges for a chart. # The source ranges of the data.
11546 "sources": [ # The ranges of data for a series or domain.
11547 # Exactly one dimension must have a length of 1,
11548 # and all sources in the list must have the same dimension
11549 # with length 1.
11550 # The domain (if it exists) & all series must have the same number
11551 # of source ranges. If using more than one source range, then the source
11552 # range at a given offset must be contiguous across the domain and series.
11553 #
11554 # For example, these are valid configurations:
11555 #
11556 # domain sources: A1:A5
11557 # series1 sources: B1:B5
11558 # series2 sources: D6:D10
11559 #
11560 # domain sources: A1:A5, C10:C12
11561 # series1 sources: B1:B5, D10:D12
11562 # series2 sources: C1:C5, E10:E12
11563 { # A range on a sheet.
11564 # All indexes are zero-based.
11565 # Indexes are half open, e.g the start index is inclusive
11566 # and the end index is exclusive -- [start_index, end_index).
11567 # Missing indexes indicate the range is unbounded on that side.
11568 #
11569 # For example, if "Sheet1" is grid ID 0, then:
11570 #
11571 # Sheet1!A1:A1 == sheet_id: 0,
11572 # start_row_index: 0, end_row_index: 1,
11573 # start_column_index: 0, end_column_index: 1
11574 #
11575 # Sheet1!A3:B4 == sheet_id: 0,
11576 # start_row_index: 2, end_row_index: 4,
11577 # start_column_index: 0, end_column_index: 2
11578 #
11579 # Sheet1!A:B == sheet_id: 0,
11580 # start_column_index: 0, end_column_index: 2
11581 #
11582 # Sheet1!A5:B == sheet_id: 0,
11583 # start_row_index: 4,
11584 # start_column_index: 0, end_column_index: 2
11585 #
11586 # Sheet1 == sheet_id:0
11587 #
11588 # The start index must always be less than or equal to the end index.
11589 # If the start index equals the end index, then the range is empty.
11590 # Empty ranges are typically not meaningful and are usually rendered in the
11591 # UI as `#REF!`.
11592 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
11593 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
11594 "sheetId": 42, # The sheet this range is on.
11595 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
11596 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
11597 },
11598 ],
11599 },
11600 },
11601 "targetAxis": "A String", # The minor axis that will specify the range of values for this series.
11602 # For example, if charting stocks over time, the "Volume" series
11603 # may want to be pinned to the right with the prices pinned to the left,
11604 # because the scale of trading volume is different than the scale of
11605 # prices.
11606 # It is an error to specify an axis that isn't a valid minor axis
11607 # for the chart's type.
11608 "type": "A String", # The type of this series. Valid only if the
11609 # chartType is
11610 # COMBO.
11611 # Different types will change the way the series is visualized.
11612 # Only LINE, AREA,
11613 # and COLUMN are supported.
11614 },
11615 ],
11616 "legendPosition": "A String", # The position of the chart legend.
11617 "domains": [ # The domain of data this is charting.
11618 # Only a single domain is currently supported.
11619 { # The domain of a chart.
11620 # For example, if charting stock prices over time, this would be the date.
11621 "domain": { # The data included in a domain or series. # The data of the domain. For example, if charting stock prices over time,
11622 # this be the data representing the dates.
11623 "sourceRange": { # Source ranges for a chart. # The source ranges of the data.
11624 "sources": [ # The ranges of data for a series or domain.
11625 # Exactly one dimension must have a length of 1,
11626 # and all sources in the list must have the same dimension
11627 # with length 1.
11628 # The domain (if it exists) & all series must have the same number
11629 # of source ranges. If using more than one source range, then the source
11630 # range at a given offset must be contiguous across the domain and series.
11631 #
11632 # For example, these are valid configurations:
11633 #
11634 # domain sources: A1:A5
11635 # series1 sources: B1:B5
11636 # series2 sources: D6:D10
11637 #
11638 # domain sources: A1:A5, C10:C12
11639 # series1 sources: B1:B5, D10:D12
11640 # series2 sources: C1:C5, E10:E12
11641 { # A range on a sheet.
11642 # All indexes are zero-based.
11643 # Indexes are half open, e.g the start index is inclusive
11644 # and the end index is exclusive -- [start_index, end_index).
11645 # Missing indexes indicate the range is unbounded on that side.
11646 #
11647 # For example, if "Sheet1" is grid ID 0, then:
11648 #
11649 # Sheet1!A1:A1 == sheet_id: 0,
11650 # start_row_index: 0, end_row_index: 1,
11651 # start_column_index: 0, end_column_index: 1
11652 #
11653 # Sheet1!A3:B4 == sheet_id: 0,
11654 # start_row_index: 2, end_row_index: 4,
11655 # start_column_index: 0, end_column_index: 2
11656 #
11657 # Sheet1!A:B == sheet_id: 0,
11658 # start_column_index: 0, end_column_index: 2
11659 #
11660 # Sheet1!A5:B == sheet_id: 0,
11661 # start_row_index: 4,
11662 # start_column_index: 0, end_column_index: 2
11663 #
11664 # Sheet1 == sheet_id:0
11665 #
11666 # The start index must always be less than or equal to the end index.
11667 # If the start index equals the end index, then the range is empty.
11668 # Empty ranges are typically not meaningful and are usually rendered in the
11669 # UI as `#REF!`.
11670 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
11671 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
11672 "sheetId": 42, # The sheet this range is on.
11673 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
11674 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
11675 },
11676 ],
11677 },
11678 },
11679 },
11680 ],
11681 "chartType": "A String", # The type of the chart.
11682 "axis": [ # The axis on the chart.
11683 { # An axis of the chart.
11684 # A chart may not have more than one axis per
11685 # axis position.
11686 "position": "A String", # The position of this axis.
11687 "format": { # The format of a run of text in a cell. # The format of the title.
11688 # Only valid if the axis is not associated with the domain.
11689 # Absent values indicate that the field isn't specified.
11690 "foregroundColor": { # Represents a color in the RGBA color space. This representation is designed # The foreground color of the text.
11691 # for simplicity of conversion to/from color representations in various
11692 # languages over compactness; for example, the fields of this representation
11693 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
11694 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
11695 # method in iOS; and, with just a little work, it can be easily formatted into
11696 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
11697 #
11698 # Example (Java):
11699 #
11700 # import com.google.type.Color;
11701 #
11702 # // ...
11703 # public static java.awt.Color fromProto(Color protocolor) {
11704 # float alpha = protocolor.hasAlpha()
11705 # ? protocolor.getAlpha().getValue()
11706 # : 1.0;
11707 #
11708 # return new java.awt.Color(
11709 # protocolor.getRed(),
11710 # protocolor.getGreen(),
11711 # protocolor.getBlue(),
11712 # alpha);
11713 # }
11714 #
11715 # public static Color toProto(java.awt.Color color) {
11716 # float red = (float) color.getRed();
11717 # float green = (float) color.getGreen();
11718 # float blue = (float) color.getBlue();
11719 # float denominator = 255.0;
11720 # Color.Builder resultBuilder =
11721 # Color
11722 # .newBuilder()
11723 # .setRed(red / denominator)
11724 # .setGreen(green / denominator)
11725 # .setBlue(blue / denominator);
11726 # int alpha = color.getAlpha();
11727 # if (alpha != 255) {
11728 # result.setAlpha(
11729 # FloatValue
11730 # .newBuilder()
11731 # .setValue(((float) alpha) / denominator)
11732 # .build());
11733 # }
11734 # return resultBuilder.build();
11735 # }
11736 # // ...
11737 #
11738 # Example (iOS / Obj-C):
11739 #
11740 # // ...
11741 # static UIColor* fromProto(Color* protocolor) {
11742 # float red = [protocolor red];
11743 # float green = [protocolor green];
11744 # float blue = [protocolor blue];
11745 # FloatValue* alpha_wrapper = [protocolor alpha];
11746 # float alpha = 1.0;
11747 # if (alpha_wrapper != nil) {
11748 # alpha = [alpha_wrapper value];
11749 # }
11750 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
11751 # }
11752 #
11753 # static Color* toProto(UIColor* color) {
11754 # CGFloat red, green, blue, alpha;
11755 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
11756 # return nil;
11757 # }
11758 # Color* result = [Color alloc] init];
11759 # [result setRed:red];
11760 # [result setGreen:green];
11761 # [result setBlue:blue];
11762 # if (alpha <= 0.9999) {
11763 # [result setAlpha:floatWrapperWithValue(alpha)];
11764 # }
11765 # [result autorelease];
11766 # return result;
11767 # }
11768 # // ...
11769 #
11770 # Example (JavaScript):
11771 #
11772 # // ...
11773 #
11774 # var protoToCssColor = function(rgb_color) {
11775 # var redFrac = rgb_color.red || 0.0;
11776 # var greenFrac = rgb_color.green || 0.0;
11777 # var blueFrac = rgb_color.blue || 0.0;
11778 # var red = Math.floor(redFrac * 255);
11779 # var green = Math.floor(greenFrac * 255);
11780 # var blue = Math.floor(blueFrac * 255);
11781 #
11782 # if (!('alpha' in rgb_color)) {
11783 # return rgbToCssColor_(red, green, blue);
11784 # }
11785 #
11786 # var alphaFrac = rgb_color.alpha.value || 0.0;
11787 # var rgbParams = [red, green, blue].join(',');
11788 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
11789 # };
11790 #
11791 # var rgbToCssColor_ = function(red, green, blue) {
11792 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
11793 # var hexString = rgbNumber.toString(16);
11794 # var missingZeros = 6 - hexString.length;
11795 # var resultBuilder = ['#'];
11796 # for (var i = 0; i < missingZeros; i++) {
11797 # resultBuilder.push('0');
11798 # }
11799 # resultBuilder.push(hexString);
11800 # return resultBuilder.join('');
11801 # };
11802 #
11803 # // ...
11804 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
11805 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
11806 # the final pixel color is defined by the equation:
11807 #
11808 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
11809 #
11810 # This means that a value of 1.0 corresponds to a solid color, whereas
11811 # a value of 0.0 corresponds to a completely transparent color. This
11812 # uses a wrapper message rather than a simple float scalar so that it is
11813 # possible to distinguish between a default value and the value being unset.
11814 # If omitted, this color object is to be rendered as a solid color
11815 # (as if the alpha value had been explicitly given with a value of 1.0).
11816 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
11817 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
11818 },
11819 "bold": True or False, # True if the text is bold.
11820 "strikethrough": True or False, # True if the text has a strikethrough.
11821 "fontFamily": "A String", # The font family.
11822 "fontSize": 42, # The size of the font.
11823 "italic": True or False, # True if the text is italicized.
11824 "underline": True or False, # True if the text is underlined.
11825 },
11826 "title": "A String", # The title of this axis. If set, this overrides any title inferred
11827 # from headers of the data.
11828 },
11829 ],
11830 },
11831 "title": "A String", # The title of the chart.
11832 },
11833 },
11834 "moveDimension": { # Moves one or more rows or columns. # Moves rows or columns to another location in a sheet.
11835 "source": { # A range along a single dimension on a sheet. # The source dimensions to move.
11836 # All indexes are zero-based.
11837 # Indexes are half open: the start index is inclusive
11838 # and the end index is exclusive.
11839 # Missing indexes indicate the range is unbounded on that side.
11840 "endIndex": 42, # The end (exclusive) of the span, or not set if unbounded.
11841 "startIndex": 42, # The start (inclusive) of the span, or not set if unbounded.
11842 "sheetId": 42, # The sheet this span is on.
11843 "dimension": "A String", # The dimension of the span.
11844 },
11845 "destinationIndex": 42, # The zero-based start index of where to move the source data to,
11846 # based on the coordinates *before* the source data is removed
11847 # from the grid. Existing data will be shifted down or right
11848 # (depending on the dimension) to make room for the moved dimensions.
11849 # The source dimensions are removed from the grid, so the
11850 # the data may end up in a different index than specified.
11851 #
11852 # For example, given `A1..A5` of `0, 1, 2, 3, 4` and wanting to move
11853 # "`1`" and "`2`" to between "`3`" and "`4`", the source would be
11854 # `ROWS [1..3)`,and the destination index would be "`4`"
11855 # (the zero-based index of row 5).
11856 # The end result would be `A1..A5` of `0, 3, 1, 2, 4`.
11857 },
11858 "textToColumns": { # Splits a column of text into multiple columns, # Converts a column of text into many columns of text.
11859 # based on a delimiter in each cell.
11860 "source": { # A range on a sheet. # The source data range. This must span exactly one column.
11861 # All indexes are zero-based.
11862 # Indexes are half open, e.g the start index is inclusive
11863 # and the end index is exclusive -- [start_index, end_index).
11864 # Missing indexes indicate the range is unbounded on that side.
11865 #
11866 # For example, if "Sheet1" is grid ID 0, then:
11867 #
11868 # Sheet1!A1:A1 == sheet_id: 0,
11869 # start_row_index: 0, end_row_index: 1,
11870 # start_column_index: 0, end_column_index: 1
11871 #
11872 # Sheet1!A3:B4 == sheet_id: 0,
11873 # start_row_index: 2, end_row_index: 4,
11874 # start_column_index: 0, end_column_index: 2
11875 #
11876 # Sheet1!A:B == sheet_id: 0,
11877 # start_column_index: 0, end_column_index: 2
11878 #
11879 # Sheet1!A5:B == sheet_id: 0,
11880 # start_row_index: 4,
11881 # start_column_index: 0, end_column_index: 2
11882 #
11883 # Sheet1 == sheet_id:0
11884 #
11885 # The start index must always be less than or equal to the end index.
11886 # If the start index equals the end index, then the range is empty.
11887 # Empty ranges are typically not meaningful and are usually rendered in the
11888 # UI as `#REF!`.
11889 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
11890 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
11891 "sheetId": 42, # The sheet this range is on.
11892 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
11893 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
11894 },
11895 "delimiter": "A String", # The delimiter to use. Used only if delimiterType is
11896 # CUSTOM.
11897 "delimiterType": "A String", # The delimiter type to use.
11898 },
11899 "deleteFilterView": { # Deletes a particular filter view. # Deletes a filter view from a sheet.
11900 "filterId": 42, # The ID of the filter to delete.
11901 },
11902 "mergeCells": { # Merges all cells in the range. # Merges cells together.
11903 "range": { # A range on a sheet. # The range of cells to merge.
11904 # All indexes are zero-based.
11905 # Indexes are half open, e.g the start index is inclusive
11906 # and the end index is exclusive -- [start_index, end_index).
11907 # Missing indexes indicate the range is unbounded on that side.
11908 #
11909 # For example, if "Sheet1" is grid ID 0, then:
11910 #
11911 # Sheet1!A1:A1 == sheet_id: 0,
11912 # start_row_index: 0, end_row_index: 1,
11913 # start_column_index: 0, end_column_index: 1
11914 #
11915 # Sheet1!A3:B4 == sheet_id: 0,
11916 # start_row_index: 2, end_row_index: 4,
11917 # start_column_index: 0, end_column_index: 2
11918 #
11919 # Sheet1!A:B == sheet_id: 0,
11920 # start_column_index: 0, end_column_index: 2
11921 #
11922 # Sheet1!A5:B == sheet_id: 0,
11923 # start_row_index: 4,
11924 # start_column_index: 0, end_column_index: 2
11925 #
11926 # Sheet1 == sheet_id:0
11927 #
11928 # The start index must always be less than or equal to the end index.
11929 # If the start index equals the end index, then the range is empty.
11930 # Empty ranges are typically not meaningful and are usually rendered in the
11931 # UI as `#REF!`.
11932 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
11933 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
11934 "sheetId": 42, # The sheet this range is on.
11935 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
11936 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
11937 },
11938 "mergeType": "A String", # How the cells should be merged.
11939 },
11940 "deleteProtectedRange": { # Deletes the protected range with the given id. # Deletes a protected range.
11941 "protectedRangeId": 42, # The ID of the protected range to delete.
11942 },
11943 "addFilterView": { # Adds a filter view. # Adds a filter view.
11944 "filter": { # A filter view. # The filter to add.
11945 "title": "A String", # The name of the filter view.
11946 "namedRangeId": "A String", # The named range this filter view is backed by, if any.
11947 #
11948 # When writing, only one of range or namedRangeId
11949 # may be set.
11950 "filterViewId": 42, # The ID of the filter view.
11951 "range": { # A range on a sheet. # The range this filter view covers.
11952 #
11953 # When writing, only one of range or namedRangeId
11954 # may be set.
11955 # All indexes are zero-based.
11956 # Indexes are half open, e.g the start index is inclusive
11957 # and the end index is exclusive -- [start_index, end_index).
11958 # Missing indexes indicate the range is unbounded on that side.
11959 #
11960 # For example, if "Sheet1" is grid ID 0, then:
11961 #
11962 # Sheet1!A1:A1 == sheet_id: 0,
11963 # start_row_index: 0, end_row_index: 1,
11964 # start_column_index: 0, end_column_index: 1
11965 #
11966 # Sheet1!A3:B4 == sheet_id: 0,
11967 # start_row_index: 2, end_row_index: 4,
11968 # start_column_index: 0, end_column_index: 2
11969 #
11970 # Sheet1!A:B == sheet_id: 0,
11971 # start_column_index: 0, end_column_index: 2
11972 #
11973 # Sheet1!A5:B == sheet_id: 0,
11974 # start_row_index: 4,
11975 # start_column_index: 0, end_column_index: 2
11976 #
11977 # Sheet1 == sheet_id:0
11978 #
11979 # The start index must always be less than or equal to the end index.
11980 # If the start index equals the end index, then the range is empty.
11981 # Empty ranges are typically not meaningful and are usually rendered in the
11982 # UI as `#REF!`.
11983 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
11984 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
11985 "sheetId": 42, # The sheet this range is on.
11986 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
11987 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
11988 },
11989 "sortSpecs": [ # The sort order per column. Later specifications are used when values
11990 # are equal in the earlier specifications.
11991 { # A sort order associated with a specific column or row.
11992 "sortOrder": "A String", # The order data should be sorted.
11993 "dimensionIndex": 42, # The dimension the sort should be applied to.
11994 },
11995 ],
11996 "criteria": { # The criteria for showing/hiding values per column.
11997 # The map's key is the column index, and the value is the criteria for
11998 # that column.
11999 "a_key": { # Criteria for showing/hiding rows in a filter, filter view.
12000 "hiddenValues": [ # Values that should be hidden.
12001 "A String",
12002 ],
12003 "condition": { # A condition that can evaluate to true or false. # A condition that must be true for values to be shown.
12004 # (This does not override hiddenValues -- if a value is listed there,
12005 # it will still be hidden.)
12006 # BooleanConditions are used by conditional formatting,
12007 # data validation, and the criteria in filters.
12008 "type": "A String", # The type of condition.
12009 "values": [ # The values of the condition. The number of supported values depends
12010 # on the condition type. Some support zero values,
12011 # others one or two values,
12012 # and ConditionType.ONE_OF_LIST supports an arbitrary number of values.
12013 { # The value of the condition.
12014 "relativeDate": "A String", # A relative date (based on the current date).
12015 # Valid only if the type is
12016 # DATE_BEFORE,
12017 # DATE_AFTER,
12018 # DATE_ON_OR_BEFORE or
12019 # DATE_ON_OR_AFTER.
12020 #
12021 # Relative dates are not supported in data validation.
12022 # They are supported only in conditional formatting and
12023 # conditional filters.
12024 "userEnteredValue": "A String", # A value the condition is based on.
12025 # The value will be parsed as if the user typed into a cell.
12026 # Formulas are supported (and must begin with an `=`).
12027 },
12028 ],
12029 },
12030 },
12031 },
12032 },
12033 },
12034 "deleteSheet": { # Deletes the requested sheet. # Deletes a sheet.
12035 "sheetId": 42, # The ID of the sheet to delete.
12036 },
12037 "updateBorders": { # Updates the borders of a range. # Updates the borders in a range of cells.
12038 # If a field is not set in the request, that means the border remains as-is.
12039 # For example, with two subsequent UpdateBordersRequest:
12040 #
12041 # 1. range: A1:A5 `{ top: RED, bottom: WHITE }`
12042 # 2. range: A1:A5 `{ left: BLUE }`
12043 #
12044 # That would result in A1:A5 having a borders of
12045 # `{ top: RED, bottom: WHITE, left: BLUE }`.
12046 # If you want to clear a border, explicitly set the style to
12047 # NONE.
12048 "right": { # A border along a cell. # The border to put at the right of the range.
12049 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
12050 # for simplicity of conversion to/from color representations in various
12051 # languages over compactness; for example, the fields of this representation
12052 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
12053 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
12054 # method in iOS; and, with just a little work, it can be easily formatted into
12055 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
12056 #
12057 # Example (Java):
12058 #
12059 # import com.google.type.Color;
12060 #
12061 # // ...
12062 # public static java.awt.Color fromProto(Color protocolor) {
12063 # float alpha = protocolor.hasAlpha()
12064 # ? protocolor.getAlpha().getValue()
12065 # : 1.0;
12066 #
12067 # return new java.awt.Color(
12068 # protocolor.getRed(),
12069 # protocolor.getGreen(),
12070 # protocolor.getBlue(),
12071 # alpha);
12072 # }
12073 #
12074 # public static Color toProto(java.awt.Color color) {
12075 # float red = (float) color.getRed();
12076 # float green = (float) color.getGreen();
12077 # float blue = (float) color.getBlue();
12078 # float denominator = 255.0;
12079 # Color.Builder resultBuilder =
12080 # Color
12081 # .newBuilder()
12082 # .setRed(red / denominator)
12083 # .setGreen(green / denominator)
12084 # .setBlue(blue / denominator);
12085 # int alpha = color.getAlpha();
12086 # if (alpha != 255) {
12087 # result.setAlpha(
12088 # FloatValue
12089 # .newBuilder()
12090 # .setValue(((float) alpha) / denominator)
12091 # .build());
12092 # }
12093 # return resultBuilder.build();
12094 # }
12095 # // ...
12096 #
12097 # Example (iOS / Obj-C):
12098 #
12099 # // ...
12100 # static UIColor* fromProto(Color* protocolor) {
12101 # float red = [protocolor red];
12102 # float green = [protocolor green];
12103 # float blue = [protocolor blue];
12104 # FloatValue* alpha_wrapper = [protocolor alpha];
12105 # float alpha = 1.0;
12106 # if (alpha_wrapper != nil) {
12107 # alpha = [alpha_wrapper value];
12108 # }
12109 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
12110 # }
12111 #
12112 # static Color* toProto(UIColor* color) {
12113 # CGFloat red, green, blue, alpha;
12114 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
12115 # return nil;
12116 # }
12117 # Color* result = [Color alloc] init];
12118 # [result setRed:red];
12119 # [result setGreen:green];
12120 # [result setBlue:blue];
12121 # if (alpha <= 0.9999) {
12122 # [result setAlpha:floatWrapperWithValue(alpha)];
12123 # }
12124 # [result autorelease];
12125 # return result;
12126 # }
12127 # // ...
12128 #
12129 # Example (JavaScript):
12130 #
12131 # // ...
12132 #
12133 # var protoToCssColor = function(rgb_color) {
12134 # var redFrac = rgb_color.red || 0.0;
12135 # var greenFrac = rgb_color.green || 0.0;
12136 # var blueFrac = rgb_color.blue || 0.0;
12137 # var red = Math.floor(redFrac * 255);
12138 # var green = Math.floor(greenFrac * 255);
12139 # var blue = Math.floor(blueFrac * 255);
12140 #
12141 # if (!('alpha' in rgb_color)) {
12142 # return rgbToCssColor_(red, green, blue);
12143 # }
12144 #
12145 # var alphaFrac = rgb_color.alpha.value || 0.0;
12146 # var rgbParams = [red, green, blue].join(',');
12147 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
12148 # };
12149 #
12150 # var rgbToCssColor_ = function(red, green, blue) {
12151 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
12152 # var hexString = rgbNumber.toString(16);
12153 # var missingZeros = 6 - hexString.length;
12154 # var resultBuilder = ['#'];
12155 # for (var i = 0; i < missingZeros; i++) {
12156 # resultBuilder.push('0');
12157 # }
12158 # resultBuilder.push(hexString);
12159 # return resultBuilder.join('');
12160 # };
12161 #
12162 # // ...
12163 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
12164 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
12165 # the final pixel color is defined by the equation:
12166 #
12167 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
12168 #
12169 # This means that a value of 1.0 corresponds to a solid color, whereas
12170 # a value of 0.0 corresponds to a completely transparent color. This
12171 # uses a wrapper message rather than a simple float scalar so that it is
12172 # possible to distinguish between a default value and the value being unset.
12173 # If omitted, this color object is to be rendered as a solid color
12174 # (as if the alpha value had been explicitly given with a value of 1.0).
12175 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
12176 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
12177 },
12178 "width": 42, # The width of the border, in pixels.
12179 # Border widths must be between 0 and 3 pixels.
12180 "style": "A String", # The style of the border.
12181 },
12182 "bottom": { # A border along a cell. # The border to put at the bottom of the range.
12183 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
12184 # for simplicity of conversion to/from color representations in various
12185 # languages over compactness; for example, the fields of this representation
12186 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
12187 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
12188 # method in iOS; and, with just a little work, it can be easily formatted into
12189 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
12190 #
12191 # Example (Java):
12192 #
12193 # import com.google.type.Color;
12194 #
12195 # // ...
12196 # public static java.awt.Color fromProto(Color protocolor) {
12197 # float alpha = protocolor.hasAlpha()
12198 # ? protocolor.getAlpha().getValue()
12199 # : 1.0;
12200 #
12201 # return new java.awt.Color(
12202 # protocolor.getRed(),
12203 # protocolor.getGreen(),
12204 # protocolor.getBlue(),
12205 # alpha);
12206 # }
12207 #
12208 # public static Color toProto(java.awt.Color color) {
12209 # float red = (float) color.getRed();
12210 # float green = (float) color.getGreen();
12211 # float blue = (float) color.getBlue();
12212 # float denominator = 255.0;
12213 # Color.Builder resultBuilder =
12214 # Color
12215 # .newBuilder()
12216 # .setRed(red / denominator)
12217 # .setGreen(green / denominator)
12218 # .setBlue(blue / denominator);
12219 # int alpha = color.getAlpha();
12220 # if (alpha != 255) {
12221 # result.setAlpha(
12222 # FloatValue
12223 # .newBuilder()
12224 # .setValue(((float) alpha) / denominator)
12225 # .build());
12226 # }
12227 # return resultBuilder.build();
12228 # }
12229 # // ...
12230 #
12231 # Example (iOS / Obj-C):
12232 #
12233 # // ...
12234 # static UIColor* fromProto(Color* protocolor) {
12235 # float red = [protocolor red];
12236 # float green = [protocolor green];
12237 # float blue = [protocolor blue];
12238 # FloatValue* alpha_wrapper = [protocolor alpha];
12239 # float alpha = 1.0;
12240 # if (alpha_wrapper != nil) {
12241 # alpha = [alpha_wrapper value];
12242 # }
12243 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
12244 # }
12245 #
12246 # static Color* toProto(UIColor* color) {
12247 # CGFloat red, green, blue, alpha;
12248 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
12249 # return nil;
12250 # }
12251 # Color* result = [Color alloc] init];
12252 # [result setRed:red];
12253 # [result setGreen:green];
12254 # [result setBlue:blue];
12255 # if (alpha <= 0.9999) {
12256 # [result setAlpha:floatWrapperWithValue(alpha)];
12257 # }
12258 # [result autorelease];
12259 # return result;
12260 # }
12261 # // ...
12262 #
12263 # Example (JavaScript):
12264 #
12265 # // ...
12266 #
12267 # var protoToCssColor = function(rgb_color) {
12268 # var redFrac = rgb_color.red || 0.0;
12269 # var greenFrac = rgb_color.green || 0.0;
12270 # var blueFrac = rgb_color.blue || 0.0;
12271 # var red = Math.floor(redFrac * 255);
12272 # var green = Math.floor(greenFrac * 255);
12273 # var blue = Math.floor(blueFrac * 255);
12274 #
12275 # if (!('alpha' in rgb_color)) {
12276 # return rgbToCssColor_(red, green, blue);
12277 # }
12278 #
12279 # var alphaFrac = rgb_color.alpha.value || 0.0;
12280 # var rgbParams = [red, green, blue].join(',');
12281 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
12282 # };
12283 #
12284 # var rgbToCssColor_ = function(red, green, blue) {
12285 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
12286 # var hexString = rgbNumber.toString(16);
12287 # var missingZeros = 6 - hexString.length;
12288 # var resultBuilder = ['#'];
12289 # for (var i = 0; i < missingZeros; i++) {
12290 # resultBuilder.push('0');
12291 # }
12292 # resultBuilder.push(hexString);
12293 # return resultBuilder.join('');
12294 # };
12295 #
12296 # // ...
12297 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
12298 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
12299 # the final pixel color is defined by the equation:
12300 #
12301 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
12302 #
12303 # This means that a value of 1.0 corresponds to a solid color, whereas
12304 # a value of 0.0 corresponds to a completely transparent color. This
12305 # uses a wrapper message rather than a simple float scalar so that it is
12306 # possible to distinguish between a default value and the value being unset.
12307 # If omitted, this color object is to be rendered as a solid color
12308 # (as if the alpha value had been explicitly given with a value of 1.0).
12309 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
12310 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
12311 },
12312 "width": 42, # The width of the border, in pixels.
12313 # Border widths must be between 0 and 3 pixels.
12314 "style": "A String", # The style of the border.
12315 },
12316 "top": { # A border along a cell. # The border to put at the top of the range.
12317 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
12318 # for simplicity of conversion to/from color representations in various
12319 # languages over compactness; for example, the fields of this representation
12320 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
12321 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
12322 # method in iOS; and, with just a little work, it can be easily formatted into
12323 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
12324 #
12325 # Example (Java):
12326 #
12327 # import com.google.type.Color;
12328 #
12329 # // ...
12330 # public static java.awt.Color fromProto(Color protocolor) {
12331 # float alpha = protocolor.hasAlpha()
12332 # ? protocolor.getAlpha().getValue()
12333 # : 1.0;
12334 #
12335 # return new java.awt.Color(
12336 # protocolor.getRed(),
12337 # protocolor.getGreen(),
12338 # protocolor.getBlue(),
12339 # alpha);
12340 # }
12341 #
12342 # public static Color toProto(java.awt.Color color) {
12343 # float red = (float) color.getRed();
12344 # float green = (float) color.getGreen();
12345 # float blue = (float) color.getBlue();
12346 # float denominator = 255.0;
12347 # Color.Builder resultBuilder =
12348 # Color
12349 # .newBuilder()
12350 # .setRed(red / denominator)
12351 # .setGreen(green / denominator)
12352 # .setBlue(blue / denominator);
12353 # int alpha = color.getAlpha();
12354 # if (alpha != 255) {
12355 # result.setAlpha(
12356 # FloatValue
12357 # .newBuilder()
12358 # .setValue(((float) alpha) / denominator)
12359 # .build());
12360 # }
12361 # return resultBuilder.build();
12362 # }
12363 # // ...
12364 #
12365 # Example (iOS / Obj-C):
12366 #
12367 # // ...
12368 # static UIColor* fromProto(Color* protocolor) {
12369 # float red = [protocolor red];
12370 # float green = [protocolor green];
12371 # float blue = [protocolor blue];
12372 # FloatValue* alpha_wrapper = [protocolor alpha];
12373 # float alpha = 1.0;
12374 # if (alpha_wrapper != nil) {
12375 # alpha = [alpha_wrapper value];
12376 # }
12377 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
12378 # }
12379 #
12380 # static Color* toProto(UIColor* color) {
12381 # CGFloat red, green, blue, alpha;
12382 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
12383 # return nil;
12384 # }
12385 # Color* result = [Color alloc] init];
12386 # [result setRed:red];
12387 # [result setGreen:green];
12388 # [result setBlue:blue];
12389 # if (alpha <= 0.9999) {
12390 # [result setAlpha:floatWrapperWithValue(alpha)];
12391 # }
12392 # [result autorelease];
12393 # return result;
12394 # }
12395 # // ...
12396 #
12397 # Example (JavaScript):
12398 #
12399 # // ...
12400 #
12401 # var protoToCssColor = function(rgb_color) {
12402 # var redFrac = rgb_color.red || 0.0;
12403 # var greenFrac = rgb_color.green || 0.0;
12404 # var blueFrac = rgb_color.blue || 0.0;
12405 # var red = Math.floor(redFrac * 255);
12406 # var green = Math.floor(greenFrac * 255);
12407 # var blue = Math.floor(blueFrac * 255);
12408 #
12409 # if (!('alpha' in rgb_color)) {
12410 # return rgbToCssColor_(red, green, blue);
12411 # }
12412 #
12413 # var alphaFrac = rgb_color.alpha.value || 0.0;
12414 # var rgbParams = [red, green, blue].join(',');
12415 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
12416 # };
12417 #
12418 # var rgbToCssColor_ = function(red, green, blue) {
12419 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
12420 # var hexString = rgbNumber.toString(16);
12421 # var missingZeros = 6 - hexString.length;
12422 # var resultBuilder = ['#'];
12423 # for (var i = 0; i < missingZeros; i++) {
12424 # resultBuilder.push('0');
12425 # }
12426 # resultBuilder.push(hexString);
12427 # return resultBuilder.join('');
12428 # };
12429 #
12430 # // ...
12431 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
12432 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
12433 # the final pixel color is defined by the equation:
12434 #
12435 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
12436 #
12437 # This means that a value of 1.0 corresponds to a solid color, whereas
12438 # a value of 0.0 corresponds to a completely transparent color. This
12439 # uses a wrapper message rather than a simple float scalar so that it is
12440 # possible to distinguish between a default value and the value being unset.
12441 # If omitted, this color object is to be rendered as a solid color
12442 # (as if the alpha value had been explicitly given with a value of 1.0).
12443 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
12444 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
12445 },
12446 "width": 42, # The width of the border, in pixels.
12447 # Border widths must be between 0 and 3 pixels.
12448 "style": "A String", # The style of the border.
12449 },
12450 "innerHorizontal": { # A border along a cell. # The horizontal border to put within the range.
12451 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
12452 # for simplicity of conversion to/from color representations in various
12453 # languages over compactness; for example, the fields of this representation
12454 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
12455 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
12456 # method in iOS; and, with just a little work, it can be easily formatted into
12457 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
12458 #
12459 # Example (Java):
12460 #
12461 # import com.google.type.Color;
12462 #
12463 # // ...
12464 # public static java.awt.Color fromProto(Color protocolor) {
12465 # float alpha = protocolor.hasAlpha()
12466 # ? protocolor.getAlpha().getValue()
12467 # : 1.0;
12468 #
12469 # return new java.awt.Color(
12470 # protocolor.getRed(),
12471 # protocolor.getGreen(),
12472 # protocolor.getBlue(),
12473 # alpha);
12474 # }
12475 #
12476 # public static Color toProto(java.awt.Color color) {
12477 # float red = (float) color.getRed();
12478 # float green = (float) color.getGreen();
12479 # float blue = (float) color.getBlue();
12480 # float denominator = 255.0;
12481 # Color.Builder resultBuilder =
12482 # Color
12483 # .newBuilder()
12484 # .setRed(red / denominator)
12485 # .setGreen(green / denominator)
12486 # .setBlue(blue / denominator);
12487 # int alpha = color.getAlpha();
12488 # if (alpha != 255) {
12489 # result.setAlpha(
12490 # FloatValue
12491 # .newBuilder()
12492 # .setValue(((float) alpha) / denominator)
12493 # .build());
12494 # }
12495 # return resultBuilder.build();
12496 # }
12497 # // ...
12498 #
12499 # Example (iOS / Obj-C):
12500 #
12501 # // ...
12502 # static UIColor* fromProto(Color* protocolor) {
12503 # float red = [protocolor red];
12504 # float green = [protocolor green];
12505 # float blue = [protocolor blue];
12506 # FloatValue* alpha_wrapper = [protocolor alpha];
12507 # float alpha = 1.0;
12508 # if (alpha_wrapper != nil) {
12509 # alpha = [alpha_wrapper value];
12510 # }
12511 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
12512 # }
12513 #
12514 # static Color* toProto(UIColor* color) {
12515 # CGFloat red, green, blue, alpha;
12516 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
12517 # return nil;
12518 # }
12519 # Color* result = [Color alloc] init];
12520 # [result setRed:red];
12521 # [result setGreen:green];
12522 # [result setBlue:blue];
12523 # if (alpha <= 0.9999) {
12524 # [result setAlpha:floatWrapperWithValue(alpha)];
12525 # }
12526 # [result autorelease];
12527 # return result;
12528 # }
12529 # // ...
12530 #
12531 # Example (JavaScript):
12532 #
12533 # // ...
12534 #
12535 # var protoToCssColor = function(rgb_color) {
12536 # var redFrac = rgb_color.red || 0.0;
12537 # var greenFrac = rgb_color.green || 0.0;
12538 # var blueFrac = rgb_color.blue || 0.0;
12539 # var red = Math.floor(redFrac * 255);
12540 # var green = Math.floor(greenFrac * 255);
12541 # var blue = Math.floor(blueFrac * 255);
12542 #
12543 # if (!('alpha' in rgb_color)) {
12544 # return rgbToCssColor_(red, green, blue);
12545 # }
12546 #
12547 # var alphaFrac = rgb_color.alpha.value || 0.0;
12548 # var rgbParams = [red, green, blue].join(',');
12549 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
12550 # };
12551 #
12552 # var rgbToCssColor_ = function(red, green, blue) {
12553 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
12554 # var hexString = rgbNumber.toString(16);
12555 # var missingZeros = 6 - hexString.length;
12556 # var resultBuilder = ['#'];
12557 # for (var i = 0; i < missingZeros; i++) {
12558 # resultBuilder.push('0');
12559 # }
12560 # resultBuilder.push(hexString);
12561 # return resultBuilder.join('');
12562 # };
12563 #
12564 # // ...
12565 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
12566 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
12567 # the final pixel color is defined by the equation:
12568 #
12569 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
12570 #
12571 # This means that a value of 1.0 corresponds to a solid color, whereas
12572 # a value of 0.0 corresponds to a completely transparent color. This
12573 # uses a wrapper message rather than a simple float scalar so that it is
12574 # possible to distinguish between a default value and the value being unset.
12575 # If omitted, this color object is to be rendered as a solid color
12576 # (as if the alpha value had been explicitly given with a value of 1.0).
12577 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
12578 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
12579 },
12580 "width": 42, # The width of the border, in pixels.
12581 # Border widths must be between 0 and 3 pixels.
12582 "style": "A String", # The style of the border.
12583 },
12584 "range": { # A range on a sheet. # The range whose borders should be updated.
12585 # All indexes are zero-based.
12586 # Indexes are half open, e.g the start index is inclusive
12587 # and the end index is exclusive -- [start_index, end_index).
12588 # Missing indexes indicate the range is unbounded on that side.
12589 #
12590 # For example, if "Sheet1" is grid ID 0, then:
12591 #
12592 # Sheet1!A1:A1 == sheet_id: 0,
12593 # start_row_index: 0, end_row_index: 1,
12594 # start_column_index: 0, end_column_index: 1
12595 #
12596 # Sheet1!A3:B4 == sheet_id: 0,
12597 # start_row_index: 2, end_row_index: 4,
12598 # start_column_index: 0, end_column_index: 2
12599 #
12600 # Sheet1!A:B == sheet_id: 0,
12601 # start_column_index: 0, end_column_index: 2
12602 #
12603 # Sheet1!A5:B == sheet_id: 0,
12604 # start_row_index: 4,
12605 # start_column_index: 0, end_column_index: 2
12606 #
12607 # Sheet1 == sheet_id:0
12608 #
12609 # The start index must always be less than or equal to the end index.
12610 # If the start index equals the end index, then the range is empty.
12611 # Empty ranges are typically not meaningful and are usually rendered in the
12612 # UI as `#REF!`.
12613 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
12614 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
12615 "sheetId": 42, # The sheet this range is on.
12616 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
12617 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
12618 },
12619 "innerVertical": { # A border along a cell. # The vertical border to put within the range.
12620 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
12621 # for simplicity of conversion to/from color representations in various
12622 # languages over compactness; for example, the fields of this representation
12623 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
12624 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
12625 # method in iOS; and, with just a little work, it can be easily formatted into
12626 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
12627 #
12628 # Example (Java):
12629 #
12630 # import com.google.type.Color;
12631 #
12632 # // ...
12633 # public static java.awt.Color fromProto(Color protocolor) {
12634 # float alpha = protocolor.hasAlpha()
12635 # ? protocolor.getAlpha().getValue()
12636 # : 1.0;
12637 #
12638 # return new java.awt.Color(
12639 # protocolor.getRed(),
12640 # protocolor.getGreen(),
12641 # protocolor.getBlue(),
12642 # alpha);
12643 # }
12644 #
12645 # public static Color toProto(java.awt.Color color) {
12646 # float red = (float) color.getRed();
12647 # float green = (float) color.getGreen();
12648 # float blue = (float) color.getBlue();
12649 # float denominator = 255.0;
12650 # Color.Builder resultBuilder =
12651 # Color
12652 # .newBuilder()
12653 # .setRed(red / denominator)
12654 # .setGreen(green / denominator)
12655 # .setBlue(blue / denominator);
12656 # int alpha = color.getAlpha();
12657 # if (alpha != 255) {
12658 # result.setAlpha(
12659 # FloatValue
12660 # .newBuilder()
12661 # .setValue(((float) alpha) / denominator)
12662 # .build());
12663 # }
12664 # return resultBuilder.build();
12665 # }
12666 # // ...
12667 #
12668 # Example (iOS / Obj-C):
12669 #
12670 # // ...
12671 # static UIColor* fromProto(Color* protocolor) {
12672 # float red = [protocolor red];
12673 # float green = [protocolor green];
12674 # float blue = [protocolor blue];
12675 # FloatValue* alpha_wrapper = [protocolor alpha];
12676 # float alpha = 1.0;
12677 # if (alpha_wrapper != nil) {
12678 # alpha = [alpha_wrapper value];
12679 # }
12680 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
12681 # }
12682 #
12683 # static Color* toProto(UIColor* color) {
12684 # CGFloat red, green, blue, alpha;
12685 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
12686 # return nil;
12687 # }
12688 # Color* result = [Color alloc] init];
12689 # [result setRed:red];
12690 # [result setGreen:green];
12691 # [result setBlue:blue];
12692 # if (alpha <= 0.9999) {
12693 # [result setAlpha:floatWrapperWithValue(alpha)];
12694 # }
12695 # [result autorelease];
12696 # return result;
12697 # }
12698 # // ...
12699 #
12700 # Example (JavaScript):
12701 #
12702 # // ...
12703 #
12704 # var protoToCssColor = function(rgb_color) {
12705 # var redFrac = rgb_color.red || 0.0;
12706 # var greenFrac = rgb_color.green || 0.0;
12707 # var blueFrac = rgb_color.blue || 0.0;
12708 # var red = Math.floor(redFrac * 255);
12709 # var green = Math.floor(greenFrac * 255);
12710 # var blue = Math.floor(blueFrac * 255);
12711 #
12712 # if (!('alpha' in rgb_color)) {
12713 # return rgbToCssColor_(red, green, blue);
12714 # }
12715 #
12716 # var alphaFrac = rgb_color.alpha.value || 0.0;
12717 # var rgbParams = [red, green, blue].join(',');
12718 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
12719 # };
12720 #
12721 # var rgbToCssColor_ = function(red, green, blue) {
12722 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
12723 # var hexString = rgbNumber.toString(16);
12724 # var missingZeros = 6 - hexString.length;
12725 # var resultBuilder = ['#'];
12726 # for (var i = 0; i < missingZeros; i++) {
12727 # resultBuilder.push('0');
12728 # }
12729 # resultBuilder.push(hexString);
12730 # return resultBuilder.join('');
12731 # };
12732 #
12733 # // ...
12734 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
12735 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
12736 # the final pixel color is defined by the equation:
12737 #
12738 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
12739 #
12740 # This means that a value of 1.0 corresponds to a solid color, whereas
12741 # a value of 0.0 corresponds to a completely transparent color. This
12742 # uses a wrapper message rather than a simple float scalar so that it is
12743 # possible to distinguish between a default value and the value being unset.
12744 # If omitted, this color object is to be rendered as a solid color
12745 # (as if the alpha value had been explicitly given with a value of 1.0).
12746 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
12747 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
12748 },
12749 "width": 42, # The width of the border, in pixels.
12750 # Border widths must be between 0 and 3 pixels.
12751 "style": "A String", # The style of the border.
12752 },
12753 "left": { # A border along a cell. # The border to put at the left of the range.
12754 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
12755 # for simplicity of conversion to/from color representations in various
12756 # languages over compactness; for example, the fields of this representation
12757 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
12758 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
12759 # method in iOS; and, with just a little work, it can be easily formatted into
12760 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
12761 #
12762 # Example (Java):
12763 #
12764 # import com.google.type.Color;
12765 #
12766 # // ...
12767 # public static java.awt.Color fromProto(Color protocolor) {
12768 # float alpha = protocolor.hasAlpha()
12769 # ? protocolor.getAlpha().getValue()
12770 # : 1.0;
12771 #
12772 # return new java.awt.Color(
12773 # protocolor.getRed(),
12774 # protocolor.getGreen(),
12775 # protocolor.getBlue(),
12776 # alpha);
12777 # }
12778 #
12779 # public static Color toProto(java.awt.Color color) {
12780 # float red = (float) color.getRed();
12781 # float green = (float) color.getGreen();
12782 # float blue = (float) color.getBlue();
12783 # float denominator = 255.0;
12784 # Color.Builder resultBuilder =
12785 # Color
12786 # .newBuilder()
12787 # .setRed(red / denominator)
12788 # .setGreen(green / denominator)
12789 # .setBlue(blue / denominator);
12790 # int alpha = color.getAlpha();
12791 # if (alpha != 255) {
12792 # result.setAlpha(
12793 # FloatValue
12794 # .newBuilder()
12795 # .setValue(((float) alpha) / denominator)
12796 # .build());
12797 # }
12798 # return resultBuilder.build();
12799 # }
12800 # // ...
12801 #
12802 # Example (iOS / Obj-C):
12803 #
12804 # // ...
12805 # static UIColor* fromProto(Color* protocolor) {
12806 # float red = [protocolor red];
12807 # float green = [protocolor green];
12808 # float blue = [protocolor blue];
12809 # FloatValue* alpha_wrapper = [protocolor alpha];
12810 # float alpha = 1.0;
12811 # if (alpha_wrapper != nil) {
12812 # alpha = [alpha_wrapper value];
12813 # }
12814 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
12815 # }
12816 #
12817 # static Color* toProto(UIColor* color) {
12818 # CGFloat red, green, blue, alpha;
12819 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
12820 # return nil;
12821 # }
12822 # Color* result = [Color alloc] init];
12823 # [result setRed:red];
12824 # [result setGreen:green];
12825 # [result setBlue:blue];
12826 # if (alpha <= 0.9999) {
12827 # [result setAlpha:floatWrapperWithValue(alpha)];
12828 # }
12829 # [result autorelease];
12830 # return result;
12831 # }
12832 # // ...
12833 #
12834 # Example (JavaScript):
12835 #
12836 # // ...
12837 #
12838 # var protoToCssColor = function(rgb_color) {
12839 # var redFrac = rgb_color.red || 0.0;
12840 # var greenFrac = rgb_color.green || 0.0;
12841 # var blueFrac = rgb_color.blue || 0.0;
12842 # var red = Math.floor(redFrac * 255);
12843 # var green = Math.floor(greenFrac * 255);
12844 # var blue = Math.floor(blueFrac * 255);
12845 #
12846 # if (!('alpha' in rgb_color)) {
12847 # return rgbToCssColor_(red, green, blue);
12848 # }
12849 #
12850 # var alphaFrac = rgb_color.alpha.value || 0.0;
12851 # var rgbParams = [red, green, blue].join(',');
12852 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
12853 # };
12854 #
12855 # var rgbToCssColor_ = function(red, green, blue) {
12856 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
12857 # var hexString = rgbNumber.toString(16);
12858 # var missingZeros = 6 - hexString.length;
12859 # var resultBuilder = ['#'];
12860 # for (var i = 0; i < missingZeros; i++) {
12861 # resultBuilder.push('0');
12862 # }
12863 # resultBuilder.push(hexString);
12864 # return resultBuilder.join('');
12865 # };
12866 #
12867 # // ...
12868 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
12869 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
12870 # the final pixel color is defined by the equation:
12871 #
12872 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
12873 #
12874 # This means that a value of 1.0 corresponds to a solid color, whereas
12875 # a value of 0.0 corresponds to a completely transparent color. This
12876 # uses a wrapper message rather than a simple float scalar so that it is
12877 # possible to distinguish between a default value and the value being unset.
12878 # If omitted, this color object is to be rendered as a solid color
12879 # (as if the alpha value had been explicitly given with a value of 1.0).
12880 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
12881 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
12882 },
12883 "width": 42, # The width of the border, in pixels.
12884 # Border widths must be between 0 and 3 pixels.
12885 "style": "A String", # The style of the border.
12886 },
12887 },
12888 "cutPaste": { # Moves data from the source to the destination. # Cuts data from one area and pastes it to another.
12889 "pasteType": "A String", # What kind of data to paste. All the source data will be cut, regardless
12890 # of what is pasted.
12891 "source": { # A range on a sheet. # The source data to cut.
12892 # All indexes are zero-based.
12893 # Indexes are half open, e.g the start index is inclusive
12894 # and the end index is exclusive -- [start_index, end_index).
12895 # Missing indexes indicate the range is unbounded on that side.
12896 #
12897 # For example, if "Sheet1" is grid ID 0, then:
12898 #
12899 # Sheet1!A1:A1 == sheet_id: 0,
12900 # start_row_index: 0, end_row_index: 1,
12901 # start_column_index: 0, end_column_index: 1
12902 #
12903 # Sheet1!A3:B4 == sheet_id: 0,
12904 # start_row_index: 2, end_row_index: 4,
12905 # start_column_index: 0, end_column_index: 2
12906 #
12907 # Sheet1!A:B == sheet_id: 0,
12908 # start_column_index: 0, end_column_index: 2
12909 #
12910 # Sheet1!A5:B == sheet_id: 0,
12911 # start_row_index: 4,
12912 # start_column_index: 0, end_column_index: 2
12913 #
12914 # Sheet1 == sheet_id:0
12915 #
12916 # The start index must always be less than or equal to the end index.
12917 # If the start index equals the end index, then the range is empty.
12918 # Empty ranges are typically not meaningful and are usually rendered in the
12919 # UI as `#REF!`.
12920 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
12921 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
12922 "sheetId": 42, # The sheet this range is on.
12923 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
12924 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
12925 },
12926 "destination": { # A coordinate in a sheet. # The top-left coordinate where the data should be pasted.
12927 # All indexes are zero-based.
12928 "rowIndex": 42, # The row index of the coordinate.
12929 "columnIndex": 42, # The column index of the coordinate.
12930 "sheetId": 42, # The sheet this coordinate is on.
12931 },
12932 },
12933 "copyPaste": { # Copies data from the source to the destination. # Copies data from one area and pastes it to another.
12934 "pasteType": "A String", # What kind of data to paste.
12935 "source": { # A range on a sheet. # The source range to copy.
12936 # All indexes are zero-based.
12937 # Indexes are half open, e.g the start index is inclusive
12938 # and the end index is exclusive -- [start_index, end_index).
12939 # Missing indexes indicate the range is unbounded on that side.
12940 #
12941 # For example, if "Sheet1" is grid ID 0, then:
12942 #
12943 # Sheet1!A1:A1 == sheet_id: 0,
12944 # start_row_index: 0, end_row_index: 1,
12945 # start_column_index: 0, end_column_index: 1
12946 #
12947 # Sheet1!A3:B4 == sheet_id: 0,
12948 # start_row_index: 2, end_row_index: 4,
12949 # start_column_index: 0, end_column_index: 2
12950 #
12951 # Sheet1!A:B == sheet_id: 0,
12952 # start_column_index: 0, end_column_index: 2
12953 #
12954 # Sheet1!A5:B == sheet_id: 0,
12955 # start_row_index: 4,
12956 # start_column_index: 0, end_column_index: 2
12957 #
12958 # Sheet1 == sheet_id:0
12959 #
12960 # The start index must always be less than or equal to the end index.
12961 # If the start index equals the end index, then the range is empty.
12962 # Empty ranges are typically not meaningful and are usually rendered in the
12963 # UI as `#REF!`.
12964 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
12965 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
12966 "sheetId": 42, # The sheet this range is on.
12967 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
12968 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
12969 },
12970 "destination": { # A range on a sheet. # The location to paste to. If the range covers a span that's
12971 # a multiple of the source's height or width, then the
12972 # data will be repeated to fill in the destination range.
12973 # If the range is smaller than the source range, the entire
12974 # source data will still be copied (beyond the end of the destination range).
12975 # All indexes are zero-based.
12976 # Indexes are half open, e.g the start index is inclusive
12977 # and the end index is exclusive -- [start_index, end_index).
12978 # Missing indexes indicate the range is unbounded on that side.
12979 #
12980 # For example, if "Sheet1" is grid ID 0, then:
12981 #
12982 # Sheet1!A1:A1 == sheet_id: 0,
12983 # start_row_index: 0, end_row_index: 1,
12984 # start_column_index: 0, end_column_index: 1
12985 #
12986 # Sheet1!A3:B4 == sheet_id: 0,
12987 # start_row_index: 2, end_row_index: 4,
12988 # start_column_index: 0, end_column_index: 2
12989 #
12990 # Sheet1!A:B == sheet_id: 0,
12991 # start_column_index: 0, end_column_index: 2
12992 #
12993 # Sheet1!A5:B == sheet_id: 0,
12994 # start_row_index: 4,
12995 # start_column_index: 0, end_column_index: 2
12996 #
12997 # Sheet1 == sheet_id:0
12998 #
12999 # The start index must always be less than or equal to the end index.
13000 # If the start index equals the end index, then the range is empty.
13001 # Empty ranges are typically not meaningful and are usually rendered in the
13002 # UI as `#REF!`.
13003 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
13004 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
13005 "sheetId": 42, # The sheet this range is on.
13006 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
13007 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
13008 },
13009 "pasteOrientation": "A String", # How that data should be oriented when pasting.
13010 },
13011 "addSheet": { # Adds a new sheet. # Adds a sheet.
13012 # When a sheet is added at a given index,
13013 # all subsequent sheets' indexes are incremented.
13014 # To add an object sheet, use AddChartRequest instead.
13015 "properties": { # Properties of a sheet. # The properties the new sheet should have.
13016 # All properties are optional.
13017 # If a sheetId
13018 # is specified, the sheet will use that ID.
13019 # (It is an error to specify the ID of a sheet that already exists.)
13020 "sheetType": "A String", # The type of sheet. Defaults to GRID.
13021 # This field cannot be changed once set.
13022 "index": 42, # The index of the sheet within the spreadsheet.
13023 # When adding or updating sheet properties, if this field
13024 # is excluded then the sheet will be added or moved to the end
13025 # of the sheet list.
13026 "title": "A String", # The name of the sheet.
13027 "gridProperties": { # Properties of a grid. # Additional properties of the sheet if this sheet is a grid.
13028 # (If the sheet is an object sheet, containing a chart or image, then
13029 # this field will be absent.)
13030 # When writing it is an error to set any grid properties on non-grid sheets.
13031 "columnCount": 42, # The number of columns in the grid.
13032 "rowCount": 42, # The number of rows in the grid.
13033 "frozenColumnCount": 42, # The number of columns that are frozen in the grid.
13034 "hideGridlines": True or False, # True if the grid isn't showing gridlines in the UI.
13035 "frozenRowCount": 42, # The number of rows that are frozen in the grid.
13036 },
13037 "rightToLeft": True or False, # True if the sheet is an RTL sheet instead of an LTR sheet.
13038 "tabColor": { # Represents a color in the RGBA color space. This representation is designed # The color of the tab in the UI.
13039 # for simplicity of conversion to/from color representations in various
13040 # languages over compactness; for example, the fields of this representation
13041 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
13042 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
13043 # method in iOS; and, with just a little work, it can be easily formatted into
13044 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
13045 #
13046 # Example (Java):
13047 #
13048 # import com.google.type.Color;
13049 #
13050 # // ...
13051 # public static java.awt.Color fromProto(Color protocolor) {
13052 # float alpha = protocolor.hasAlpha()
13053 # ? protocolor.getAlpha().getValue()
13054 # : 1.0;
13055 #
13056 # return new java.awt.Color(
13057 # protocolor.getRed(),
13058 # protocolor.getGreen(),
13059 # protocolor.getBlue(),
13060 # alpha);
13061 # }
13062 #
13063 # public static Color toProto(java.awt.Color color) {
13064 # float red = (float) color.getRed();
13065 # float green = (float) color.getGreen();
13066 # float blue = (float) color.getBlue();
13067 # float denominator = 255.0;
13068 # Color.Builder resultBuilder =
13069 # Color
13070 # .newBuilder()
13071 # .setRed(red / denominator)
13072 # .setGreen(green / denominator)
13073 # .setBlue(blue / denominator);
13074 # int alpha = color.getAlpha();
13075 # if (alpha != 255) {
13076 # result.setAlpha(
13077 # FloatValue
13078 # .newBuilder()
13079 # .setValue(((float) alpha) / denominator)
13080 # .build());
13081 # }
13082 # return resultBuilder.build();
13083 # }
13084 # // ...
13085 #
13086 # Example (iOS / Obj-C):
13087 #
13088 # // ...
13089 # static UIColor* fromProto(Color* protocolor) {
13090 # float red = [protocolor red];
13091 # float green = [protocolor green];
13092 # float blue = [protocolor blue];
13093 # FloatValue* alpha_wrapper = [protocolor alpha];
13094 # float alpha = 1.0;
13095 # if (alpha_wrapper != nil) {
13096 # alpha = [alpha_wrapper value];
13097 # }
13098 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
13099 # }
13100 #
13101 # static Color* toProto(UIColor* color) {
13102 # CGFloat red, green, blue, alpha;
13103 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
13104 # return nil;
13105 # }
13106 # Color* result = [Color alloc] init];
13107 # [result setRed:red];
13108 # [result setGreen:green];
13109 # [result setBlue:blue];
13110 # if (alpha <= 0.9999) {
13111 # [result setAlpha:floatWrapperWithValue(alpha)];
13112 # }
13113 # [result autorelease];
13114 # return result;
13115 # }
13116 # // ...
13117 #
13118 # Example (JavaScript):
13119 #
13120 # // ...
13121 #
13122 # var protoToCssColor = function(rgb_color) {
13123 # var redFrac = rgb_color.red || 0.0;
13124 # var greenFrac = rgb_color.green || 0.0;
13125 # var blueFrac = rgb_color.blue || 0.0;
13126 # var red = Math.floor(redFrac * 255);
13127 # var green = Math.floor(greenFrac * 255);
13128 # var blue = Math.floor(blueFrac * 255);
13129 #
13130 # if (!('alpha' in rgb_color)) {
13131 # return rgbToCssColor_(red, green, blue);
13132 # }
13133 #
13134 # var alphaFrac = rgb_color.alpha.value || 0.0;
13135 # var rgbParams = [red, green, blue].join(',');
13136 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
13137 # };
13138 #
13139 # var rgbToCssColor_ = function(red, green, blue) {
13140 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
13141 # var hexString = rgbNumber.toString(16);
13142 # var missingZeros = 6 - hexString.length;
13143 # var resultBuilder = ['#'];
13144 # for (var i = 0; i < missingZeros; i++) {
13145 # resultBuilder.push('0');
13146 # }
13147 # resultBuilder.push(hexString);
13148 # return resultBuilder.join('');
13149 # };
13150 #
13151 # // ...
13152 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
13153 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
13154 # the final pixel color is defined by the equation:
13155 #
13156 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
13157 #
13158 # This means that a value of 1.0 corresponds to a solid color, whereas
13159 # a value of 0.0 corresponds to a completely transparent color. This
13160 # uses a wrapper message rather than a simple float scalar so that it is
13161 # possible to distinguish between a default value and the value being unset.
13162 # If omitted, this color object is to be rendered as a solid color
13163 # (as if the alpha value had been explicitly given with a value of 1.0).
13164 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
13165 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
13166 },
13167 "hidden": True or False, # True if the sheet is hidden in the UI, false if it's visible.
13168 "sheetId": 42, # The ID of the sheet. Must be non-negative.
13169 # This field cannot be changed once set.
13170 },
13171 },
13172 "deleteNamedRange": { # Removes the named range with the given ID from the spreadsheet. # Deletes a named range.
13173 "namedRangeId": "A String", # The ID of the named range to delete.
13174 },
13175 "updateNamedRange": { # Updates properties of the named range with the specified # Updates a named range.
13176 # namedRangeId.
13177 # It is an error to specify read only fields in the field mask.
13178 "fields": "A String", # The fields that should be updated. At least one field must be specified.
13179 # The root `namedRange` is implied and should not be specified.
13180 # A single `"*"` can be used as short-hand for listing every field.
13181 "namedRange": { # A named range. # The named range to update with the new properties.
13182 "namedRangeId": "A String", # The ID of the named range.
13183 "range": { # A range on a sheet. # The range this represents.
13184 # All indexes are zero-based.
13185 # Indexes are half open, e.g the start index is inclusive
13186 # and the end index is exclusive -- [start_index, end_index).
13187 # Missing indexes indicate the range is unbounded on that side.
13188 #
13189 # For example, if "Sheet1" is grid ID 0, then:
13190 #
13191 # Sheet1!A1:A1 == sheet_id: 0,
13192 # start_row_index: 0, end_row_index: 1,
13193 # start_column_index: 0, end_column_index: 1
13194 #
13195 # Sheet1!A3:B4 == sheet_id: 0,
13196 # start_row_index: 2, end_row_index: 4,
13197 # start_column_index: 0, end_column_index: 2
13198 #
13199 # Sheet1!A:B == sheet_id: 0,
13200 # start_column_index: 0, end_column_index: 2
13201 #
13202 # Sheet1!A5:B == sheet_id: 0,
13203 # start_row_index: 4,
13204 # start_column_index: 0, end_column_index: 2
13205 #
13206 # Sheet1 == sheet_id:0
13207 #
13208 # The start index must always be less than or equal to the end index.
13209 # If the start index equals the end index, then the range is empty.
13210 # Empty ranges are typically not meaningful and are usually rendered in the
13211 # UI as `#REF!`.
13212 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
13213 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
13214 "sheetId": 42, # The sheet this range is on.
13215 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
13216 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
13217 },
13218 "name": "A String", # The name of the named range.
13219 },
13220 },
13221 "insertDimension": { # Inserts rows or columns in a sheet at a particular index. # Inserts new rows or columns in a sheet.
13222 "inheritFromBefore": True or False, # Whether dimension properties should be extended from the dimensions
13223 # before or after the newly inserted dimensions.
13224 # True to inherit from the dimensions before (in which case the start
13225 # index must be greater than 0), and false to inherit from the dimensions
13226 # after.
13227 #
13228 # For example, if row index 0 has red background and row index 1
13229 # has a green background, then inserting 2 rows at index 1 can inherit
13230 # either the green or red background. If `inheritFromBefore` is true,
13231 # the two new rows will be red (because the row before the insertion point
13232 # was red), whereas if `inheritFromBefore` is false, the two new rows will
13233 # be green (because the rows after the insertion point were green).
13234 "range": { # A range along a single dimension on a sheet. # The dimensions to insert. Both the start and end indexes must be bounded.
13235 # All indexes are zero-based.
13236 # Indexes are half open: the start index is inclusive
13237 # and the end index is exclusive.
13238 # Missing indexes indicate the range is unbounded on that side.
13239 "endIndex": 42, # The end (exclusive) of the span, or not set if unbounded.
13240 "startIndex": 42, # The start (inclusive) of the span, or not set if unbounded.
13241 "sheetId": 42, # The sheet this span is on.
13242 "dimension": "A String", # The dimension of the span.
13243 },
13244 },
13245 "updateFilterView": { # Updates properties of the filter view. # Updates the properties of a filter view.
13246 "filter": { # A filter view. # The new properties of the filter view.
13247 "title": "A String", # The name of the filter view.
13248 "namedRangeId": "A String", # The named range this filter view is backed by, if any.
13249 #
13250 # When writing, only one of range or namedRangeId
13251 # may be set.
13252 "filterViewId": 42, # The ID of the filter view.
13253 "range": { # A range on a sheet. # The range this filter view covers.
13254 #
13255 # When writing, only one of range or namedRangeId
13256 # may be set.
13257 # All indexes are zero-based.
13258 # Indexes are half open, e.g the start index is inclusive
13259 # and the end index is exclusive -- [start_index, end_index).
13260 # Missing indexes indicate the range is unbounded on that side.
13261 #
13262 # For example, if "Sheet1" is grid ID 0, then:
13263 #
13264 # Sheet1!A1:A1 == sheet_id: 0,
13265 # start_row_index: 0, end_row_index: 1,
13266 # start_column_index: 0, end_column_index: 1
13267 #
13268 # Sheet1!A3:B4 == sheet_id: 0,
13269 # start_row_index: 2, end_row_index: 4,
13270 # start_column_index: 0, end_column_index: 2
13271 #
13272 # Sheet1!A:B == sheet_id: 0,
13273 # start_column_index: 0, end_column_index: 2
13274 #
13275 # Sheet1!A5:B == sheet_id: 0,
13276 # start_row_index: 4,
13277 # start_column_index: 0, end_column_index: 2
13278 #
13279 # Sheet1 == sheet_id:0
13280 #
13281 # The start index must always be less than or equal to the end index.
13282 # If the start index equals the end index, then the range is empty.
13283 # Empty ranges are typically not meaningful and are usually rendered in the
13284 # UI as `#REF!`.
13285 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
13286 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
13287 "sheetId": 42, # The sheet this range is on.
13288 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
13289 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
13290 },
13291 "sortSpecs": [ # The sort order per column. Later specifications are used when values
13292 # are equal in the earlier specifications.
13293 { # A sort order associated with a specific column or row.
13294 "sortOrder": "A String", # The order data should be sorted.
13295 "dimensionIndex": 42, # The dimension the sort should be applied to.
13296 },
13297 ],
13298 "criteria": { # The criteria for showing/hiding values per column.
13299 # The map's key is the column index, and the value is the criteria for
13300 # that column.
13301 "a_key": { # Criteria for showing/hiding rows in a filter, filter view.
13302 "hiddenValues": [ # Values that should be hidden.
13303 "A String",
13304 ],
13305 "condition": { # A condition that can evaluate to true or false. # A condition that must be true for values to be shown.
13306 # (This does not override hiddenValues -- if a value is listed there,
13307 # it will still be hidden.)
13308 # BooleanConditions are used by conditional formatting,
13309 # data validation, and the criteria in filters.
13310 "type": "A String", # The type of condition.
13311 "values": [ # The values of the condition. The number of supported values depends
13312 # on the condition type. Some support zero values,
13313 # others one or two values,
13314 # and ConditionType.ONE_OF_LIST supports an arbitrary number of values.
13315 { # The value of the condition.
13316 "relativeDate": "A String", # A relative date (based on the current date).
13317 # Valid only if the type is
13318 # DATE_BEFORE,
13319 # DATE_AFTER,
13320 # DATE_ON_OR_BEFORE or
13321 # DATE_ON_OR_AFTER.
13322 #
13323 # Relative dates are not supported in data validation.
13324 # They are supported only in conditional formatting and
13325 # conditional filters.
13326 "userEnteredValue": "A String", # A value the condition is based on.
13327 # The value will be parsed as if the user typed into a cell.
13328 # Formulas are supported (and must begin with an `=`).
13329 },
13330 ],
13331 },
13332 },
13333 },
13334 },
13335 "fields": "A String", # The fields that should be updated. At least one field must be specified.
13336 # The root `filter` is implied and should not be specified.
13337 # A single `"*"` can be used as short-hand for listing every field.
13338 },
13339 "deleteConditionalFormatRule": { # Deletes a conditional format rule at the given index. # Deletes an existing conditional format rule.
13340 # All subsequent rules' indexes are decremented.
13341 "index": 42, # The zero-based index of the rule to be deleted.
13342 "sheetId": 42, # The sheet the rule is being deleted from.
13343 },
13344 },
13345 ],
13346 }
13347
13348 x__xgafv: string, V1 error format.
13349 Allowed values
13350 1 - v1 error format
13351 2 - v2 error format
13352
13353Returns:
13354 An object of the form:
13355
13356 { # The reply for batch updating a spreadsheet.
13357 "spreadsheetId": "A String", # The spreadsheet the updates were applied to.
13358 "replies": [ # The reply of the updates. This maps 1:1 with the updates, although
13359 # replies to some requests may be empty.
13360 { # A single response from an update.
13361 "duplicateFilterView": { # The result of a filter view being duplicated. # A reply from duplicating a filter view.
13362 "filter": { # A filter view. # The newly created filter.
13363 "title": "A String", # The name of the filter view.
13364 "namedRangeId": "A String", # The named range this filter view is backed by, if any.
13365 #
13366 # When writing, only one of range or namedRangeId
13367 # may be set.
13368 "filterViewId": 42, # The ID of the filter view.
13369 "range": { # A range on a sheet. # The range this filter view covers.
13370 #
13371 # When writing, only one of range or namedRangeId
13372 # may be set.
13373 # All indexes are zero-based.
13374 # Indexes are half open, e.g the start index is inclusive
13375 # and the end index is exclusive -- [start_index, end_index).
13376 # Missing indexes indicate the range is unbounded on that side.
13377 #
13378 # For example, if "Sheet1" is grid ID 0, then:
13379 #
13380 # Sheet1!A1:A1 == sheet_id: 0,
13381 # start_row_index: 0, end_row_index: 1,
13382 # start_column_index: 0, end_column_index: 1
13383 #
13384 # Sheet1!A3:B4 == sheet_id: 0,
13385 # start_row_index: 2, end_row_index: 4,
13386 # start_column_index: 0, end_column_index: 2
13387 #
13388 # Sheet1!A:B == sheet_id: 0,
13389 # start_column_index: 0, end_column_index: 2
13390 #
13391 # Sheet1!A5:B == sheet_id: 0,
13392 # start_row_index: 4,
13393 # start_column_index: 0, end_column_index: 2
13394 #
13395 # Sheet1 == sheet_id:0
13396 #
13397 # The start index must always be less than or equal to the end index.
13398 # If the start index equals the end index, then the range is empty.
13399 # Empty ranges are typically not meaningful and are usually rendered in the
13400 # UI as `#REF!`.
13401 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
13402 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
13403 "sheetId": 42, # The sheet this range is on.
13404 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
13405 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
13406 },
13407 "sortSpecs": [ # The sort order per column. Later specifications are used when values
13408 # are equal in the earlier specifications.
13409 { # A sort order associated with a specific column or row.
13410 "sortOrder": "A String", # The order data should be sorted.
13411 "dimensionIndex": 42, # The dimension the sort should be applied to.
13412 },
13413 ],
13414 "criteria": { # The criteria for showing/hiding values per column.
13415 # The map's key is the column index, and the value is the criteria for
13416 # that column.
13417 "a_key": { # Criteria for showing/hiding rows in a filter, filter view.
13418 "hiddenValues": [ # Values that should be hidden.
13419 "A String",
13420 ],
13421 "condition": { # A condition that can evaluate to true or false. # A condition that must be true for values to be shown.
13422 # (This does not override hiddenValues -- if a value is listed there,
13423 # it will still be hidden.)
13424 # BooleanConditions are used by conditional formatting,
13425 # data validation, and the criteria in filters.
13426 "type": "A String", # The type of condition.
13427 "values": [ # The values of the condition. The number of supported values depends
13428 # on the condition type. Some support zero values,
13429 # others one or two values,
13430 # and ConditionType.ONE_OF_LIST supports an arbitrary number of values.
13431 { # The value of the condition.
13432 "relativeDate": "A String", # A relative date (based on the current date).
13433 # Valid only if the type is
13434 # DATE_BEFORE,
13435 # DATE_AFTER,
13436 # DATE_ON_OR_BEFORE or
13437 # DATE_ON_OR_AFTER.
13438 #
13439 # Relative dates are not supported in data validation.
13440 # They are supported only in conditional formatting and
13441 # conditional filters.
13442 "userEnteredValue": "A String", # A value the condition is based on.
13443 # The value will be parsed as if the user typed into a cell.
13444 # Formulas are supported (and must begin with an `=`).
13445 },
13446 ],
13447 },
13448 },
13449 },
13450 },
13451 },
13452 "duplicateSheet": { # The result of duplicating a sheet. # A reply from duplicating a sheet.
13453 "properties": { # Properties of a sheet. # The properties of the duplicate sheet.
13454 "sheetType": "A String", # The type of sheet. Defaults to GRID.
13455 # This field cannot be changed once set.
13456 "index": 42, # The index of the sheet within the spreadsheet.
13457 # When adding or updating sheet properties, if this field
13458 # is excluded then the sheet will be added or moved to the end
13459 # of the sheet list.
13460 "title": "A String", # The name of the sheet.
13461 "gridProperties": { # Properties of a grid. # Additional properties of the sheet if this sheet is a grid.
13462 # (If the sheet is an object sheet, containing a chart or image, then
13463 # this field will be absent.)
13464 # When writing it is an error to set any grid properties on non-grid sheets.
13465 "columnCount": 42, # The number of columns in the grid.
13466 "rowCount": 42, # The number of rows in the grid.
13467 "frozenColumnCount": 42, # The number of columns that are frozen in the grid.
13468 "hideGridlines": True or False, # True if the grid isn't showing gridlines in the UI.
13469 "frozenRowCount": 42, # The number of rows that are frozen in the grid.
13470 },
13471 "rightToLeft": True or False, # True if the sheet is an RTL sheet instead of an LTR sheet.
13472 "tabColor": { # Represents a color in the RGBA color space. This representation is designed # The color of the tab in the UI.
13473 # for simplicity of conversion to/from color representations in various
13474 # languages over compactness; for example, the fields of this representation
13475 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
13476 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
13477 # method in iOS; and, with just a little work, it can be easily formatted into
13478 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
13479 #
13480 # Example (Java):
13481 #
13482 # import com.google.type.Color;
13483 #
13484 # // ...
13485 # public static java.awt.Color fromProto(Color protocolor) {
13486 # float alpha = protocolor.hasAlpha()
13487 # ? protocolor.getAlpha().getValue()
13488 # : 1.0;
13489 #
13490 # return new java.awt.Color(
13491 # protocolor.getRed(),
13492 # protocolor.getGreen(),
13493 # protocolor.getBlue(),
13494 # alpha);
13495 # }
13496 #
13497 # public static Color toProto(java.awt.Color color) {
13498 # float red = (float) color.getRed();
13499 # float green = (float) color.getGreen();
13500 # float blue = (float) color.getBlue();
13501 # float denominator = 255.0;
13502 # Color.Builder resultBuilder =
13503 # Color
13504 # .newBuilder()
13505 # .setRed(red / denominator)
13506 # .setGreen(green / denominator)
13507 # .setBlue(blue / denominator);
13508 # int alpha = color.getAlpha();
13509 # if (alpha != 255) {
13510 # result.setAlpha(
13511 # FloatValue
13512 # .newBuilder()
13513 # .setValue(((float) alpha) / denominator)
13514 # .build());
13515 # }
13516 # return resultBuilder.build();
13517 # }
13518 # // ...
13519 #
13520 # Example (iOS / Obj-C):
13521 #
13522 # // ...
13523 # static UIColor* fromProto(Color* protocolor) {
13524 # float red = [protocolor red];
13525 # float green = [protocolor green];
13526 # float blue = [protocolor blue];
13527 # FloatValue* alpha_wrapper = [protocolor alpha];
13528 # float alpha = 1.0;
13529 # if (alpha_wrapper != nil) {
13530 # alpha = [alpha_wrapper value];
13531 # }
13532 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
13533 # }
13534 #
13535 # static Color* toProto(UIColor* color) {
13536 # CGFloat red, green, blue, alpha;
13537 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
13538 # return nil;
13539 # }
13540 # Color* result = [Color alloc] init];
13541 # [result setRed:red];
13542 # [result setGreen:green];
13543 # [result setBlue:blue];
13544 # if (alpha <= 0.9999) {
13545 # [result setAlpha:floatWrapperWithValue(alpha)];
13546 # }
13547 # [result autorelease];
13548 # return result;
13549 # }
13550 # // ...
13551 #
13552 # Example (JavaScript):
13553 #
13554 # // ...
13555 #
13556 # var protoToCssColor = function(rgb_color) {
13557 # var redFrac = rgb_color.red || 0.0;
13558 # var greenFrac = rgb_color.green || 0.0;
13559 # var blueFrac = rgb_color.blue || 0.0;
13560 # var red = Math.floor(redFrac * 255);
13561 # var green = Math.floor(greenFrac * 255);
13562 # var blue = Math.floor(blueFrac * 255);
13563 #
13564 # if (!('alpha' in rgb_color)) {
13565 # return rgbToCssColor_(red, green, blue);
13566 # }
13567 #
13568 # var alphaFrac = rgb_color.alpha.value || 0.0;
13569 # var rgbParams = [red, green, blue].join(',');
13570 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
13571 # };
13572 #
13573 # var rgbToCssColor_ = function(red, green, blue) {
13574 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
13575 # var hexString = rgbNumber.toString(16);
13576 # var missingZeros = 6 - hexString.length;
13577 # var resultBuilder = ['#'];
13578 # for (var i = 0; i < missingZeros; i++) {
13579 # resultBuilder.push('0');
13580 # }
13581 # resultBuilder.push(hexString);
13582 # return resultBuilder.join('');
13583 # };
13584 #
13585 # // ...
13586 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
13587 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
13588 # the final pixel color is defined by the equation:
13589 #
13590 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
13591 #
13592 # This means that a value of 1.0 corresponds to a solid color, whereas
13593 # a value of 0.0 corresponds to a completely transparent color. This
13594 # uses a wrapper message rather than a simple float scalar so that it is
13595 # possible to distinguish between a default value and the value being unset.
13596 # If omitted, this color object is to be rendered as a solid color
13597 # (as if the alpha value had been explicitly given with a value of 1.0).
13598 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
13599 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
13600 },
13601 "hidden": True or False, # True if the sheet is hidden in the UI, false if it's visible.
13602 "sheetId": 42, # The ID of the sheet. Must be non-negative.
13603 # This field cannot be changed once set.
13604 },
13605 },
13606 "updateEmbeddedObjectPosition": { # The result of updating an embedded object's position. # A reply from updating an embedded object's position.
13607 "position": { # The position of an embedded object such as a chart. # The new position of the embedded object.
13608 "newSheet": True or False, # If true, the embedded object will be put on a new sheet whose ID
13609 # is chosen for you. Used only when writing.
13610 "sheetId": 42, # The sheet this is on. Set only if the embedded object
13611 # is on its own sheet. Must be non-negative.
13612 "overlayPosition": { # The location an object is overlaid on top of a grid. # The position the object is overlaid on top of a grid.
13613 "anchorCell": { # A coordinate in a sheet. # The cell the object is anchored to.
13614 # All indexes are zero-based.
13615 "rowIndex": 42, # The row index of the coordinate.
13616 "columnIndex": 42, # The column index of the coordinate.
13617 "sheetId": 42, # The sheet this coordinate is on.
13618 },
13619 "offsetYPixels": 42, # The vertical offset, in pixels, that the object is offset
13620 # from the anchor cell.
13621 "widthPixels": 42, # The width of the object, in pixels. Defaults to 600.
13622 "offsetXPixels": 42, # The horizontal offset, in pixels, that the object is offset
13623 # from the anchor cell.
13624 "heightPixels": 42, # The height of the object, in pixels. Defaults to 371.
13625 },
13626 },
13627 },
13628 "addChart": { # The result of adding a chart to a spreadsheet. # A reply from adding a chart.
13629 "chart": { # A chart embedded in a sheet. # The newly added chart.
13630 "chartId": 42, # The ID of the chart.
13631 "position": { # The position of an embedded object such as a chart. # The position of the chart.
13632 "newSheet": True or False, # If true, the embedded object will be put on a new sheet whose ID
13633 # is chosen for you. Used only when writing.
13634 "sheetId": 42, # The sheet this is on. Set only if the embedded object
13635 # is on its own sheet. Must be non-negative.
13636 "overlayPosition": { # The location an object is overlaid on top of a grid. # The position the object is overlaid on top of a grid.
13637 "anchorCell": { # A coordinate in a sheet. # The cell the object is anchored to.
13638 # All indexes are zero-based.
13639 "rowIndex": 42, # The row index of the coordinate.
13640 "columnIndex": 42, # The column index of the coordinate.
13641 "sheetId": 42, # The sheet this coordinate is on.
13642 },
13643 "offsetYPixels": 42, # The vertical offset, in pixels, that the object is offset
13644 # from the anchor cell.
13645 "widthPixels": 42, # The width of the object, in pixels. Defaults to 600.
13646 "offsetXPixels": 42, # The horizontal offset, in pixels, that the object is offset
13647 # from the anchor cell.
13648 "heightPixels": 42, # The height of the object, in pixels. Defaults to 371.
13649 },
13650 },
13651 "spec": { # The specifications of a chart. # The specification of the chart.
13652 "hiddenDimensionStrategy": "A String", # Determines how the charts will use hidden rows or columns.
13653 # This value is only meaningful if the
13654 # ChartData.sourceRange
13655 # is used for a domain or series.
13656 "pieChart": { # A <a href="/chart/interactive/docs/gallery/piechart">pie chart</a>. # A pie chart specification.
13657 "series": { # The data included in a domain or series. # The data that covers the one and only series of the pie chart.
13658 "sourceRange": { # Source ranges for a chart. # The source ranges of the data.
13659 "sources": [ # The ranges of data for a series or domain.
13660 # Exactly one dimension must have a length of 1,
13661 # and all sources in the list must have the same dimension
13662 # with length 1.
13663 # The domain (if it exists) & all series must have the same number
13664 # of source ranges. If using more than one source range, then the source
13665 # range at a given offset must be contiguous across the domain and series.
13666 #
13667 # For example, these are valid configurations:
13668 #
13669 # domain sources: A1:A5
13670 # series1 sources: B1:B5
13671 # series2 sources: D6:D10
13672 #
13673 # domain sources: A1:A5, C10:C12
13674 # series1 sources: B1:B5, D10:D12
13675 # series2 sources: C1:C5, E10:E12
13676 { # A range on a sheet.
13677 # All indexes are zero-based.
13678 # Indexes are half open, e.g the start index is inclusive
13679 # and the end index is exclusive -- [start_index, end_index).
13680 # Missing indexes indicate the range is unbounded on that side.
13681 #
13682 # For example, if "Sheet1" is grid ID 0, then:
13683 #
13684 # Sheet1!A1:A1 == sheet_id: 0,
13685 # start_row_index: 0, end_row_index: 1,
13686 # start_column_index: 0, end_column_index: 1
13687 #
13688 # Sheet1!A3:B4 == sheet_id: 0,
13689 # start_row_index: 2, end_row_index: 4,
13690 # start_column_index: 0, end_column_index: 2
13691 #
13692 # Sheet1!A:B == sheet_id: 0,
13693 # start_column_index: 0, end_column_index: 2
13694 #
13695 # Sheet1!A5:B == sheet_id: 0,
13696 # start_row_index: 4,
13697 # start_column_index: 0, end_column_index: 2
13698 #
13699 # Sheet1 == sheet_id:0
13700 #
13701 # The start index must always be less than or equal to the end index.
13702 # If the start index equals the end index, then the range is empty.
13703 # Empty ranges are typically not meaningful and are usually rendered in the
13704 # UI as `#REF!`.
13705 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
13706 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
13707 "sheetId": 42, # The sheet this range is on.
13708 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
13709 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
13710 },
13711 ],
13712 },
13713 },
13714 "domain": { # The data included in a domain or series. # The data that covers the domain of the pie chart.
13715 "sourceRange": { # Source ranges for a chart. # The source ranges of the data.
13716 "sources": [ # The ranges of data for a series or domain.
13717 # Exactly one dimension must have a length of 1,
13718 # and all sources in the list must have the same dimension
13719 # with length 1.
13720 # The domain (if it exists) & all series must have the same number
13721 # of source ranges. If using more than one source range, then the source
13722 # range at a given offset must be contiguous across the domain and series.
13723 #
13724 # For example, these are valid configurations:
13725 #
13726 # domain sources: A1:A5
13727 # series1 sources: B1:B5
13728 # series2 sources: D6:D10
13729 #
13730 # domain sources: A1:A5, C10:C12
13731 # series1 sources: B1:B5, D10:D12
13732 # series2 sources: C1:C5, E10:E12
13733 { # A range on a sheet.
13734 # All indexes are zero-based.
13735 # Indexes are half open, e.g the start index is inclusive
13736 # and the end index is exclusive -- [start_index, end_index).
13737 # Missing indexes indicate the range is unbounded on that side.
13738 #
13739 # For example, if "Sheet1" is grid ID 0, then:
13740 #
13741 # Sheet1!A1:A1 == sheet_id: 0,
13742 # start_row_index: 0, end_row_index: 1,
13743 # start_column_index: 0, end_column_index: 1
13744 #
13745 # Sheet1!A3:B4 == sheet_id: 0,
13746 # start_row_index: 2, end_row_index: 4,
13747 # start_column_index: 0, end_column_index: 2
13748 #
13749 # Sheet1!A:B == sheet_id: 0,
13750 # start_column_index: 0, end_column_index: 2
13751 #
13752 # Sheet1!A5:B == sheet_id: 0,
13753 # start_row_index: 4,
13754 # start_column_index: 0, end_column_index: 2
13755 #
13756 # Sheet1 == sheet_id:0
13757 #
13758 # The start index must always be less than or equal to the end index.
13759 # If the start index equals the end index, then the range is empty.
13760 # Empty ranges are typically not meaningful and are usually rendered in the
13761 # UI as `#REF!`.
13762 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
13763 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
13764 "sheetId": 42, # The sheet this range is on.
13765 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
13766 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
13767 },
13768 ],
13769 },
13770 },
13771 "threeDimensional": True or False, # True if the pie is three dimensional.
13772 "legendPosition": "A String", # Where the legend of the pie chart should be drawn.
13773 "pieHole": 3.14, # The size of the hole in the pie chart.
13774 },
13775 "basicChart": { # The specification for a basic chart. See BasicChartType for the list # A basic chart specification, can be one of many kinds of charts.
13776 # See BasicChartType for the list of all charts this supports.
13777 # of charts this supports.
13778 "headerCount": 42, # The number of rows or columns in the data that are "headers".
13779 # If not set, Google Sheets will guess how many rows are headers based
13780 # on the data.
13781 #
13782 # (Note that BasicChartAxis.title may override the axis title
13783 # inferred from the header values.)
13784 "series": [ # The data this chart is visualizing.
13785 { # A single series of data in a chart.
13786 # For example, if charting stock prices over time, multiple series may exist,
13787 # one for the "Open Price", "High Price", "Low Price" and "Close Price".
13788 "series": { # The data included in a domain or series. # The data being visualized in this chart series.
13789 "sourceRange": { # Source ranges for a chart. # The source ranges of the data.
13790 "sources": [ # The ranges of data for a series or domain.
13791 # Exactly one dimension must have a length of 1,
13792 # and all sources in the list must have the same dimension
13793 # with length 1.
13794 # The domain (if it exists) & all series must have the same number
13795 # of source ranges. If using more than one source range, then the source
13796 # range at a given offset must be contiguous across the domain and series.
13797 #
13798 # For example, these are valid configurations:
13799 #
13800 # domain sources: A1:A5
13801 # series1 sources: B1:B5
13802 # series2 sources: D6:D10
13803 #
13804 # domain sources: A1:A5, C10:C12
13805 # series1 sources: B1:B5, D10:D12
13806 # series2 sources: C1:C5, E10:E12
13807 { # A range on a sheet.
13808 # All indexes are zero-based.
13809 # Indexes are half open, e.g the start index is inclusive
13810 # and the end index is exclusive -- [start_index, end_index).
13811 # Missing indexes indicate the range is unbounded on that side.
13812 #
13813 # For example, if "Sheet1" is grid ID 0, then:
13814 #
13815 # Sheet1!A1:A1 == sheet_id: 0,
13816 # start_row_index: 0, end_row_index: 1,
13817 # start_column_index: 0, end_column_index: 1
13818 #
13819 # Sheet1!A3:B4 == sheet_id: 0,
13820 # start_row_index: 2, end_row_index: 4,
13821 # start_column_index: 0, end_column_index: 2
13822 #
13823 # Sheet1!A:B == sheet_id: 0,
13824 # start_column_index: 0, end_column_index: 2
13825 #
13826 # Sheet1!A5:B == sheet_id: 0,
13827 # start_row_index: 4,
13828 # start_column_index: 0, end_column_index: 2
13829 #
13830 # Sheet1 == sheet_id:0
13831 #
13832 # The start index must always be less than or equal to the end index.
13833 # If the start index equals the end index, then the range is empty.
13834 # Empty ranges are typically not meaningful and are usually rendered in the
13835 # UI as `#REF!`.
13836 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
13837 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
13838 "sheetId": 42, # The sheet this range is on.
13839 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
13840 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
13841 },
13842 ],
13843 },
13844 },
13845 "targetAxis": "A String", # The minor axis that will specify the range of values for this series.
13846 # For example, if charting stocks over time, the "Volume" series
13847 # may want to be pinned to the right with the prices pinned to the left,
13848 # because the scale of trading volume is different than the scale of
13849 # prices.
13850 # It is an error to specify an axis that isn't a valid minor axis
13851 # for the chart's type.
13852 "type": "A String", # The type of this series. Valid only if the
13853 # chartType is
13854 # COMBO.
13855 # Different types will change the way the series is visualized.
13856 # Only LINE, AREA,
13857 # and COLUMN are supported.
13858 },
13859 ],
13860 "legendPosition": "A String", # The position of the chart legend.
13861 "domains": [ # The domain of data this is charting.
13862 # Only a single domain is currently supported.
13863 { # The domain of a chart.
13864 # For example, if charting stock prices over time, this would be the date.
13865 "domain": { # The data included in a domain or series. # The data of the domain. For example, if charting stock prices over time,
13866 # this be the data representing the dates.
13867 "sourceRange": { # Source ranges for a chart. # The source ranges of the data.
13868 "sources": [ # The ranges of data for a series or domain.
13869 # Exactly one dimension must have a length of 1,
13870 # and all sources in the list must have the same dimension
13871 # with length 1.
13872 # The domain (if it exists) & all series must have the same number
13873 # of source ranges. If using more than one source range, then the source
13874 # range at a given offset must be contiguous across the domain and series.
13875 #
13876 # For example, these are valid configurations:
13877 #
13878 # domain sources: A1:A5
13879 # series1 sources: B1:B5
13880 # series2 sources: D6:D10
13881 #
13882 # domain sources: A1:A5, C10:C12
13883 # series1 sources: B1:B5, D10:D12
13884 # series2 sources: C1:C5, E10:E12
13885 { # A range on a sheet.
13886 # All indexes are zero-based.
13887 # Indexes are half open, e.g the start index is inclusive
13888 # and the end index is exclusive -- [start_index, end_index).
13889 # Missing indexes indicate the range is unbounded on that side.
13890 #
13891 # For example, if "Sheet1" is grid ID 0, then:
13892 #
13893 # Sheet1!A1:A1 == sheet_id: 0,
13894 # start_row_index: 0, end_row_index: 1,
13895 # start_column_index: 0, end_column_index: 1
13896 #
13897 # Sheet1!A3:B4 == sheet_id: 0,
13898 # start_row_index: 2, end_row_index: 4,
13899 # start_column_index: 0, end_column_index: 2
13900 #
13901 # Sheet1!A:B == sheet_id: 0,
13902 # start_column_index: 0, end_column_index: 2
13903 #
13904 # Sheet1!A5:B == sheet_id: 0,
13905 # start_row_index: 4,
13906 # start_column_index: 0, end_column_index: 2
13907 #
13908 # Sheet1 == sheet_id:0
13909 #
13910 # The start index must always be less than or equal to the end index.
13911 # If the start index equals the end index, then the range is empty.
13912 # Empty ranges are typically not meaningful and are usually rendered in the
13913 # UI as `#REF!`.
13914 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
13915 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
13916 "sheetId": 42, # The sheet this range is on.
13917 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
13918 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
13919 },
13920 ],
13921 },
13922 },
13923 },
13924 ],
13925 "chartType": "A String", # The type of the chart.
13926 "axis": [ # The axis on the chart.
13927 { # An axis of the chart.
13928 # A chart may not have more than one axis per
13929 # axis position.
13930 "position": "A String", # The position of this axis.
13931 "format": { # The format of a run of text in a cell. # The format of the title.
13932 # Only valid if the axis is not associated with the domain.
13933 # Absent values indicate that the field isn't specified.
13934 "foregroundColor": { # Represents a color in the RGBA color space. This representation is designed # The foreground color of the text.
13935 # for simplicity of conversion to/from color representations in various
13936 # languages over compactness; for example, the fields of this representation
13937 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
13938 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
13939 # method in iOS; and, with just a little work, it can be easily formatted into
13940 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
13941 #
13942 # Example (Java):
13943 #
13944 # import com.google.type.Color;
13945 #
13946 # // ...
13947 # public static java.awt.Color fromProto(Color protocolor) {
13948 # float alpha = protocolor.hasAlpha()
13949 # ? protocolor.getAlpha().getValue()
13950 # : 1.0;
13951 #
13952 # return new java.awt.Color(
13953 # protocolor.getRed(),
13954 # protocolor.getGreen(),
13955 # protocolor.getBlue(),
13956 # alpha);
13957 # }
13958 #
13959 # public static Color toProto(java.awt.Color color) {
13960 # float red = (float) color.getRed();
13961 # float green = (float) color.getGreen();
13962 # float blue = (float) color.getBlue();
13963 # float denominator = 255.0;
13964 # Color.Builder resultBuilder =
13965 # Color
13966 # .newBuilder()
13967 # .setRed(red / denominator)
13968 # .setGreen(green / denominator)
13969 # .setBlue(blue / denominator);
13970 # int alpha = color.getAlpha();
13971 # if (alpha != 255) {
13972 # result.setAlpha(
13973 # FloatValue
13974 # .newBuilder()
13975 # .setValue(((float) alpha) / denominator)
13976 # .build());
13977 # }
13978 # return resultBuilder.build();
13979 # }
13980 # // ...
13981 #
13982 # Example (iOS / Obj-C):
13983 #
13984 # // ...
13985 # static UIColor* fromProto(Color* protocolor) {
13986 # float red = [protocolor red];
13987 # float green = [protocolor green];
13988 # float blue = [protocolor blue];
13989 # FloatValue* alpha_wrapper = [protocolor alpha];
13990 # float alpha = 1.0;
13991 # if (alpha_wrapper != nil) {
13992 # alpha = [alpha_wrapper value];
13993 # }
13994 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
13995 # }
13996 #
13997 # static Color* toProto(UIColor* color) {
13998 # CGFloat red, green, blue, alpha;
13999 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
14000 # return nil;
14001 # }
14002 # Color* result = [Color alloc] init];
14003 # [result setRed:red];
14004 # [result setGreen:green];
14005 # [result setBlue:blue];
14006 # if (alpha <= 0.9999) {
14007 # [result setAlpha:floatWrapperWithValue(alpha)];
14008 # }
14009 # [result autorelease];
14010 # return result;
14011 # }
14012 # // ...
14013 #
14014 # Example (JavaScript):
14015 #
14016 # // ...
14017 #
14018 # var protoToCssColor = function(rgb_color) {
14019 # var redFrac = rgb_color.red || 0.0;
14020 # var greenFrac = rgb_color.green || 0.0;
14021 # var blueFrac = rgb_color.blue || 0.0;
14022 # var red = Math.floor(redFrac * 255);
14023 # var green = Math.floor(greenFrac * 255);
14024 # var blue = Math.floor(blueFrac * 255);
14025 #
14026 # if (!('alpha' in rgb_color)) {
14027 # return rgbToCssColor_(red, green, blue);
14028 # }
14029 #
14030 # var alphaFrac = rgb_color.alpha.value || 0.0;
14031 # var rgbParams = [red, green, blue].join(',');
14032 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
14033 # };
14034 #
14035 # var rgbToCssColor_ = function(red, green, blue) {
14036 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
14037 # var hexString = rgbNumber.toString(16);
14038 # var missingZeros = 6 - hexString.length;
14039 # var resultBuilder = ['#'];
14040 # for (var i = 0; i < missingZeros; i++) {
14041 # resultBuilder.push('0');
14042 # }
14043 # resultBuilder.push(hexString);
14044 # return resultBuilder.join('');
14045 # };
14046 #
14047 # // ...
14048 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
14049 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
14050 # the final pixel color is defined by the equation:
14051 #
14052 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
14053 #
14054 # This means that a value of 1.0 corresponds to a solid color, whereas
14055 # a value of 0.0 corresponds to a completely transparent color. This
14056 # uses a wrapper message rather than a simple float scalar so that it is
14057 # possible to distinguish between a default value and the value being unset.
14058 # If omitted, this color object is to be rendered as a solid color
14059 # (as if the alpha value had been explicitly given with a value of 1.0).
14060 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
14061 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
14062 },
14063 "bold": True or False, # True if the text is bold.
14064 "strikethrough": True or False, # True if the text has a strikethrough.
14065 "fontFamily": "A String", # The font family.
14066 "fontSize": 42, # The size of the font.
14067 "italic": True or False, # True if the text is italicized.
14068 "underline": True or False, # True if the text is underlined.
14069 },
14070 "title": "A String", # The title of this axis. If set, this overrides any title inferred
14071 # from headers of the data.
14072 },
14073 ],
14074 },
14075 "title": "A String", # The title of the chart.
14076 },
14077 },
14078 },
14079 "updateConditionalFormatRule": { # The result of updating a conditional format rule. # A reply from updating a conditional format rule.
14080 "oldIndex": 42, # The old index of the rule. Not set if a rule was replaced
14081 # (because it is the same as newIndex).
14082 "newIndex": 42, # The index of the new rule.
14083 "oldRule": { # A rule describing a conditional format. # The old (deleted) rule. Not set if a rule was moved
14084 # (because it is the same as newRule).
14085 "ranges": [ # The ranges that will be formatted if the condition is true.
14086 # All the ranges must be on the same grid.
14087 { # A range on a sheet.
14088 # All indexes are zero-based.
14089 # Indexes are half open, e.g the start index is inclusive
14090 # and the end index is exclusive -- [start_index, end_index).
14091 # Missing indexes indicate the range is unbounded on that side.
14092 #
14093 # For example, if "Sheet1" is grid ID 0, then:
14094 #
14095 # Sheet1!A1:A1 == sheet_id: 0,
14096 # start_row_index: 0, end_row_index: 1,
14097 # start_column_index: 0, end_column_index: 1
14098 #
14099 # Sheet1!A3:B4 == sheet_id: 0,
14100 # start_row_index: 2, end_row_index: 4,
14101 # start_column_index: 0, end_column_index: 2
14102 #
14103 # Sheet1!A:B == sheet_id: 0,
14104 # start_column_index: 0, end_column_index: 2
14105 #
14106 # Sheet1!A5:B == sheet_id: 0,
14107 # start_row_index: 4,
14108 # start_column_index: 0, end_column_index: 2
14109 #
14110 # Sheet1 == sheet_id:0
14111 #
14112 # The start index must always be less than or equal to the end index.
14113 # If the start index equals the end index, then the range is empty.
14114 # Empty ranges are typically not meaningful and are usually rendered in the
14115 # UI as `#REF!`.
14116 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
14117 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
14118 "sheetId": 42, # The sheet this range is on.
14119 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
14120 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
14121 },
14122 ],
14123 "booleanRule": { # A rule that may or may not match, depending on the condition. # The formatting is either "on" or "off" according to the rule.
14124 "condition": { # A condition that can evaluate to true or false. # The condition of the rule. If the condition evaluates to true,
14125 # the format will be applied.
14126 # BooleanConditions are used by conditional formatting,
14127 # data validation, and the criteria in filters.
14128 "type": "A String", # The type of condition.
14129 "values": [ # The values of the condition. The number of supported values depends
14130 # on the condition type. Some support zero values,
14131 # others one or two values,
14132 # and ConditionType.ONE_OF_LIST supports an arbitrary number of values.
14133 { # The value of the condition.
14134 "relativeDate": "A String", # A relative date (based on the current date).
14135 # Valid only if the type is
14136 # DATE_BEFORE,
14137 # DATE_AFTER,
14138 # DATE_ON_OR_BEFORE or
14139 # DATE_ON_OR_AFTER.
14140 #
14141 # Relative dates are not supported in data validation.
14142 # They are supported only in conditional formatting and
14143 # conditional filters.
14144 "userEnteredValue": "A String", # A value the condition is based on.
14145 # The value will be parsed as if the user typed into a cell.
14146 # Formulas are supported (and must begin with an `=`).
14147 },
14148 ],
14149 },
14150 "format": { # The format of a cell. # The format to apply.
14151 # Conditional formatting can only apply a subset of formatting:
14152 # bold, italic,
14153 # strikethrough,
14154 # foreground color &
14155 # background color.
14156 "numberFormat": { # The number format of a cell. # A format describing how number values should be represented to the user.
14157 # When updating, all fields must be set.
14158 "pattern": "A String", # Pattern string used for formatting.
14159 "type": "A String", # The type of the number format.
14160 },
14161 "textDirection": "A String", # The direction of the text in the cell.
14162 "padding": { # The amount of padding around the cell, in pixels. # The padding of the cell.
14163 # When updating padding, every field must be specified.
14164 "top": 42, # The top padding of the cell.
14165 "right": 42, # The right padding of the cell.
14166 "bottom": 42, # The bottom padding of the cell.
14167 "left": 42, # The left padding of the cell.
14168 },
14169 "horizontalAlignment": "A String", # The horizontal alignment of the value in cell.
14170 "backgroundColor": { # Represents a color in the RGBA color space. This representation is designed # The background color of the cell.
14171 # for simplicity of conversion to/from color representations in various
14172 # languages over compactness; for example, the fields of this representation
14173 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
14174 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
14175 # method in iOS; and, with just a little work, it can be easily formatted into
14176 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
14177 #
14178 # Example (Java):
14179 #
14180 # import com.google.type.Color;
14181 #
14182 # // ...
14183 # public static java.awt.Color fromProto(Color protocolor) {
14184 # float alpha = protocolor.hasAlpha()
14185 # ? protocolor.getAlpha().getValue()
14186 # : 1.0;
14187 #
14188 # return new java.awt.Color(
14189 # protocolor.getRed(),
14190 # protocolor.getGreen(),
14191 # protocolor.getBlue(),
14192 # alpha);
14193 # }
14194 #
14195 # public static Color toProto(java.awt.Color color) {
14196 # float red = (float) color.getRed();
14197 # float green = (float) color.getGreen();
14198 # float blue = (float) color.getBlue();
14199 # float denominator = 255.0;
14200 # Color.Builder resultBuilder =
14201 # Color
14202 # .newBuilder()
14203 # .setRed(red / denominator)
14204 # .setGreen(green / denominator)
14205 # .setBlue(blue / denominator);
14206 # int alpha = color.getAlpha();
14207 # if (alpha != 255) {
14208 # result.setAlpha(
14209 # FloatValue
14210 # .newBuilder()
14211 # .setValue(((float) alpha) / denominator)
14212 # .build());
14213 # }
14214 # return resultBuilder.build();
14215 # }
14216 # // ...
14217 #
14218 # Example (iOS / Obj-C):
14219 #
14220 # // ...
14221 # static UIColor* fromProto(Color* protocolor) {
14222 # float red = [protocolor red];
14223 # float green = [protocolor green];
14224 # float blue = [protocolor blue];
14225 # FloatValue* alpha_wrapper = [protocolor alpha];
14226 # float alpha = 1.0;
14227 # if (alpha_wrapper != nil) {
14228 # alpha = [alpha_wrapper value];
14229 # }
14230 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
14231 # }
14232 #
14233 # static Color* toProto(UIColor* color) {
14234 # CGFloat red, green, blue, alpha;
14235 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
14236 # return nil;
14237 # }
14238 # Color* result = [Color alloc] init];
14239 # [result setRed:red];
14240 # [result setGreen:green];
14241 # [result setBlue:blue];
14242 # if (alpha <= 0.9999) {
14243 # [result setAlpha:floatWrapperWithValue(alpha)];
14244 # }
14245 # [result autorelease];
14246 # return result;
14247 # }
14248 # // ...
14249 #
14250 # Example (JavaScript):
14251 #
14252 # // ...
14253 #
14254 # var protoToCssColor = function(rgb_color) {
14255 # var redFrac = rgb_color.red || 0.0;
14256 # var greenFrac = rgb_color.green || 0.0;
14257 # var blueFrac = rgb_color.blue || 0.0;
14258 # var red = Math.floor(redFrac * 255);
14259 # var green = Math.floor(greenFrac * 255);
14260 # var blue = Math.floor(blueFrac * 255);
14261 #
14262 # if (!('alpha' in rgb_color)) {
14263 # return rgbToCssColor_(red, green, blue);
14264 # }
14265 #
14266 # var alphaFrac = rgb_color.alpha.value || 0.0;
14267 # var rgbParams = [red, green, blue].join(',');
14268 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
14269 # };
14270 #
14271 # var rgbToCssColor_ = function(red, green, blue) {
14272 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
14273 # var hexString = rgbNumber.toString(16);
14274 # var missingZeros = 6 - hexString.length;
14275 # var resultBuilder = ['#'];
14276 # for (var i = 0; i < missingZeros; i++) {
14277 # resultBuilder.push('0');
14278 # }
14279 # resultBuilder.push(hexString);
14280 # return resultBuilder.join('');
14281 # };
14282 #
14283 # // ...
14284 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
14285 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
14286 # the final pixel color is defined by the equation:
14287 #
14288 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
14289 #
14290 # This means that a value of 1.0 corresponds to a solid color, whereas
14291 # a value of 0.0 corresponds to a completely transparent color. This
14292 # uses a wrapper message rather than a simple float scalar so that it is
14293 # possible to distinguish between a default value and the value being unset.
14294 # If omitted, this color object is to be rendered as a solid color
14295 # (as if the alpha value had been explicitly given with a value of 1.0).
14296 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
14297 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
14298 },
14299 "verticalAlignment": "A String", # The vertical alignment of the value in cell.
14300 "textFormat": { # The format of a run of text in a cell. # The format of the text in the cell (unless overridden by a format run).
14301 # Absent values indicate that the field isn't specified.
14302 "foregroundColor": { # Represents a color in the RGBA color space. This representation is designed # The foreground color of the text.
14303 # for simplicity of conversion to/from color representations in various
14304 # languages over compactness; for example, the fields of this representation
14305 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
14306 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
14307 # method in iOS; and, with just a little work, it can be easily formatted into
14308 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
14309 #
14310 # Example (Java):
14311 #
14312 # import com.google.type.Color;
14313 #
14314 # // ...
14315 # public static java.awt.Color fromProto(Color protocolor) {
14316 # float alpha = protocolor.hasAlpha()
14317 # ? protocolor.getAlpha().getValue()
14318 # : 1.0;
14319 #
14320 # return new java.awt.Color(
14321 # protocolor.getRed(),
14322 # protocolor.getGreen(),
14323 # protocolor.getBlue(),
14324 # alpha);
14325 # }
14326 #
14327 # public static Color toProto(java.awt.Color color) {
14328 # float red = (float) color.getRed();
14329 # float green = (float) color.getGreen();
14330 # float blue = (float) color.getBlue();
14331 # float denominator = 255.0;
14332 # Color.Builder resultBuilder =
14333 # Color
14334 # .newBuilder()
14335 # .setRed(red / denominator)
14336 # .setGreen(green / denominator)
14337 # .setBlue(blue / denominator);
14338 # int alpha = color.getAlpha();
14339 # if (alpha != 255) {
14340 # result.setAlpha(
14341 # FloatValue
14342 # .newBuilder()
14343 # .setValue(((float) alpha) / denominator)
14344 # .build());
14345 # }
14346 # return resultBuilder.build();
14347 # }
14348 # // ...
14349 #
14350 # Example (iOS / Obj-C):
14351 #
14352 # // ...
14353 # static UIColor* fromProto(Color* protocolor) {
14354 # float red = [protocolor red];
14355 # float green = [protocolor green];
14356 # float blue = [protocolor blue];
14357 # FloatValue* alpha_wrapper = [protocolor alpha];
14358 # float alpha = 1.0;
14359 # if (alpha_wrapper != nil) {
14360 # alpha = [alpha_wrapper value];
14361 # }
14362 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
14363 # }
14364 #
14365 # static Color* toProto(UIColor* color) {
14366 # CGFloat red, green, blue, alpha;
14367 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
14368 # return nil;
14369 # }
14370 # Color* result = [Color alloc] init];
14371 # [result setRed:red];
14372 # [result setGreen:green];
14373 # [result setBlue:blue];
14374 # if (alpha <= 0.9999) {
14375 # [result setAlpha:floatWrapperWithValue(alpha)];
14376 # }
14377 # [result autorelease];
14378 # return result;
14379 # }
14380 # // ...
14381 #
14382 # Example (JavaScript):
14383 #
14384 # // ...
14385 #
14386 # var protoToCssColor = function(rgb_color) {
14387 # var redFrac = rgb_color.red || 0.0;
14388 # var greenFrac = rgb_color.green || 0.0;
14389 # var blueFrac = rgb_color.blue || 0.0;
14390 # var red = Math.floor(redFrac * 255);
14391 # var green = Math.floor(greenFrac * 255);
14392 # var blue = Math.floor(blueFrac * 255);
14393 #
14394 # if (!('alpha' in rgb_color)) {
14395 # return rgbToCssColor_(red, green, blue);
14396 # }
14397 #
14398 # var alphaFrac = rgb_color.alpha.value || 0.0;
14399 # var rgbParams = [red, green, blue].join(',');
14400 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
14401 # };
14402 #
14403 # var rgbToCssColor_ = function(red, green, blue) {
14404 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
14405 # var hexString = rgbNumber.toString(16);
14406 # var missingZeros = 6 - hexString.length;
14407 # var resultBuilder = ['#'];
14408 # for (var i = 0; i < missingZeros; i++) {
14409 # resultBuilder.push('0');
14410 # }
14411 # resultBuilder.push(hexString);
14412 # return resultBuilder.join('');
14413 # };
14414 #
14415 # // ...
14416 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
14417 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
14418 # the final pixel color is defined by the equation:
14419 #
14420 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
14421 #
14422 # This means that a value of 1.0 corresponds to a solid color, whereas
14423 # a value of 0.0 corresponds to a completely transparent color. This
14424 # uses a wrapper message rather than a simple float scalar so that it is
14425 # possible to distinguish between a default value and the value being unset.
14426 # If omitted, this color object is to be rendered as a solid color
14427 # (as if the alpha value had been explicitly given with a value of 1.0).
14428 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
14429 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
14430 },
14431 "bold": True or False, # True if the text is bold.
14432 "strikethrough": True or False, # True if the text has a strikethrough.
14433 "fontFamily": "A String", # The font family.
14434 "fontSize": 42, # The size of the font.
14435 "italic": True or False, # True if the text is italicized.
14436 "underline": True or False, # True if the text is underlined.
14437 },
14438 "hyperlinkDisplayType": "A String", # How a hyperlink, if it exists, should be displayed in the cell.
14439 "borders": { # The borders of the cell. # The borders of the cell.
14440 "top": { # A border along a cell. # The top border of the cell.
14441 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
14442 # for simplicity of conversion to/from color representations in various
14443 # languages over compactness; for example, the fields of this representation
14444 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
14445 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
14446 # method in iOS; and, with just a little work, it can be easily formatted into
14447 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
14448 #
14449 # Example (Java):
14450 #
14451 # import com.google.type.Color;
14452 #
14453 # // ...
14454 # public static java.awt.Color fromProto(Color protocolor) {
14455 # float alpha = protocolor.hasAlpha()
14456 # ? protocolor.getAlpha().getValue()
14457 # : 1.0;
14458 #
14459 # return new java.awt.Color(
14460 # protocolor.getRed(),
14461 # protocolor.getGreen(),
14462 # protocolor.getBlue(),
14463 # alpha);
14464 # }
14465 #
14466 # public static Color toProto(java.awt.Color color) {
14467 # float red = (float) color.getRed();
14468 # float green = (float) color.getGreen();
14469 # float blue = (float) color.getBlue();
14470 # float denominator = 255.0;
14471 # Color.Builder resultBuilder =
14472 # Color
14473 # .newBuilder()
14474 # .setRed(red / denominator)
14475 # .setGreen(green / denominator)
14476 # .setBlue(blue / denominator);
14477 # int alpha = color.getAlpha();
14478 # if (alpha != 255) {
14479 # result.setAlpha(
14480 # FloatValue
14481 # .newBuilder()
14482 # .setValue(((float) alpha) / denominator)
14483 # .build());
14484 # }
14485 # return resultBuilder.build();
14486 # }
14487 # // ...
14488 #
14489 # Example (iOS / Obj-C):
14490 #
14491 # // ...
14492 # static UIColor* fromProto(Color* protocolor) {
14493 # float red = [protocolor red];
14494 # float green = [protocolor green];
14495 # float blue = [protocolor blue];
14496 # FloatValue* alpha_wrapper = [protocolor alpha];
14497 # float alpha = 1.0;
14498 # if (alpha_wrapper != nil) {
14499 # alpha = [alpha_wrapper value];
14500 # }
14501 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
14502 # }
14503 #
14504 # static Color* toProto(UIColor* color) {
14505 # CGFloat red, green, blue, alpha;
14506 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
14507 # return nil;
14508 # }
14509 # Color* result = [Color alloc] init];
14510 # [result setRed:red];
14511 # [result setGreen:green];
14512 # [result setBlue:blue];
14513 # if (alpha <= 0.9999) {
14514 # [result setAlpha:floatWrapperWithValue(alpha)];
14515 # }
14516 # [result autorelease];
14517 # return result;
14518 # }
14519 # // ...
14520 #
14521 # Example (JavaScript):
14522 #
14523 # // ...
14524 #
14525 # var protoToCssColor = function(rgb_color) {
14526 # var redFrac = rgb_color.red || 0.0;
14527 # var greenFrac = rgb_color.green || 0.0;
14528 # var blueFrac = rgb_color.blue || 0.0;
14529 # var red = Math.floor(redFrac * 255);
14530 # var green = Math.floor(greenFrac * 255);
14531 # var blue = Math.floor(blueFrac * 255);
14532 #
14533 # if (!('alpha' in rgb_color)) {
14534 # return rgbToCssColor_(red, green, blue);
14535 # }
14536 #
14537 # var alphaFrac = rgb_color.alpha.value || 0.0;
14538 # var rgbParams = [red, green, blue].join(',');
14539 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
14540 # };
14541 #
14542 # var rgbToCssColor_ = function(red, green, blue) {
14543 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
14544 # var hexString = rgbNumber.toString(16);
14545 # var missingZeros = 6 - hexString.length;
14546 # var resultBuilder = ['#'];
14547 # for (var i = 0; i < missingZeros; i++) {
14548 # resultBuilder.push('0');
14549 # }
14550 # resultBuilder.push(hexString);
14551 # return resultBuilder.join('');
14552 # };
14553 #
14554 # // ...
14555 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
14556 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
14557 # the final pixel color is defined by the equation:
14558 #
14559 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
14560 #
14561 # This means that a value of 1.0 corresponds to a solid color, whereas
14562 # a value of 0.0 corresponds to a completely transparent color. This
14563 # uses a wrapper message rather than a simple float scalar so that it is
14564 # possible to distinguish between a default value and the value being unset.
14565 # If omitted, this color object is to be rendered as a solid color
14566 # (as if the alpha value had been explicitly given with a value of 1.0).
14567 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
14568 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
14569 },
14570 "width": 42, # The width of the border, in pixels.
14571 # Border widths must be between 0 and 3 pixels.
14572 "style": "A String", # The style of the border.
14573 },
14574 "right": { # A border along a cell. # The right border of the cell.
14575 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
14576 # for simplicity of conversion to/from color representations in various
14577 # languages over compactness; for example, the fields of this representation
14578 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
14579 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
14580 # method in iOS; and, with just a little work, it can be easily formatted into
14581 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
14582 #
14583 # Example (Java):
14584 #
14585 # import com.google.type.Color;
14586 #
14587 # // ...
14588 # public static java.awt.Color fromProto(Color protocolor) {
14589 # float alpha = protocolor.hasAlpha()
14590 # ? protocolor.getAlpha().getValue()
14591 # : 1.0;
14592 #
14593 # return new java.awt.Color(
14594 # protocolor.getRed(),
14595 # protocolor.getGreen(),
14596 # protocolor.getBlue(),
14597 # alpha);
14598 # }
14599 #
14600 # public static Color toProto(java.awt.Color color) {
14601 # float red = (float) color.getRed();
14602 # float green = (float) color.getGreen();
14603 # float blue = (float) color.getBlue();
14604 # float denominator = 255.0;
14605 # Color.Builder resultBuilder =
14606 # Color
14607 # .newBuilder()
14608 # .setRed(red / denominator)
14609 # .setGreen(green / denominator)
14610 # .setBlue(blue / denominator);
14611 # int alpha = color.getAlpha();
14612 # if (alpha != 255) {
14613 # result.setAlpha(
14614 # FloatValue
14615 # .newBuilder()
14616 # .setValue(((float) alpha) / denominator)
14617 # .build());
14618 # }
14619 # return resultBuilder.build();
14620 # }
14621 # // ...
14622 #
14623 # Example (iOS / Obj-C):
14624 #
14625 # // ...
14626 # static UIColor* fromProto(Color* protocolor) {
14627 # float red = [protocolor red];
14628 # float green = [protocolor green];
14629 # float blue = [protocolor blue];
14630 # FloatValue* alpha_wrapper = [protocolor alpha];
14631 # float alpha = 1.0;
14632 # if (alpha_wrapper != nil) {
14633 # alpha = [alpha_wrapper value];
14634 # }
14635 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
14636 # }
14637 #
14638 # static Color* toProto(UIColor* color) {
14639 # CGFloat red, green, blue, alpha;
14640 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
14641 # return nil;
14642 # }
14643 # Color* result = [Color alloc] init];
14644 # [result setRed:red];
14645 # [result setGreen:green];
14646 # [result setBlue:blue];
14647 # if (alpha <= 0.9999) {
14648 # [result setAlpha:floatWrapperWithValue(alpha)];
14649 # }
14650 # [result autorelease];
14651 # return result;
14652 # }
14653 # // ...
14654 #
14655 # Example (JavaScript):
14656 #
14657 # // ...
14658 #
14659 # var protoToCssColor = function(rgb_color) {
14660 # var redFrac = rgb_color.red || 0.0;
14661 # var greenFrac = rgb_color.green || 0.0;
14662 # var blueFrac = rgb_color.blue || 0.0;
14663 # var red = Math.floor(redFrac * 255);
14664 # var green = Math.floor(greenFrac * 255);
14665 # var blue = Math.floor(blueFrac * 255);
14666 #
14667 # if (!('alpha' in rgb_color)) {
14668 # return rgbToCssColor_(red, green, blue);
14669 # }
14670 #
14671 # var alphaFrac = rgb_color.alpha.value || 0.0;
14672 # var rgbParams = [red, green, blue].join(',');
14673 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
14674 # };
14675 #
14676 # var rgbToCssColor_ = function(red, green, blue) {
14677 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
14678 # var hexString = rgbNumber.toString(16);
14679 # var missingZeros = 6 - hexString.length;
14680 # var resultBuilder = ['#'];
14681 # for (var i = 0; i < missingZeros; i++) {
14682 # resultBuilder.push('0');
14683 # }
14684 # resultBuilder.push(hexString);
14685 # return resultBuilder.join('');
14686 # };
14687 #
14688 # // ...
14689 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
14690 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
14691 # the final pixel color is defined by the equation:
14692 #
14693 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
14694 #
14695 # This means that a value of 1.0 corresponds to a solid color, whereas
14696 # a value of 0.0 corresponds to a completely transparent color. This
14697 # uses a wrapper message rather than a simple float scalar so that it is
14698 # possible to distinguish between a default value and the value being unset.
14699 # If omitted, this color object is to be rendered as a solid color
14700 # (as if the alpha value had been explicitly given with a value of 1.0).
14701 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
14702 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
14703 },
14704 "width": 42, # The width of the border, in pixels.
14705 # Border widths must be between 0 and 3 pixels.
14706 "style": "A String", # The style of the border.
14707 },
14708 "bottom": { # A border along a cell. # The bottom border of the cell.
14709 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
14710 # for simplicity of conversion to/from color representations in various
14711 # languages over compactness; for example, the fields of this representation
14712 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
14713 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
14714 # method in iOS; and, with just a little work, it can be easily formatted into
14715 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
14716 #
14717 # Example (Java):
14718 #
14719 # import com.google.type.Color;
14720 #
14721 # // ...
14722 # public static java.awt.Color fromProto(Color protocolor) {
14723 # float alpha = protocolor.hasAlpha()
14724 # ? protocolor.getAlpha().getValue()
14725 # : 1.0;
14726 #
14727 # return new java.awt.Color(
14728 # protocolor.getRed(),
14729 # protocolor.getGreen(),
14730 # protocolor.getBlue(),
14731 # alpha);
14732 # }
14733 #
14734 # public static Color toProto(java.awt.Color color) {
14735 # float red = (float) color.getRed();
14736 # float green = (float) color.getGreen();
14737 # float blue = (float) color.getBlue();
14738 # float denominator = 255.0;
14739 # Color.Builder resultBuilder =
14740 # Color
14741 # .newBuilder()
14742 # .setRed(red / denominator)
14743 # .setGreen(green / denominator)
14744 # .setBlue(blue / denominator);
14745 # int alpha = color.getAlpha();
14746 # if (alpha != 255) {
14747 # result.setAlpha(
14748 # FloatValue
14749 # .newBuilder()
14750 # .setValue(((float) alpha) / denominator)
14751 # .build());
14752 # }
14753 # return resultBuilder.build();
14754 # }
14755 # // ...
14756 #
14757 # Example (iOS / Obj-C):
14758 #
14759 # // ...
14760 # static UIColor* fromProto(Color* protocolor) {
14761 # float red = [protocolor red];
14762 # float green = [protocolor green];
14763 # float blue = [protocolor blue];
14764 # FloatValue* alpha_wrapper = [protocolor alpha];
14765 # float alpha = 1.0;
14766 # if (alpha_wrapper != nil) {
14767 # alpha = [alpha_wrapper value];
14768 # }
14769 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
14770 # }
14771 #
14772 # static Color* toProto(UIColor* color) {
14773 # CGFloat red, green, blue, alpha;
14774 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
14775 # return nil;
14776 # }
14777 # Color* result = [Color alloc] init];
14778 # [result setRed:red];
14779 # [result setGreen:green];
14780 # [result setBlue:blue];
14781 # if (alpha <= 0.9999) {
14782 # [result setAlpha:floatWrapperWithValue(alpha)];
14783 # }
14784 # [result autorelease];
14785 # return result;
14786 # }
14787 # // ...
14788 #
14789 # Example (JavaScript):
14790 #
14791 # // ...
14792 #
14793 # var protoToCssColor = function(rgb_color) {
14794 # var redFrac = rgb_color.red || 0.0;
14795 # var greenFrac = rgb_color.green || 0.0;
14796 # var blueFrac = rgb_color.blue || 0.0;
14797 # var red = Math.floor(redFrac * 255);
14798 # var green = Math.floor(greenFrac * 255);
14799 # var blue = Math.floor(blueFrac * 255);
14800 #
14801 # if (!('alpha' in rgb_color)) {
14802 # return rgbToCssColor_(red, green, blue);
14803 # }
14804 #
14805 # var alphaFrac = rgb_color.alpha.value || 0.0;
14806 # var rgbParams = [red, green, blue].join(',');
14807 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
14808 # };
14809 #
14810 # var rgbToCssColor_ = function(red, green, blue) {
14811 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
14812 # var hexString = rgbNumber.toString(16);
14813 # var missingZeros = 6 - hexString.length;
14814 # var resultBuilder = ['#'];
14815 # for (var i = 0; i < missingZeros; i++) {
14816 # resultBuilder.push('0');
14817 # }
14818 # resultBuilder.push(hexString);
14819 # return resultBuilder.join('');
14820 # };
14821 #
14822 # // ...
14823 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
14824 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
14825 # the final pixel color is defined by the equation:
14826 #
14827 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
14828 #
14829 # This means that a value of 1.0 corresponds to a solid color, whereas
14830 # a value of 0.0 corresponds to a completely transparent color. This
14831 # uses a wrapper message rather than a simple float scalar so that it is
14832 # possible to distinguish between a default value and the value being unset.
14833 # If omitted, this color object is to be rendered as a solid color
14834 # (as if the alpha value had been explicitly given with a value of 1.0).
14835 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
14836 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
14837 },
14838 "width": 42, # The width of the border, in pixels.
14839 # Border widths must be between 0 and 3 pixels.
14840 "style": "A String", # The style of the border.
14841 },
14842 "left": { # A border along a cell. # The left border of the cell.
14843 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
14844 # for simplicity of conversion to/from color representations in various
14845 # languages over compactness; for example, the fields of this representation
14846 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
14847 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
14848 # method in iOS; and, with just a little work, it can be easily formatted into
14849 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
14850 #
14851 # Example (Java):
14852 #
14853 # import com.google.type.Color;
14854 #
14855 # // ...
14856 # public static java.awt.Color fromProto(Color protocolor) {
14857 # float alpha = protocolor.hasAlpha()
14858 # ? protocolor.getAlpha().getValue()
14859 # : 1.0;
14860 #
14861 # return new java.awt.Color(
14862 # protocolor.getRed(),
14863 # protocolor.getGreen(),
14864 # protocolor.getBlue(),
14865 # alpha);
14866 # }
14867 #
14868 # public static Color toProto(java.awt.Color color) {
14869 # float red = (float) color.getRed();
14870 # float green = (float) color.getGreen();
14871 # float blue = (float) color.getBlue();
14872 # float denominator = 255.0;
14873 # Color.Builder resultBuilder =
14874 # Color
14875 # .newBuilder()
14876 # .setRed(red / denominator)
14877 # .setGreen(green / denominator)
14878 # .setBlue(blue / denominator);
14879 # int alpha = color.getAlpha();
14880 # if (alpha != 255) {
14881 # result.setAlpha(
14882 # FloatValue
14883 # .newBuilder()
14884 # .setValue(((float) alpha) / denominator)
14885 # .build());
14886 # }
14887 # return resultBuilder.build();
14888 # }
14889 # // ...
14890 #
14891 # Example (iOS / Obj-C):
14892 #
14893 # // ...
14894 # static UIColor* fromProto(Color* protocolor) {
14895 # float red = [protocolor red];
14896 # float green = [protocolor green];
14897 # float blue = [protocolor blue];
14898 # FloatValue* alpha_wrapper = [protocolor alpha];
14899 # float alpha = 1.0;
14900 # if (alpha_wrapper != nil) {
14901 # alpha = [alpha_wrapper value];
14902 # }
14903 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
14904 # }
14905 #
14906 # static Color* toProto(UIColor* color) {
14907 # CGFloat red, green, blue, alpha;
14908 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
14909 # return nil;
14910 # }
14911 # Color* result = [Color alloc] init];
14912 # [result setRed:red];
14913 # [result setGreen:green];
14914 # [result setBlue:blue];
14915 # if (alpha <= 0.9999) {
14916 # [result setAlpha:floatWrapperWithValue(alpha)];
14917 # }
14918 # [result autorelease];
14919 # return result;
14920 # }
14921 # // ...
14922 #
14923 # Example (JavaScript):
14924 #
14925 # // ...
14926 #
14927 # var protoToCssColor = function(rgb_color) {
14928 # var redFrac = rgb_color.red || 0.0;
14929 # var greenFrac = rgb_color.green || 0.0;
14930 # var blueFrac = rgb_color.blue || 0.0;
14931 # var red = Math.floor(redFrac * 255);
14932 # var green = Math.floor(greenFrac * 255);
14933 # var blue = Math.floor(blueFrac * 255);
14934 #
14935 # if (!('alpha' in rgb_color)) {
14936 # return rgbToCssColor_(red, green, blue);
14937 # }
14938 #
14939 # var alphaFrac = rgb_color.alpha.value || 0.0;
14940 # var rgbParams = [red, green, blue].join(',');
14941 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
14942 # };
14943 #
14944 # var rgbToCssColor_ = function(red, green, blue) {
14945 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
14946 # var hexString = rgbNumber.toString(16);
14947 # var missingZeros = 6 - hexString.length;
14948 # var resultBuilder = ['#'];
14949 # for (var i = 0; i < missingZeros; i++) {
14950 # resultBuilder.push('0');
14951 # }
14952 # resultBuilder.push(hexString);
14953 # return resultBuilder.join('');
14954 # };
14955 #
14956 # // ...
14957 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
14958 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
14959 # the final pixel color is defined by the equation:
14960 #
14961 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
14962 #
14963 # This means that a value of 1.0 corresponds to a solid color, whereas
14964 # a value of 0.0 corresponds to a completely transparent color. This
14965 # uses a wrapper message rather than a simple float scalar so that it is
14966 # possible to distinguish between a default value and the value being unset.
14967 # If omitted, this color object is to be rendered as a solid color
14968 # (as if the alpha value had been explicitly given with a value of 1.0).
14969 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
14970 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
14971 },
14972 "width": 42, # The width of the border, in pixels.
14973 # Border widths must be between 0 and 3 pixels.
14974 "style": "A String", # The style of the border.
14975 },
14976 },
14977 "wrapStrategy": "A String", # The wrap strategy for the value in the cell.
14978 },
14979 },
14980 "gradientRule": { # A rule that applies a gradient color scale format, based on # The formatting will vary based on the gradients in the rule.
14981 # the interpolation points listed. The format of a cell will vary
14982 # based on its contents as compared to the values of the interpolation
14983 # points.
14984 "maxpoint": { # A single interpolation point a gradient conditional format. # The final interpolation point.
14985 # These pin the gradient color scale according to the color,
14986 # type and value chosen.
14987 "color": { # Represents a color in the RGBA color space. This representation is designed # The color this interpolation point should use.
14988 # for simplicity of conversion to/from color representations in various
14989 # languages over compactness; for example, the fields of this representation
14990 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
14991 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
14992 # method in iOS; and, with just a little work, it can be easily formatted into
14993 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
14994 #
14995 # Example (Java):
14996 #
14997 # import com.google.type.Color;
14998 #
14999 # // ...
15000 # public static java.awt.Color fromProto(Color protocolor) {
15001 # float alpha = protocolor.hasAlpha()
15002 # ? protocolor.getAlpha().getValue()
15003 # : 1.0;
15004 #
15005 # return new java.awt.Color(
15006 # protocolor.getRed(),
15007 # protocolor.getGreen(),
15008 # protocolor.getBlue(),
15009 # alpha);
15010 # }
15011 #
15012 # public static Color toProto(java.awt.Color color) {
15013 # float red = (float) color.getRed();
15014 # float green = (float) color.getGreen();
15015 # float blue = (float) color.getBlue();
15016 # float denominator = 255.0;
15017 # Color.Builder resultBuilder =
15018 # Color
15019 # .newBuilder()
15020 # .setRed(red / denominator)
15021 # .setGreen(green / denominator)
15022 # .setBlue(blue / denominator);
15023 # int alpha = color.getAlpha();
15024 # if (alpha != 255) {
15025 # result.setAlpha(
15026 # FloatValue
15027 # .newBuilder()
15028 # .setValue(((float) alpha) / denominator)
15029 # .build());
15030 # }
15031 # return resultBuilder.build();
15032 # }
15033 # // ...
15034 #
15035 # Example (iOS / Obj-C):
15036 #
15037 # // ...
15038 # static UIColor* fromProto(Color* protocolor) {
15039 # float red = [protocolor red];
15040 # float green = [protocolor green];
15041 # float blue = [protocolor blue];
15042 # FloatValue* alpha_wrapper = [protocolor alpha];
15043 # float alpha = 1.0;
15044 # if (alpha_wrapper != nil) {
15045 # alpha = [alpha_wrapper value];
15046 # }
15047 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
15048 # }
15049 #
15050 # static Color* toProto(UIColor* color) {
15051 # CGFloat red, green, blue, alpha;
15052 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
15053 # return nil;
15054 # }
15055 # Color* result = [Color alloc] init];
15056 # [result setRed:red];
15057 # [result setGreen:green];
15058 # [result setBlue:blue];
15059 # if (alpha <= 0.9999) {
15060 # [result setAlpha:floatWrapperWithValue(alpha)];
15061 # }
15062 # [result autorelease];
15063 # return result;
15064 # }
15065 # // ...
15066 #
15067 # Example (JavaScript):
15068 #
15069 # // ...
15070 #
15071 # var protoToCssColor = function(rgb_color) {
15072 # var redFrac = rgb_color.red || 0.0;
15073 # var greenFrac = rgb_color.green || 0.0;
15074 # var blueFrac = rgb_color.blue || 0.0;
15075 # var red = Math.floor(redFrac * 255);
15076 # var green = Math.floor(greenFrac * 255);
15077 # var blue = Math.floor(blueFrac * 255);
15078 #
15079 # if (!('alpha' in rgb_color)) {
15080 # return rgbToCssColor_(red, green, blue);
15081 # }
15082 #
15083 # var alphaFrac = rgb_color.alpha.value || 0.0;
15084 # var rgbParams = [red, green, blue].join(',');
15085 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
15086 # };
15087 #
15088 # var rgbToCssColor_ = function(red, green, blue) {
15089 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
15090 # var hexString = rgbNumber.toString(16);
15091 # var missingZeros = 6 - hexString.length;
15092 # var resultBuilder = ['#'];
15093 # for (var i = 0; i < missingZeros; i++) {
15094 # resultBuilder.push('0');
15095 # }
15096 # resultBuilder.push(hexString);
15097 # return resultBuilder.join('');
15098 # };
15099 #
15100 # // ...
15101 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
15102 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
15103 # the final pixel color is defined by the equation:
15104 #
15105 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
15106 #
15107 # This means that a value of 1.0 corresponds to a solid color, whereas
15108 # a value of 0.0 corresponds to a completely transparent color. This
15109 # uses a wrapper message rather than a simple float scalar so that it is
15110 # possible to distinguish between a default value and the value being unset.
15111 # If omitted, this color object is to be rendered as a solid color
15112 # (as if the alpha value had been explicitly given with a value of 1.0).
15113 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
15114 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
15115 },
15116 "type": "A String", # How the value should be interpreted.
15117 "value": "A String", # The value this interpolation point uses. May be a formula.
15118 # Unused if type is MIN or
15119 # MAX.
15120 },
15121 "midpoint": { # A single interpolation point a gradient conditional format. # An optional midway interpolation point.
15122 # These pin the gradient color scale according to the color,
15123 # type and value chosen.
15124 "color": { # Represents a color in the RGBA color space. This representation is designed # The color this interpolation point should use.
15125 # for simplicity of conversion to/from color representations in various
15126 # languages over compactness; for example, the fields of this representation
15127 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
15128 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
15129 # method in iOS; and, with just a little work, it can be easily formatted into
15130 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
15131 #
15132 # Example (Java):
15133 #
15134 # import com.google.type.Color;
15135 #
15136 # // ...
15137 # public static java.awt.Color fromProto(Color protocolor) {
15138 # float alpha = protocolor.hasAlpha()
15139 # ? protocolor.getAlpha().getValue()
15140 # : 1.0;
15141 #
15142 # return new java.awt.Color(
15143 # protocolor.getRed(),
15144 # protocolor.getGreen(),
15145 # protocolor.getBlue(),
15146 # alpha);
15147 # }
15148 #
15149 # public static Color toProto(java.awt.Color color) {
15150 # float red = (float) color.getRed();
15151 # float green = (float) color.getGreen();
15152 # float blue = (float) color.getBlue();
15153 # float denominator = 255.0;
15154 # Color.Builder resultBuilder =
15155 # Color
15156 # .newBuilder()
15157 # .setRed(red / denominator)
15158 # .setGreen(green / denominator)
15159 # .setBlue(blue / denominator);
15160 # int alpha = color.getAlpha();
15161 # if (alpha != 255) {
15162 # result.setAlpha(
15163 # FloatValue
15164 # .newBuilder()
15165 # .setValue(((float) alpha) / denominator)
15166 # .build());
15167 # }
15168 # return resultBuilder.build();
15169 # }
15170 # // ...
15171 #
15172 # Example (iOS / Obj-C):
15173 #
15174 # // ...
15175 # static UIColor* fromProto(Color* protocolor) {
15176 # float red = [protocolor red];
15177 # float green = [protocolor green];
15178 # float blue = [protocolor blue];
15179 # FloatValue* alpha_wrapper = [protocolor alpha];
15180 # float alpha = 1.0;
15181 # if (alpha_wrapper != nil) {
15182 # alpha = [alpha_wrapper value];
15183 # }
15184 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
15185 # }
15186 #
15187 # static Color* toProto(UIColor* color) {
15188 # CGFloat red, green, blue, alpha;
15189 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
15190 # return nil;
15191 # }
15192 # Color* result = [Color alloc] init];
15193 # [result setRed:red];
15194 # [result setGreen:green];
15195 # [result setBlue:blue];
15196 # if (alpha <= 0.9999) {
15197 # [result setAlpha:floatWrapperWithValue(alpha)];
15198 # }
15199 # [result autorelease];
15200 # return result;
15201 # }
15202 # // ...
15203 #
15204 # Example (JavaScript):
15205 #
15206 # // ...
15207 #
15208 # var protoToCssColor = function(rgb_color) {
15209 # var redFrac = rgb_color.red || 0.0;
15210 # var greenFrac = rgb_color.green || 0.0;
15211 # var blueFrac = rgb_color.blue || 0.0;
15212 # var red = Math.floor(redFrac * 255);
15213 # var green = Math.floor(greenFrac * 255);
15214 # var blue = Math.floor(blueFrac * 255);
15215 #
15216 # if (!('alpha' in rgb_color)) {
15217 # return rgbToCssColor_(red, green, blue);
15218 # }
15219 #
15220 # var alphaFrac = rgb_color.alpha.value || 0.0;
15221 # var rgbParams = [red, green, blue].join(',');
15222 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
15223 # };
15224 #
15225 # var rgbToCssColor_ = function(red, green, blue) {
15226 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
15227 # var hexString = rgbNumber.toString(16);
15228 # var missingZeros = 6 - hexString.length;
15229 # var resultBuilder = ['#'];
15230 # for (var i = 0; i < missingZeros; i++) {
15231 # resultBuilder.push('0');
15232 # }
15233 # resultBuilder.push(hexString);
15234 # return resultBuilder.join('');
15235 # };
15236 #
15237 # // ...
15238 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
15239 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
15240 # the final pixel color is defined by the equation:
15241 #
15242 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
15243 #
15244 # This means that a value of 1.0 corresponds to a solid color, whereas
15245 # a value of 0.0 corresponds to a completely transparent color. This
15246 # uses a wrapper message rather than a simple float scalar so that it is
15247 # possible to distinguish between a default value and the value being unset.
15248 # If omitted, this color object is to be rendered as a solid color
15249 # (as if the alpha value had been explicitly given with a value of 1.0).
15250 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
15251 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
15252 },
15253 "type": "A String", # How the value should be interpreted.
15254 "value": "A String", # The value this interpolation point uses. May be a formula.
15255 # Unused if type is MIN or
15256 # MAX.
15257 },
15258 "minpoint": { # A single interpolation point a gradient conditional format. # The starting interpolation point.
15259 # These pin the gradient color scale according to the color,
15260 # type and value chosen.
15261 "color": { # Represents a color in the RGBA color space. This representation is designed # The color this interpolation point should use.
15262 # for simplicity of conversion to/from color representations in various
15263 # languages over compactness; for example, the fields of this representation
15264 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
15265 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
15266 # method in iOS; and, with just a little work, it can be easily formatted into
15267 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
15268 #
15269 # Example (Java):
15270 #
15271 # import com.google.type.Color;
15272 #
15273 # // ...
15274 # public static java.awt.Color fromProto(Color protocolor) {
15275 # float alpha = protocolor.hasAlpha()
15276 # ? protocolor.getAlpha().getValue()
15277 # : 1.0;
15278 #
15279 # return new java.awt.Color(
15280 # protocolor.getRed(),
15281 # protocolor.getGreen(),
15282 # protocolor.getBlue(),
15283 # alpha);
15284 # }
15285 #
15286 # public static Color toProto(java.awt.Color color) {
15287 # float red = (float) color.getRed();
15288 # float green = (float) color.getGreen();
15289 # float blue = (float) color.getBlue();
15290 # float denominator = 255.0;
15291 # Color.Builder resultBuilder =
15292 # Color
15293 # .newBuilder()
15294 # .setRed(red / denominator)
15295 # .setGreen(green / denominator)
15296 # .setBlue(blue / denominator);
15297 # int alpha = color.getAlpha();
15298 # if (alpha != 255) {
15299 # result.setAlpha(
15300 # FloatValue
15301 # .newBuilder()
15302 # .setValue(((float) alpha) / denominator)
15303 # .build());
15304 # }
15305 # return resultBuilder.build();
15306 # }
15307 # // ...
15308 #
15309 # Example (iOS / Obj-C):
15310 #
15311 # // ...
15312 # static UIColor* fromProto(Color* protocolor) {
15313 # float red = [protocolor red];
15314 # float green = [protocolor green];
15315 # float blue = [protocolor blue];
15316 # FloatValue* alpha_wrapper = [protocolor alpha];
15317 # float alpha = 1.0;
15318 # if (alpha_wrapper != nil) {
15319 # alpha = [alpha_wrapper value];
15320 # }
15321 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
15322 # }
15323 #
15324 # static Color* toProto(UIColor* color) {
15325 # CGFloat red, green, blue, alpha;
15326 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
15327 # return nil;
15328 # }
15329 # Color* result = [Color alloc] init];
15330 # [result setRed:red];
15331 # [result setGreen:green];
15332 # [result setBlue:blue];
15333 # if (alpha <= 0.9999) {
15334 # [result setAlpha:floatWrapperWithValue(alpha)];
15335 # }
15336 # [result autorelease];
15337 # return result;
15338 # }
15339 # // ...
15340 #
15341 # Example (JavaScript):
15342 #
15343 # // ...
15344 #
15345 # var protoToCssColor = function(rgb_color) {
15346 # var redFrac = rgb_color.red || 0.0;
15347 # var greenFrac = rgb_color.green || 0.0;
15348 # var blueFrac = rgb_color.blue || 0.0;
15349 # var red = Math.floor(redFrac * 255);
15350 # var green = Math.floor(greenFrac * 255);
15351 # var blue = Math.floor(blueFrac * 255);
15352 #
15353 # if (!('alpha' in rgb_color)) {
15354 # return rgbToCssColor_(red, green, blue);
15355 # }
15356 #
15357 # var alphaFrac = rgb_color.alpha.value || 0.0;
15358 # var rgbParams = [red, green, blue].join(',');
15359 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
15360 # };
15361 #
15362 # var rgbToCssColor_ = function(red, green, blue) {
15363 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
15364 # var hexString = rgbNumber.toString(16);
15365 # var missingZeros = 6 - hexString.length;
15366 # var resultBuilder = ['#'];
15367 # for (var i = 0; i < missingZeros; i++) {
15368 # resultBuilder.push('0');
15369 # }
15370 # resultBuilder.push(hexString);
15371 # return resultBuilder.join('');
15372 # };
15373 #
15374 # // ...
15375 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
15376 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
15377 # the final pixel color is defined by the equation:
15378 #
15379 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
15380 #
15381 # This means that a value of 1.0 corresponds to a solid color, whereas
15382 # a value of 0.0 corresponds to a completely transparent color. This
15383 # uses a wrapper message rather than a simple float scalar so that it is
15384 # possible to distinguish between a default value and the value being unset.
15385 # If omitted, this color object is to be rendered as a solid color
15386 # (as if the alpha value had been explicitly given with a value of 1.0).
15387 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
15388 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
15389 },
15390 "type": "A String", # How the value should be interpreted.
15391 "value": "A String", # The value this interpolation point uses. May be a formula.
15392 # Unused if type is MIN or
15393 # MAX.
15394 },
15395 },
15396 },
15397 "newRule": { # A rule describing a conditional format. # The new rule that replaced the old rule (if replacing),
15398 # or the rule that was moved (if moved)
15399 "ranges": [ # The ranges that will be formatted if the condition is true.
15400 # All the ranges must be on the same grid.
15401 { # A range on a sheet.
15402 # All indexes are zero-based.
15403 # Indexes are half open, e.g the start index is inclusive
15404 # and the end index is exclusive -- [start_index, end_index).
15405 # Missing indexes indicate the range is unbounded on that side.
15406 #
15407 # For example, if "Sheet1" is grid ID 0, then:
15408 #
15409 # Sheet1!A1:A1 == sheet_id: 0,
15410 # start_row_index: 0, end_row_index: 1,
15411 # start_column_index: 0, end_column_index: 1
15412 #
15413 # Sheet1!A3:B4 == sheet_id: 0,
15414 # start_row_index: 2, end_row_index: 4,
15415 # start_column_index: 0, end_column_index: 2
15416 #
15417 # Sheet1!A:B == sheet_id: 0,
15418 # start_column_index: 0, end_column_index: 2
15419 #
15420 # Sheet1!A5:B == sheet_id: 0,
15421 # start_row_index: 4,
15422 # start_column_index: 0, end_column_index: 2
15423 #
15424 # Sheet1 == sheet_id:0
15425 #
15426 # The start index must always be less than or equal to the end index.
15427 # If the start index equals the end index, then the range is empty.
15428 # Empty ranges are typically not meaningful and are usually rendered in the
15429 # UI as `#REF!`.
15430 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
15431 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
15432 "sheetId": 42, # The sheet this range is on.
15433 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
15434 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
15435 },
15436 ],
15437 "booleanRule": { # A rule that may or may not match, depending on the condition. # The formatting is either "on" or "off" according to the rule.
15438 "condition": { # A condition that can evaluate to true or false. # The condition of the rule. If the condition evaluates to true,
15439 # the format will be applied.
15440 # BooleanConditions are used by conditional formatting,
15441 # data validation, and the criteria in filters.
15442 "type": "A String", # The type of condition.
15443 "values": [ # The values of the condition. The number of supported values depends
15444 # on the condition type. Some support zero values,
15445 # others one or two values,
15446 # and ConditionType.ONE_OF_LIST supports an arbitrary number of values.
15447 { # The value of the condition.
15448 "relativeDate": "A String", # A relative date (based on the current date).
15449 # Valid only if the type is
15450 # DATE_BEFORE,
15451 # DATE_AFTER,
15452 # DATE_ON_OR_BEFORE or
15453 # DATE_ON_OR_AFTER.
15454 #
15455 # Relative dates are not supported in data validation.
15456 # They are supported only in conditional formatting and
15457 # conditional filters.
15458 "userEnteredValue": "A String", # A value the condition is based on.
15459 # The value will be parsed as if the user typed into a cell.
15460 # Formulas are supported (and must begin with an `=`).
15461 },
15462 ],
15463 },
15464 "format": { # The format of a cell. # The format to apply.
15465 # Conditional formatting can only apply a subset of formatting:
15466 # bold, italic,
15467 # strikethrough,
15468 # foreground color &
15469 # background color.
15470 "numberFormat": { # The number format of a cell. # A format describing how number values should be represented to the user.
15471 # When updating, all fields must be set.
15472 "pattern": "A String", # Pattern string used for formatting.
15473 "type": "A String", # The type of the number format.
15474 },
15475 "textDirection": "A String", # The direction of the text in the cell.
15476 "padding": { # The amount of padding around the cell, in pixels. # The padding of the cell.
15477 # When updating padding, every field must be specified.
15478 "top": 42, # The top padding of the cell.
15479 "right": 42, # The right padding of the cell.
15480 "bottom": 42, # The bottom padding of the cell.
15481 "left": 42, # The left padding of the cell.
15482 },
15483 "horizontalAlignment": "A String", # The horizontal alignment of the value in cell.
15484 "backgroundColor": { # Represents a color in the RGBA color space. This representation is designed # The background color of the cell.
15485 # for simplicity of conversion to/from color representations in various
15486 # languages over compactness; for example, the fields of this representation
15487 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
15488 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
15489 # method in iOS; and, with just a little work, it can be easily formatted into
15490 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
15491 #
15492 # Example (Java):
15493 #
15494 # import com.google.type.Color;
15495 #
15496 # // ...
15497 # public static java.awt.Color fromProto(Color protocolor) {
15498 # float alpha = protocolor.hasAlpha()
15499 # ? protocolor.getAlpha().getValue()
15500 # : 1.0;
15501 #
15502 # return new java.awt.Color(
15503 # protocolor.getRed(),
15504 # protocolor.getGreen(),
15505 # protocolor.getBlue(),
15506 # alpha);
15507 # }
15508 #
15509 # public static Color toProto(java.awt.Color color) {
15510 # float red = (float) color.getRed();
15511 # float green = (float) color.getGreen();
15512 # float blue = (float) color.getBlue();
15513 # float denominator = 255.0;
15514 # Color.Builder resultBuilder =
15515 # Color
15516 # .newBuilder()
15517 # .setRed(red / denominator)
15518 # .setGreen(green / denominator)
15519 # .setBlue(blue / denominator);
15520 # int alpha = color.getAlpha();
15521 # if (alpha != 255) {
15522 # result.setAlpha(
15523 # FloatValue
15524 # .newBuilder()
15525 # .setValue(((float) alpha) / denominator)
15526 # .build());
15527 # }
15528 # return resultBuilder.build();
15529 # }
15530 # // ...
15531 #
15532 # Example (iOS / Obj-C):
15533 #
15534 # // ...
15535 # static UIColor* fromProto(Color* protocolor) {
15536 # float red = [protocolor red];
15537 # float green = [protocolor green];
15538 # float blue = [protocolor blue];
15539 # FloatValue* alpha_wrapper = [protocolor alpha];
15540 # float alpha = 1.0;
15541 # if (alpha_wrapper != nil) {
15542 # alpha = [alpha_wrapper value];
15543 # }
15544 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
15545 # }
15546 #
15547 # static Color* toProto(UIColor* color) {
15548 # CGFloat red, green, blue, alpha;
15549 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
15550 # return nil;
15551 # }
15552 # Color* result = [Color alloc] init];
15553 # [result setRed:red];
15554 # [result setGreen:green];
15555 # [result setBlue:blue];
15556 # if (alpha <= 0.9999) {
15557 # [result setAlpha:floatWrapperWithValue(alpha)];
15558 # }
15559 # [result autorelease];
15560 # return result;
15561 # }
15562 # // ...
15563 #
15564 # Example (JavaScript):
15565 #
15566 # // ...
15567 #
15568 # var protoToCssColor = function(rgb_color) {
15569 # var redFrac = rgb_color.red || 0.0;
15570 # var greenFrac = rgb_color.green || 0.0;
15571 # var blueFrac = rgb_color.blue || 0.0;
15572 # var red = Math.floor(redFrac * 255);
15573 # var green = Math.floor(greenFrac * 255);
15574 # var blue = Math.floor(blueFrac * 255);
15575 #
15576 # if (!('alpha' in rgb_color)) {
15577 # return rgbToCssColor_(red, green, blue);
15578 # }
15579 #
15580 # var alphaFrac = rgb_color.alpha.value || 0.0;
15581 # var rgbParams = [red, green, blue].join(',');
15582 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
15583 # };
15584 #
15585 # var rgbToCssColor_ = function(red, green, blue) {
15586 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
15587 # var hexString = rgbNumber.toString(16);
15588 # var missingZeros = 6 - hexString.length;
15589 # var resultBuilder = ['#'];
15590 # for (var i = 0; i < missingZeros; i++) {
15591 # resultBuilder.push('0');
15592 # }
15593 # resultBuilder.push(hexString);
15594 # return resultBuilder.join('');
15595 # };
15596 #
15597 # // ...
15598 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
15599 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
15600 # the final pixel color is defined by the equation:
15601 #
15602 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
15603 #
15604 # This means that a value of 1.0 corresponds to a solid color, whereas
15605 # a value of 0.0 corresponds to a completely transparent color. This
15606 # uses a wrapper message rather than a simple float scalar so that it is
15607 # possible to distinguish between a default value and the value being unset.
15608 # If omitted, this color object is to be rendered as a solid color
15609 # (as if the alpha value had been explicitly given with a value of 1.0).
15610 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
15611 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
15612 },
15613 "verticalAlignment": "A String", # The vertical alignment of the value in cell.
15614 "textFormat": { # The format of a run of text in a cell. # The format of the text in the cell (unless overridden by a format run).
15615 # Absent values indicate that the field isn't specified.
15616 "foregroundColor": { # Represents a color in the RGBA color space. This representation is designed # The foreground color of the text.
15617 # for simplicity of conversion to/from color representations in various
15618 # languages over compactness; for example, the fields of this representation
15619 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
15620 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
15621 # method in iOS; and, with just a little work, it can be easily formatted into
15622 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
15623 #
15624 # Example (Java):
15625 #
15626 # import com.google.type.Color;
15627 #
15628 # // ...
15629 # public static java.awt.Color fromProto(Color protocolor) {
15630 # float alpha = protocolor.hasAlpha()
15631 # ? protocolor.getAlpha().getValue()
15632 # : 1.0;
15633 #
15634 # return new java.awt.Color(
15635 # protocolor.getRed(),
15636 # protocolor.getGreen(),
15637 # protocolor.getBlue(),
15638 # alpha);
15639 # }
15640 #
15641 # public static Color toProto(java.awt.Color color) {
15642 # float red = (float) color.getRed();
15643 # float green = (float) color.getGreen();
15644 # float blue = (float) color.getBlue();
15645 # float denominator = 255.0;
15646 # Color.Builder resultBuilder =
15647 # Color
15648 # .newBuilder()
15649 # .setRed(red / denominator)
15650 # .setGreen(green / denominator)
15651 # .setBlue(blue / denominator);
15652 # int alpha = color.getAlpha();
15653 # if (alpha != 255) {
15654 # result.setAlpha(
15655 # FloatValue
15656 # .newBuilder()
15657 # .setValue(((float) alpha) / denominator)
15658 # .build());
15659 # }
15660 # return resultBuilder.build();
15661 # }
15662 # // ...
15663 #
15664 # Example (iOS / Obj-C):
15665 #
15666 # // ...
15667 # static UIColor* fromProto(Color* protocolor) {
15668 # float red = [protocolor red];
15669 # float green = [protocolor green];
15670 # float blue = [protocolor blue];
15671 # FloatValue* alpha_wrapper = [protocolor alpha];
15672 # float alpha = 1.0;
15673 # if (alpha_wrapper != nil) {
15674 # alpha = [alpha_wrapper value];
15675 # }
15676 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
15677 # }
15678 #
15679 # static Color* toProto(UIColor* color) {
15680 # CGFloat red, green, blue, alpha;
15681 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
15682 # return nil;
15683 # }
15684 # Color* result = [Color alloc] init];
15685 # [result setRed:red];
15686 # [result setGreen:green];
15687 # [result setBlue:blue];
15688 # if (alpha <= 0.9999) {
15689 # [result setAlpha:floatWrapperWithValue(alpha)];
15690 # }
15691 # [result autorelease];
15692 # return result;
15693 # }
15694 # // ...
15695 #
15696 # Example (JavaScript):
15697 #
15698 # // ...
15699 #
15700 # var protoToCssColor = function(rgb_color) {
15701 # var redFrac = rgb_color.red || 0.0;
15702 # var greenFrac = rgb_color.green || 0.0;
15703 # var blueFrac = rgb_color.blue || 0.0;
15704 # var red = Math.floor(redFrac * 255);
15705 # var green = Math.floor(greenFrac * 255);
15706 # var blue = Math.floor(blueFrac * 255);
15707 #
15708 # if (!('alpha' in rgb_color)) {
15709 # return rgbToCssColor_(red, green, blue);
15710 # }
15711 #
15712 # var alphaFrac = rgb_color.alpha.value || 0.0;
15713 # var rgbParams = [red, green, blue].join(',');
15714 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
15715 # };
15716 #
15717 # var rgbToCssColor_ = function(red, green, blue) {
15718 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
15719 # var hexString = rgbNumber.toString(16);
15720 # var missingZeros = 6 - hexString.length;
15721 # var resultBuilder = ['#'];
15722 # for (var i = 0; i < missingZeros; i++) {
15723 # resultBuilder.push('0');
15724 # }
15725 # resultBuilder.push(hexString);
15726 # return resultBuilder.join('');
15727 # };
15728 #
15729 # // ...
15730 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
15731 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
15732 # the final pixel color is defined by the equation:
15733 #
15734 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
15735 #
15736 # This means that a value of 1.0 corresponds to a solid color, whereas
15737 # a value of 0.0 corresponds to a completely transparent color. This
15738 # uses a wrapper message rather than a simple float scalar so that it is
15739 # possible to distinguish between a default value and the value being unset.
15740 # If omitted, this color object is to be rendered as a solid color
15741 # (as if the alpha value had been explicitly given with a value of 1.0).
15742 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
15743 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
15744 },
15745 "bold": True or False, # True if the text is bold.
15746 "strikethrough": True or False, # True if the text has a strikethrough.
15747 "fontFamily": "A String", # The font family.
15748 "fontSize": 42, # The size of the font.
15749 "italic": True or False, # True if the text is italicized.
15750 "underline": True or False, # True if the text is underlined.
15751 },
15752 "hyperlinkDisplayType": "A String", # How a hyperlink, if it exists, should be displayed in the cell.
15753 "borders": { # The borders of the cell. # The borders of the cell.
15754 "top": { # A border along a cell. # The top border of the cell.
15755 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
15756 # for simplicity of conversion to/from color representations in various
15757 # languages over compactness; for example, the fields of this representation
15758 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
15759 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
15760 # method in iOS; and, with just a little work, it can be easily formatted into
15761 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
15762 #
15763 # Example (Java):
15764 #
15765 # import com.google.type.Color;
15766 #
15767 # // ...
15768 # public static java.awt.Color fromProto(Color protocolor) {
15769 # float alpha = protocolor.hasAlpha()
15770 # ? protocolor.getAlpha().getValue()
15771 # : 1.0;
15772 #
15773 # return new java.awt.Color(
15774 # protocolor.getRed(),
15775 # protocolor.getGreen(),
15776 # protocolor.getBlue(),
15777 # alpha);
15778 # }
15779 #
15780 # public static Color toProto(java.awt.Color color) {
15781 # float red = (float) color.getRed();
15782 # float green = (float) color.getGreen();
15783 # float blue = (float) color.getBlue();
15784 # float denominator = 255.0;
15785 # Color.Builder resultBuilder =
15786 # Color
15787 # .newBuilder()
15788 # .setRed(red / denominator)
15789 # .setGreen(green / denominator)
15790 # .setBlue(blue / denominator);
15791 # int alpha = color.getAlpha();
15792 # if (alpha != 255) {
15793 # result.setAlpha(
15794 # FloatValue
15795 # .newBuilder()
15796 # .setValue(((float) alpha) / denominator)
15797 # .build());
15798 # }
15799 # return resultBuilder.build();
15800 # }
15801 # // ...
15802 #
15803 # Example (iOS / Obj-C):
15804 #
15805 # // ...
15806 # static UIColor* fromProto(Color* protocolor) {
15807 # float red = [protocolor red];
15808 # float green = [protocolor green];
15809 # float blue = [protocolor blue];
15810 # FloatValue* alpha_wrapper = [protocolor alpha];
15811 # float alpha = 1.0;
15812 # if (alpha_wrapper != nil) {
15813 # alpha = [alpha_wrapper value];
15814 # }
15815 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
15816 # }
15817 #
15818 # static Color* toProto(UIColor* color) {
15819 # CGFloat red, green, blue, alpha;
15820 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
15821 # return nil;
15822 # }
15823 # Color* result = [Color alloc] init];
15824 # [result setRed:red];
15825 # [result setGreen:green];
15826 # [result setBlue:blue];
15827 # if (alpha <= 0.9999) {
15828 # [result setAlpha:floatWrapperWithValue(alpha)];
15829 # }
15830 # [result autorelease];
15831 # return result;
15832 # }
15833 # // ...
15834 #
15835 # Example (JavaScript):
15836 #
15837 # // ...
15838 #
15839 # var protoToCssColor = function(rgb_color) {
15840 # var redFrac = rgb_color.red || 0.0;
15841 # var greenFrac = rgb_color.green || 0.0;
15842 # var blueFrac = rgb_color.blue || 0.0;
15843 # var red = Math.floor(redFrac * 255);
15844 # var green = Math.floor(greenFrac * 255);
15845 # var blue = Math.floor(blueFrac * 255);
15846 #
15847 # if (!('alpha' in rgb_color)) {
15848 # return rgbToCssColor_(red, green, blue);
15849 # }
15850 #
15851 # var alphaFrac = rgb_color.alpha.value || 0.0;
15852 # var rgbParams = [red, green, blue].join(',');
15853 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
15854 # };
15855 #
15856 # var rgbToCssColor_ = function(red, green, blue) {
15857 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
15858 # var hexString = rgbNumber.toString(16);
15859 # var missingZeros = 6 - hexString.length;
15860 # var resultBuilder = ['#'];
15861 # for (var i = 0; i < missingZeros; i++) {
15862 # resultBuilder.push('0');
15863 # }
15864 # resultBuilder.push(hexString);
15865 # return resultBuilder.join('');
15866 # };
15867 #
15868 # // ...
15869 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
15870 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
15871 # the final pixel color is defined by the equation:
15872 #
15873 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
15874 #
15875 # This means that a value of 1.0 corresponds to a solid color, whereas
15876 # a value of 0.0 corresponds to a completely transparent color. This
15877 # uses a wrapper message rather than a simple float scalar so that it is
15878 # possible to distinguish between a default value and the value being unset.
15879 # If omitted, this color object is to be rendered as a solid color
15880 # (as if the alpha value had been explicitly given with a value of 1.0).
15881 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
15882 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
15883 },
15884 "width": 42, # The width of the border, in pixels.
15885 # Border widths must be between 0 and 3 pixels.
15886 "style": "A String", # The style of the border.
15887 },
15888 "right": { # A border along a cell. # The right border of the cell.
15889 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
15890 # for simplicity of conversion to/from color representations in various
15891 # languages over compactness; for example, the fields of this representation
15892 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
15893 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
15894 # method in iOS; and, with just a little work, it can be easily formatted into
15895 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
15896 #
15897 # Example (Java):
15898 #
15899 # import com.google.type.Color;
15900 #
15901 # // ...
15902 # public static java.awt.Color fromProto(Color protocolor) {
15903 # float alpha = protocolor.hasAlpha()
15904 # ? protocolor.getAlpha().getValue()
15905 # : 1.0;
15906 #
15907 # return new java.awt.Color(
15908 # protocolor.getRed(),
15909 # protocolor.getGreen(),
15910 # protocolor.getBlue(),
15911 # alpha);
15912 # }
15913 #
15914 # public static Color toProto(java.awt.Color color) {
15915 # float red = (float) color.getRed();
15916 # float green = (float) color.getGreen();
15917 # float blue = (float) color.getBlue();
15918 # float denominator = 255.0;
15919 # Color.Builder resultBuilder =
15920 # Color
15921 # .newBuilder()
15922 # .setRed(red / denominator)
15923 # .setGreen(green / denominator)
15924 # .setBlue(blue / denominator);
15925 # int alpha = color.getAlpha();
15926 # if (alpha != 255) {
15927 # result.setAlpha(
15928 # FloatValue
15929 # .newBuilder()
15930 # .setValue(((float) alpha) / denominator)
15931 # .build());
15932 # }
15933 # return resultBuilder.build();
15934 # }
15935 # // ...
15936 #
15937 # Example (iOS / Obj-C):
15938 #
15939 # // ...
15940 # static UIColor* fromProto(Color* protocolor) {
15941 # float red = [protocolor red];
15942 # float green = [protocolor green];
15943 # float blue = [protocolor blue];
15944 # FloatValue* alpha_wrapper = [protocolor alpha];
15945 # float alpha = 1.0;
15946 # if (alpha_wrapper != nil) {
15947 # alpha = [alpha_wrapper value];
15948 # }
15949 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
15950 # }
15951 #
15952 # static Color* toProto(UIColor* color) {
15953 # CGFloat red, green, blue, alpha;
15954 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
15955 # return nil;
15956 # }
15957 # Color* result = [Color alloc] init];
15958 # [result setRed:red];
15959 # [result setGreen:green];
15960 # [result setBlue:blue];
15961 # if (alpha <= 0.9999) {
15962 # [result setAlpha:floatWrapperWithValue(alpha)];
15963 # }
15964 # [result autorelease];
15965 # return result;
15966 # }
15967 # // ...
15968 #
15969 # Example (JavaScript):
15970 #
15971 # // ...
15972 #
15973 # var protoToCssColor = function(rgb_color) {
15974 # var redFrac = rgb_color.red || 0.0;
15975 # var greenFrac = rgb_color.green || 0.0;
15976 # var blueFrac = rgb_color.blue || 0.0;
15977 # var red = Math.floor(redFrac * 255);
15978 # var green = Math.floor(greenFrac * 255);
15979 # var blue = Math.floor(blueFrac * 255);
15980 #
15981 # if (!('alpha' in rgb_color)) {
15982 # return rgbToCssColor_(red, green, blue);
15983 # }
15984 #
15985 # var alphaFrac = rgb_color.alpha.value || 0.0;
15986 # var rgbParams = [red, green, blue].join(',');
15987 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
15988 # };
15989 #
15990 # var rgbToCssColor_ = function(red, green, blue) {
15991 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
15992 # var hexString = rgbNumber.toString(16);
15993 # var missingZeros = 6 - hexString.length;
15994 # var resultBuilder = ['#'];
15995 # for (var i = 0; i < missingZeros; i++) {
15996 # resultBuilder.push('0');
15997 # }
15998 # resultBuilder.push(hexString);
15999 # return resultBuilder.join('');
16000 # };
16001 #
16002 # // ...
16003 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
16004 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
16005 # the final pixel color is defined by the equation:
16006 #
16007 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
16008 #
16009 # This means that a value of 1.0 corresponds to a solid color, whereas
16010 # a value of 0.0 corresponds to a completely transparent color. This
16011 # uses a wrapper message rather than a simple float scalar so that it is
16012 # possible to distinguish between a default value and the value being unset.
16013 # If omitted, this color object is to be rendered as a solid color
16014 # (as if the alpha value had been explicitly given with a value of 1.0).
16015 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
16016 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
16017 },
16018 "width": 42, # The width of the border, in pixels.
16019 # Border widths must be between 0 and 3 pixels.
16020 "style": "A String", # The style of the border.
16021 },
16022 "bottom": { # A border along a cell. # The bottom border of the cell.
16023 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
16024 # for simplicity of conversion to/from color representations in various
16025 # languages over compactness; for example, the fields of this representation
16026 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
16027 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
16028 # method in iOS; and, with just a little work, it can be easily formatted into
16029 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
16030 #
16031 # Example (Java):
16032 #
16033 # import com.google.type.Color;
16034 #
16035 # // ...
16036 # public static java.awt.Color fromProto(Color protocolor) {
16037 # float alpha = protocolor.hasAlpha()
16038 # ? protocolor.getAlpha().getValue()
16039 # : 1.0;
16040 #
16041 # return new java.awt.Color(
16042 # protocolor.getRed(),
16043 # protocolor.getGreen(),
16044 # protocolor.getBlue(),
16045 # alpha);
16046 # }
16047 #
16048 # public static Color toProto(java.awt.Color color) {
16049 # float red = (float) color.getRed();
16050 # float green = (float) color.getGreen();
16051 # float blue = (float) color.getBlue();
16052 # float denominator = 255.0;
16053 # Color.Builder resultBuilder =
16054 # Color
16055 # .newBuilder()
16056 # .setRed(red / denominator)
16057 # .setGreen(green / denominator)
16058 # .setBlue(blue / denominator);
16059 # int alpha = color.getAlpha();
16060 # if (alpha != 255) {
16061 # result.setAlpha(
16062 # FloatValue
16063 # .newBuilder()
16064 # .setValue(((float) alpha) / denominator)
16065 # .build());
16066 # }
16067 # return resultBuilder.build();
16068 # }
16069 # // ...
16070 #
16071 # Example (iOS / Obj-C):
16072 #
16073 # // ...
16074 # static UIColor* fromProto(Color* protocolor) {
16075 # float red = [protocolor red];
16076 # float green = [protocolor green];
16077 # float blue = [protocolor blue];
16078 # FloatValue* alpha_wrapper = [protocolor alpha];
16079 # float alpha = 1.0;
16080 # if (alpha_wrapper != nil) {
16081 # alpha = [alpha_wrapper value];
16082 # }
16083 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
16084 # }
16085 #
16086 # static Color* toProto(UIColor* color) {
16087 # CGFloat red, green, blue, alpha;
16088 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
16089 # return nil;
16090 # }
16091 # Color* result = [Color alloc] init];
16092 # [result setRed:red];
16093 # [result setGreen:green];
16094 # [result setBlue:blue];
16095 # if (alpha <= 0.9999) {
16096 # [result setAlpha:floatWrapperWithValue(alpha)];
16097 # }
16098 # [result autorelease];
16099 # return result;
16100 # }
16101 # // ...
16102 #
16103 # Example (JavaScript):
16104 #
16105 # // ...
16106 #
16107 # var protoToCssColor = function(rgb_color) {
16108 # var redFrac = rgb_color.red || 0.0;
16109 # var greenFrac = rgb_color.green || 0.0;
16110 # var blueFrac = rgb_color.blue || 0.0;
16111 # var red = Math.floor(redFrac * 255);
16112 # var green = Math.floor(greenFrac * 255);
16113 # var blue = Math.floor(blueFrac * 255);
16114 #
16115 # if (!('alpha' in rgb_color)) {
16116 # return rgbToCssColor_(red, green, blue);
16117 # }
16118 #
16119 # var alphaFrac = rgb_color.alpha.value || 0.0;
16120 # var rgbParams = [red, green, blue].join(',');
16121 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
16122 # };
16123 #
16124 # var rgbToCssColor_ = function(red, green, blue) {
16125 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
16126 # var hexString = rgbNumber.toString(16);
16127 # var missingZeros = 6 - hexString.length;
16128 # var resultBuilder = ['#'];
16129 # for (var i = 0; i < missingZeros; i++) {
16130 # resultBuilder.push('0');
16131 # }
16132 # resultBuilder.push(hexString);
16133 # return resultBuilder.join('');
16134 # };
16135 #
16136 # // ...
16137 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
16138 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
16139 # the final pixel color is defined by the equation:
16140 #
16141 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
16142 #
16143 # This means that a value of 1.0 corresponds to a solid color, whereas
16144 # a value of 0.0 corresponds to a completely transparent color. This
16145 # uses a wrapper message rather than a simple float scalar so that it is
16146 # possible to distinguish between a default value and the value being unset.
16147 # If omitted, this color object is to be rendered as a solid color
16148 # (as if the alpha value had been explicitly given with a value of 1.0).
16149 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
16150 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
16151 },
16152 "width": 42, # The width of the border, in pixels.
16153 # Border widths must be between 0 and 3 pixels.
16154 "style": "A String", # The style of the border.
16155 },
16156 "left": { # A border along a cell. # The left border of the cell.
16157 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
16158 # for simplicity of conversion to/from color representations in various
16159 # languages over compactness; for example, the fields of this representation
16160 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
16161 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
16162 # method in iOS; and, with just a little work, it can be easily formatted into
16163 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
16164 #
16165 # Example (Java):
16166 #
16167 # import com.google.type.Color;
16168 #
16169 # // ...
16170 # public static java.awt.Color fromProto(Color protocolor) {
16171 # float alpha = protocolor.hasAlpha()
16172 # ? protocolor.getAlpha().getValue()
16173 # : 1.0;
16174 #
16175 # return new java.awt.Color(
16176 # protocolor.getRed(),
16177 # protocolor.getGreen(),
16178 # protocolor.getBlue(),
16179 # alpha);
16180 # }
16181 #
16182 # public static Color toProto(java.awt.Color color) {
16183 # float red = (float) color.getRed();
16184 # float green = (float) color.getGreen();
16185 # float blue = (float) color.getBlue();
16186 # float denominator = 255.0;
16187 # Color.Builder resultBuilder =
16188 # Color
16189 # .newBuilder()
16190 # .setRed(red / denominator)
16191 # .setGreen(green / denominator)
16192 # .setBlue(blue / denominator);
16193 # int alpha = color.getAlpha();
16194 # if (alpha != 255) {
16195 # result.setAlpha(
16196 # FloatValue
16197 # .newBuilder()
16198 # .setValue(((float) alpha) / denominator)
16199 # .build());
16200 # }
16201 # return resultBuilder.build();
16202 # }
16203 # // ...
16204 #
16205 # Example (iOS / Obj-C):
16206 #
16207 # // ...
16208 # static UIColor* fromProto(Color* protocolor) {
16209 # float red = [protocolor red];
16210 # float green = [protocolor green];
16211 # float blue = [protocolor blue];
16212 # FloatValue* alpha_wrapper = [protocolor alpha];
16213 # float alpha = 1.0;
16214 # if (alpha_wrapper != nil) {
16215 # alpha = [alpha_wrapper value];
16216 # }
16217 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
16218 # }
16219 #
16220 # static Color* toProto(UIColor* color) {
16221 # CGFloat red, green, blue, alpha;
16222 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
16223 # return nil;
16224 # }
16225 # Color* result = [Color alloc] init];
16226 # [result setRed:red];
16227 # [result setGreen:green];
16228 # [result setBlue:blue];
16229 # if (alpha <= 0.9999) {
16230 # [result setAlpha:floatWrapperWithValue(alpha)];
16231 # }
16232 # [result autorelease];
16233 # return result;
16234 # }
16235 # // ...
16236 #
16237 # Example (JavaScript):
16238 #
16239 # // ...
16240 #
16241 # var protoToCssColor = function(rgb_color) {
16242 # var redFrac = rgb_color.red || 0.0;
16243 # var greenFrac = rgb_color.green || 0.0;
16244 # var blueFrac = rgb_color.blue || 0.0;
16245 # var red = Math.floor(redFrac * 255);
16246 # var green = Math.floor(greenFrac * 255);
16247 # var blue = Math.floor(blueFrac * 255);
16248 #
16249 # if (!('alpha' in rgb_color)) {
16250 # return rgbToCssColor_(red, green, blue);
16251 # }
16252 #
16253 # var alphaFrac = rgb_color.alpha.value || 0.0;
16254 # var rgbParams = [red, green, blue].join(',');
16255 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
16256 # };
16257 #
16258 # var rgbToCssColor_ = function(red, green, blue) {
16259 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
16260 # var hexString = rgbNumber.toString(16);
16261 # var missingZeros = 6 - hexString.length;
16262 # var resultBuilder = ['#'];
16263 # for (var i = 0; i < missingZeros; i++) {
16264 # resultBuilder.push('0');
16265 # }
16266 # resultBuilder.push(hexString);
16267 # return resultBuilder.join('');
16268 # };
16269 #
16270 # // ...
16271 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
16272 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
16273 # the final pixel color is defined by the equation:
16274 #
16275 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
16276 #
16277 # This means that a value of 1.0 corresponds to a solid color, whereas
16278 # a value of 0.0 corresponds to a completely transparent color. This
16279 # uses a wrapper message rather than a simple float scalar so that it is
16280 # possible to distinguish between a default value and the value being unset.
16281 # If omitted, this color object is to be rendered as a solid color
16282 # (as if the alpha value had been explicitly given with a value of 1.0).
16283 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
16284 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
16285 },
16286 "width": 42, # The width of the border, in pixels.
16287 # Border widths must be between 0 and 3 pixels.
16288 "style": "A String", # The style of the border.
16289 },
16290 },
16291 "wrapStrategy": "A String", # The wrap strategy for the value in the cell.
16292 },
16293 },
16294 "gradientRule": { # A rule that applies a gradient color scale format, based on # The formatting will vary based on the gradients in the rule.
16295 # the interpolation points listed. The format of a cell will vary
16296 # based on its contents as compared to the values of the interpolation
16297 # points.
16298 "maxpoint": { # A single interpolation point a gradient conditional format. # The final interpolation point.
16299 # These pin the gradient color scale according to the color,
16300 # type and value chosen.
16301 "color": { # Represents a color in the RGBA color space. This representation is designed # The color this interpolation point should use.
16302 # for simplicity of conversion to/from color representations in various
16303 # languages over compactness; for example, the fields of this representation
16304 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
16305 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
16306 # method in iOS; and, with just a little work, it can be easily formatted into
16307 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
16308 #
16309 # Example (Java):
16310 #
16311 # import com.google.type.Color;
16312 #
16313 # // ...
16314 # public static java.awt.Color fromProto(Color protocolor) {
16315 # float alpha = protocolor.hasAlpha()
16316 # ? protocolor.getAlpha().getValue()
16317 # : 1.0;
16318 #
16319 # return new java.awt.Color(
16320 # protocolor.getRed(),
16321 # protocolor.getGreen(),
16322 # protocolor.getBlue(),
16323 # alpha);
16324 # }
16325 #
16326 # public static Color toProto(java.awt.Color color) {
16327 # float red = (float) color.getRed();
16328 # float green = (float) color.getGreen();
16329 # float blue = (float) color.getBlue();
16330 # float denominator = 255.0;
16331 # Color.Builder resultBuilder =
16332 # Color
16333 # .newBuilder()
16334 # .setRed(red / denominator)
16335 # .setGreen(green / denominator)
16336 # .setBlue(blue / denominator);
16337 # int alpha = color.getAlpha();
16338 # if (alpha != 255) {
16339 # result.setAlpha(
16340 # FloatValue
16341 # .newBuilder()
16342 # .setValue(((float) alpha) / denominator)
16343 # .build());
16344 # }
16345 # return resultBuilder.build();
16346 # }
16347 # // ...
16348 #
16349 # Example (iOS / Obj-C):
16350 #
16351 # // ...
16352 # static UIColor* fromProto(Color* protocolor) {
16353 # float red = [protocolor red];
16354 # float green = [protocolor green];
16355 # float blue = [protocolor blue];
16356 # FloatValue* alpha_wrapper = [protocolor alpha];
16357 # float alpha = 1.0;
16358 # if (alpha_wrapper != nil) {
16359 # alpha = [alpha_wrapper value];
16360 # }
16361 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
16362 # }
16363 #
16364 # static Color* toProto(UIColor* color) {
16365 # CGFloat red, green, blue, alpha;
16366 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
16367 # return nil;
16368 # }
16369 # Color* result = [Color alloc] init];
16370 # [result setRed:red];
16371 # [result setGreen:green];
16372 # [result setBlue:blue];
16373 # if (alpha <= 0.9999) {
16374 # [result setAlpha:floatWrapperWithValue(alpha)];
16375 # }
16376 # [result autorelease];
16377 # return result;
16378 # }
16379 # // ...
16380 #
16381 # Example (JavaScript):
16382 #
16383 # // ...
16384 #
16385 # var protoToCssColor = function(rgb_color) {
16386 # var redFrac = rgb_color.red || 0.0;
16387 # var greenFrac = rgb_color.green || 0.0;
16388 # var blueFrac = rgb_color.blue || 0.0;
16389 # var red = Math.floor(redFrac * 255);
16390 # var green = Math.floor(greenFrac * 255);
16391 # var blue = Math.floor(blueFrac * 255);
16392 #
16393 # if (!('alpha' in rgb_color)) {
16394 # return rgbToCssColor_(red, green, blue);
16395 # }
16396 #
16397 # var alphaFrac = rgb_color.alpha.value || 0.0;
16398 # var rgbParams = [red, green, blue].join(',');
16399 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
16400 # };
16401 #
16402 # var rgbToCssColor_ = function(red, green, blue) {
16403 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
16404 # var hexString = rgbNumber.toString(16);
16405 # var missingZeros = 6 - hexString.length;
16406 # var resultBuilder = ['#'];
16407 # for (var i = 0; i < missingZeros; i++) {
16408 # resultBuilder.push('0');
16409 # }
16410 # resultBuilder.push(hexString);
16411 # return resultBuilder.join('');
16412 # };
16413 #
16414 # // ...
16415 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
16416 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
16417 # the final pixel color is defined by the equation:
16418 #
16419 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
16420 #
16421 # This means that a value of 1.0 corresponds to a solid color, whereas
16422 # a value of 0.0 corresponds to a completely transparent color. This
16423 # uses a wrapper message rather than a simple float scalar so that it is
16424 # possible to distinguish between a default value and the value being unset.
16425 # If omitted, this color object is to be rendered as a solid color
16426 # (as if the alpha value had been explicitly given with a value of 1.0).
16427 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
16428 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
16429 },
16430 "type": "A String", # How the value should be interpreted.
16431 "value": "A String", # The value this interpolation point uses. May be a formula.
16432 # Unused if type is MIN or
16433 # MAX.
16434 },
16435 "midpoint": { # A single interpolation point a gradient conditional format. # An optional midway interpolation point.
16436 # These pin the gradient color scale according to the color,
16437 # type and value chosen.
16438 "color": { # Represents a color in the RGBA color space. This representation is designed # The color this interpolation point should use.
16439 # for simplicity of conversion to/from color representations in various
16440 # languages over compactness; for example, the fields of this representation
16441 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
16442 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
16443 # method in iOS; and, with just a little work, it can be easily formatted into
16444 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
16445 #
16446 # Example (Java):
16447 #
16448 # import com.google.type.Color;
16449 #
16450 # // ...
16451 # public static java.awt.Color fromProto(Color protocolor) {
16452 # float alpha = protocolor.hasAlpha()
16453 # ? protocolor.getAlpha().getValue()
16454 # : 1.0;
16455 #
16456 # return new java.awt.Color(
16457 # protocolor.getRed(),
16458 # protocolor.getGreen(),
16459 # protocolor.getBlue(),
16460 # alpha);
16461 # }
16462 #
16463 # public static Color toProto(java.awt.Color color) {
16464 # float red = (float) color.getRed();
16465 # float green = (float) color.getGreen();
16466 # float blue = (float) color.getBlue();
16467 # float denominator = 255.0;
16468 # Color.Builder resultBuilder =
16469 # Color
16470 # .newBuilder()
16471 # .setRed(red / denominator)
16472 # .setGreen(green / denominator)
16473 # .setBlue(blue / denominator);
16474 # int alpha = color.getAlpha();
16475 # if (alpha != 255) {
16476 # result.setAlpha(
16477 # FloatValue
16478 # .newBuilder()
16479 # .setValue(((float) alpha) / denominator)
16480 # .build());
16481 # }
16482 # return resultBuilder.build();
16483 # }
16484 # // ...
16485 #
16486 # Example (iOS / Obj-C):
16487 #
16488 # // ...
16489 # static UIColor* fromProto(Color* protocolor) {
16490 # float red = [protocolor red];
16491 # float green = [protocolor green];
16492 # float blue = [protocolor blue];
16493 # FloatValue* alpha_wrapper = [protocolor alpha];
16494 # float alpha = 1.0;
16495 # if (alpha_wrapper != nil) {
16496 # alpha = [alpha_wrapper value];
16497 # }
16498 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
16499 # }
16500 #
16501 # static Color* toProto(UIColor* color) {
16502 # CGFloat red, green, blue, alpha;
16503 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
16504 # return nil;
16505 # }
16506 # Color* result = [Color alloc] init];
16507 # [result setRed:red];
16508 # [result setGreen:green];
16509 # [result setBlue:blue];
16510 # if (alpha <= 0.9999) {
16511 # [result setAlpha:floatWrapperWithValue(alpha)];
16512 # }
16513 # [result autorelease];
16514 # return result;
16515 # }
16516 # // ...
16517 #
16518 # Example (JavaScript):
16519 #
16520 # // ...
16521 #
16522 # var protoToCssColor = function(rgb_color) {
16523 # var redFrac = rgb_color.red || 0.0;
16524 # var greenFrac = rgb_color.green || 0.0;
16525 # var blueFrac = rgb_color.blue || 0.0;
16526 # var red = Math.floor(redFrac * 255);
16527 # var green = Math.floor(greenFrac * 255);
16528 # var blue = Math.floor(blueFrac * 255);
16529 #
16530 # if (!('alpha' in rgb_color)) {
16531 # return rgbToCssColor_(red, green, blue);
16532 # }
16533 #
16534 # var alphaFrac = rgb_color.alpha.value || 0.0;
16535 # var rgbParams = [red, green, blue].join(',');
16536 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
16537 # };
16538 #
16539 # var rgbToCssColor_ = function(red, green, blue) {
16540 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
16541 # var hexString = rgbNumber.toString(16);
16542 # var missingZeros = 6 - hexString.length;
16543 # var resultBuilder = ['#'];
16544 # for (var i = 0; i < missingZeros; i++) {
16545 # resultBuilder.push('0');
16546 # }
16547 # resultBuilder.push(hexString);
16548 # return resultBuilder.join('');
16549 # };
16550 #
16551 # // ...
16552 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
16553 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
16554 # the final pixel color is defined by the equation:
16555 #
16556 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
16557 #
16558 # This means that a value of 1.0 corresponds to a solid color, whereas
16559 # a value of 0.0 corresponds to a completely transparent color. This
16560 # uses a wrapper message rather than a simple float scalar so that it is
16561 # possible to distinguish between a default value and the value being unset.
16562 # If omitted, this color object is to be rendered as a solid color
16563 # (as if the alpha value had been explicitly given with a value of 1.0).
16564 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
16565 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
16566 },
16567 "type": "A String", # How the value should be interpreted.
16568 "value": "A String", # The value this interpolation point uses. May be a formula.
16569 # Unused if type is MIN or
16570 # MAX.
16571 },
16572 "minpoint": { # A single interpolation point a gradient conditional format. # The starting interpolation point.
16573 # These pin the gradient color scale according to the color,
16574 # type and value chosen.
16575 "color": { # Represents a color in the RGBA color space. This representation is designed # The color this interpolation point should use.
16576 # for simplicity of conversion to/from color representations in various
16577 # languages over compactness; for example, the fields of this representation
16578 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
16579 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
16580 # method in iOS; and, with just a little work, it can be easily formatted into
16581 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
16582 #
16583 # Example (Java):
16584 #
16585 # import com.google.type.Color;
16586 #
16587 # // ...
16588 # public static java.awt.Color fromProto(Color protocolor) {
16589 # float alpha = protocolor.hasAlpha()
16590 # ? protocolor.getAlpha().getValue()
16591 # : 1.0;
16592 #
16593 # return new java.awt.Color(
16594 # protocolor.getRed(),
16595 # protocolor.getGreen(),
16596 # protocolor.getBlue(),
16597 # alpha);
16598 # }
16599 #
16600 # public static Color toProto(java.awt.Color color) {
16601 # float red = (float) color.getRed();
16602 # float green = (float) color.getGreen();
16603 # float blue = (float) color.getBlue();
16604 # float denominator = 255.0;
16605 # Color.Builder resultBuilder =
16606 # Color
16607 # .newBuilder()
16608 # .setRed(red / denominator)
16609 # .setGreen(green / denominator)
16610 # .setBlue(blue / denominator);
16611 # int alpha = color.getAlpha();
16612 # if (alpha != 255) {
16613 # result.setAlpha(
16614 # FloatValue
16615 # .newBuilder()
16616 # .setValue(((float) alpha) / denominator)
16617 # .build());
16618 # }
16619 # return resultBuilder.build();
16620 # }
16621 # // ...
16622 #
16623 # Example (iOS / Obj-C):
16624 #
16625 # // ...
16626 # static UIColor* fromProto(Color* protocolor) {
16627 # float red = [protocolor red];
16628 # float green = [protocolor green];
16629 # float blue = [protocolor blue];
16630 # FloatValue* alpha_wrapper = [protocolor alpha];
16631 # float alpha = 1.0;
16632 # if (alpha_wrapper != nil) {
16633 # alpha = [alpha_wrapper value];
16634 # }
16635 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
16636 # }
16637 #
16638 # static Color* toProto(UIColor* color) {
16639 # CGFloat red, green, blue, alpha;
16640 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
16641 # return nil;
16642 # }
16643 # Color* result = [Color alloc] init];
16644 # [result setRed:red];
16645 # [result setGreen:green];
16646 # [result setBlue:blue];
16647 # if (alpha <= 0.9999) {
16648 # [result setAlpha:floatWrapperWithValue(alpha)];
16649 # }
16650 # [result autorelease];
16651 # return result;
16652 # }
16653 # // ...
16654 #
16655 # Example (JavaScript):
16656 #
16657 # // ...
16658 #
16659 # var protoToCssColor = function(rgb_color) {
16660 # var redFrac = rgb_color.red || 0.0;
16661 # var greenFrac = rgb_color.green || 0.0;
16662 # var blueFrac = rgb_color.blue || 0.0;
16663 # var red = Math.floor(redFrac * 255);
16664 # var green = Math.floor(greenFrac * 255);
16665 # var blue = Math.floor(blueFrac * 255);
16666 #
16667 # if (!('alpha' in rgb_color)) {
16668 # return rgbToCssColor_(red, green, blue);
16669 # }
16670 #
16671 # var alphaFrac = rgb_color.alpha.value || 0.0;
16672 # var rgbParams = [red, green, blue].join(',');
16673 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
16674 # };
16675 #
16676 # var rgbToCssColor_ = function(red, green, blue) {
16677 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
16678 # var hexString = rgbNumber.toString(16);
16679 # var missingZeros = 6 - hexString.length;
16680 # var resultBuilder = ['#'];
16681 # for (var i = 0; i < missingZeros; i++) {
16682 # resultBuilder.push('0');
16683 # }
16684 # resultBuilder.push(hexString);
16685 # return resultBuilder.join('');
16686 # };
16687 #
16688 # // ...
16689 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
16690 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
16691 # the final pixel color is defined by the equation:
16692 #
16693 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
16694 #
16695 # This means that a value of 1.0 corresponds to a solid color, whereas
16696 # a value of 0.0 corresponds to a completely transparent color. This
16697 # uses a wrapper message rather than a simple float scalar so that it is
16698 # possible to distinguish between a default value and the value being unset.
16699 # If omitted, this color object is to be rendered as a solid color
16700 # (as if the alpha value had been explicitly given with a value of 1.0).
16701 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
16702 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
16703 },
16704 "type": "A String", # How the value should be interpreted.
16705 "value": "A String", # The value this interpolation point uses. May be a formula.
16706 # Unused if type is MIN or
16707 # MAX.
16708 },
16709 },
16710 },
16711 },
16712 "addSheet": { # The result of adding a sheet. # A reply from adding a sheet.
16713 "properties": { # Properties of a sheet. # The properties of the newly added sheet.
16714 "sheetType": "A String", # The type of sheet. Defaults to GRID.
16715 # This field cannot be changed once set.
16716 "index": 42, # The index of the sheet within the spreadsheet.
16717 # When adding or updating sheet properties, if this field
16718 # is excluded then the sheet will be added or moved to the end
16719 # of the sheet list.
16720 "title": "A String", # The name of the sheet.
16721 "gridProperties": { # Properties of a grid. # Additional properties of the sheet if this sheet is a grid.
16722 # (If the sheet is an object sheet, containing a chart or image, then
16723 # this field will be absent.)
16724 # When writing it is an error to set any grid properties on non-grid sheets.
16725 "columnCount": 42, # The number of columns in the grid.
16726 "rowCount": 42, # The number of rows in the grid.
16727 "frozenColumnCount": 42, # The number of columns that are frozen in the grid.
16728 "hideGridlines": True or False, # True if the grid isn't showing gridlines in the UI.
16729 "frozenRowCount": 42, # The number of rows that are frozen in the grid.
16730 },
16731 "rightToLeft": True or False, # True if the sheet is an RTL sheet instead of an LTR sheet.
16732 "tabColor": { # Represents a color in the RGBA color space. This representation is designed # The color of the tab in the UI.
16733 # for simplicity of conversion to/from color representations in various
16734 # languages over compactness; for example, the fields of this representation
16735 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
16736 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
16737 # method in iOS; and, with just a little work, it can be easily formatted into
16738 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
16739 #
16740 # Example (Java):
16741 #
16742 # import com.google.type.Color;
16743 #
16744 # // ...
16745 # public static java.awt.Color fromProto(Color protocolor) {
16746 # float alpha = protocolor.hasAlpha()
16747 # ? protocolor.getAlpha().getValue()
16748 # : 1.0;
16749 #
16750 # return new java.awt.Color(
16751 # protocolor.getRed(),
16752 # protocolor.getGreen(),
16753 # protocolor.getBlue(),
16754 # alpha);
16755 # }
16756 #
16757 # public static Color toProto(java.awt.Color color) {
16758 # float red = (float) color.getRed();
16759 # float green = (float) color.getGreen();
16760 # float blue = (float) color.getBlue();
16761 # float denominator = 255.0;
16762 # Color.Builder resultBuilder =
16763 # Color
16764 # .newBuilder()
16765 # .setRed(red / denominator)
16766 # .setGreen(green / denominator)
16767 # .setBlue(blue / denominator);
16768 # int alpha = color.getAlpha();
16769 # if (alpha != 255) {
16770 # result.setAlpha(
16771 # FloatValue
16772 # .newBuilder()
16773 # .setValue(((float) alpha) / denominator)
16774 # .build());
16775 # }
16776 # return resultBuilder.build();
16777 # }
16778 # // ...
16779 #
16780 # Example (iOS / Obj-C):
16781 #
16782 # // ...
16783 # static UIColor* fromProto(Color* protocolor) {
16784 # float red = [protocolor red];
16785 # float green = [protocolor green];
16786 # float blue = [protocolor blue];
16787 # FloatValue* alpha_wrapper = [protocolor alpha];
16788 # float alpha = 1.0;
16789 # if (alpha_wrapper != nil) {
16790 # alpha = [alpha_wrapper value];
16791 # }
16792 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
16793 # }
16794 #
16795 # static Color* toProto(UIColor* color) {
16796 # CGFloat red, green, blue, alpha;
16797 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
16798 # return nil;
16799 # }
16800 # Color* result = [Color alloc] init];
16801 # [result setRed:red];
16802 # [result setGreen:green];
16803 # [result setBlue:blue];
16804 # if (alpha <= 0.9999) {
16805 # [result setAlpha:floatWrapperWithValue(alpha)];
16806 # }
16807 # [result autorelease];
16808 # return result;
16809 # }
16810 # // ...
16811 #
16812 # Example (JavaScript):
16813 #
16814 # // ...
16815 #
16816 # var protoToCssColor = function(rgb_color) {
16817 # var redFrac = rgb_color.red || 0.0;
16818 # var greenFrac = rgb_color.green || 0.0;
16819 # var blueFrac = rgb_color.blue || 0.0;
16820 # var red = Math.floor(redFrac * 255);
16821 # var green = Math.floor(greenFrac * 255);
16822 # var blue = Math.floor(blueFrac * 255);
16823 #
16824 # if (!('alpha' in rgb_color)) {
16825 # return rgbToCssColor_(red, green, blue);
16826 # }
16827 #
16828 # var alphaFrac = rgb_color.alpha.value || 0.0;
16829 # var rgbParams = [red, green, blue].join(',');
16830 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
16831 # };
16832 #
16833 # var rgbToCssColor_ = function(red, green, blue) {
16834 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
16835 # var hexString = rgbNumber.toString(16);
16836 # var missingZeros = 6 - hexString.length;
16837 # var resultBuilder = ['#'];
16838 # for (var i = 0; i < missingZeros; i++) {
16839 # resultBuilder.push('0');
16840 # }
16841 # resultBuilder.push(hexString);
16842 # return resultBuilder.join('');
16843 # };
16844 #
16845 # // ...
16846 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
16847 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
16848 # the final pixel color is defined by the equation:
16849 #
16850 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
16851 #
16852 # This means that a value of 1.0 corresponds to a solid color, whereas
16853 # a value of 0.0 corresponds to a completely transparent color. This
16854 # uses a wrapper message rather than a simple float scalar so that it is
16855 # possible to distinguish between a default value and the value being unset.
16856 # If omitted, this color object is to be rendered as a solid color
16857 # (as if the alpha value had been explicitly given with a value of 1.0).
16858 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
16859 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
16860 },
16861 "hidden": True or False, # True if the sheet is hidden in the UI, false if it's visible.
16862 "sheetId": 42, # The ID of the sheet. Must be non-negative.
16863 # This field cannot be changed once set.
16864 },
16865 },
16866 "findReplace": { # The result of the find/replace. # A reply from doing a find/replace.
16867 "occurrencesChanged": 42, # The number of occurrences (possibly multiple within a cell) changed.
16868 # For example, if replacing "`e`" with "`o`" in "`Google Sheets`", this would
16869 # be "`3`" because "`Google Sheets`" -> "`Googlo Shoots`".
16870 "sheetsChanged": 42, # The number of sheets changed.
16871 "rowsChanged": 42, # The number of rows changed.
16872 "valuesChanged": 42, # The number of non-formula cells changed.
16873 "formulasChanged": 42, # The number of formula cells changed.
16874 },
16875 "addNamedRange": { # The result of adding a named range. # A reply from adding a named range.
16876 "namedRange": { # A named range. # The named range to add.
16877 "namedRangeId": "A String", # The ID of the named range.
16878 "range": { # A range on a sheet. # The range this represents.
16879 # All indexes are zero-based.
16880 # Indexes are half open, e.g the start index is inclusive
16881 # and the end index is exclusive -- [start_index, end_index).
16882 # Missing indexes indicate the range is unbounded on that side.
16883 #
16884 # For example, if "Sheet1" is grid ID 0, then:
16885 #
16886 # Sheet1!A1:A1 == sheet_id: 0,
16887 # start_row_index: 0, end_row_index: 1,
16888 # start_column_index: 0, end_column_index: 1
16889 #
16890 # Sheet1!A3:B4 == sheet_id: 0,
16891 # start_row_index: 2, end_row_index: 4,
16892 # start_column_index: 0, end_column_index: 2
16893 #
16894 # Sheet1!A:B == sheet_id: 0,
16895 # start_column_index: 0, end_column_index: 2
16896 #
16897 # Sheet1!A5:B == sheet_id: 0,
16898 # start_row_index: 4,
16899 # start_column_index: 0, end_column_index: 2
16900 #
16901 # Sheet1 == sheet_id:0
16902 #
16903 # The start index must always be less than or equal to the end index.
16904 # If the start index equals the end index, then the range is empty.
16905 # Empty ranges are typically not meaningful and are usually rendered in the
16906 # UI as `#REF!`.
16907 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
16908 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
16909 "sheetId": 42, # The sheet this range is on.
16910 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
16911 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
16912 },
16913 "name": "A String", # The name of the named range.
16914 },
16915 },
16916 "addProtectedRange": { # The result of adding a new protected range. # A reply from adding a protected range.
16917 "protectedRange": { # A protected range. # The newly added protected range.
16918 "unprotectedRanges": [ # The list of unprotected ranges within a protected sheet.
16919 # Unprotected ranges are only supported on protected sheets.
16920 { # A range on a sheet.
16921 # All indexes are zero-based.
16922 # Indexes are half open, e.g the start index is inclusive
16923 # and the end index is exclusive -- [start_index, end_index).
16924 # Missing indexes indicate the range is unbounded on that side.
16925 #
16926 # For example, if "Sheet1" is grid ID 0, then:
16927 #
16928 # Sheet1!A1:A1 == sheet_id: 0,
16929 # start_row_index: 0, end_row_index: 1,
16930 # start_column_index: 0, end_column_index: 1
16931 #
16932 # Sheet1!A3:B4 == sheet_id: 0,
16933 # start_row_index: 2, end_row_index: 4,
16934 # start_column_index: 0, end_column_index: 2
16935 #
16936 # Sheet1!A:B == sheet_id: 0,
16937 # start_column_index: 0, end_column_index: 2
16938 #
16939 # Sheet1!A5:B == sheet_id: 0,
16940 # start_row_index: 4,
16941 # start_column_index: 0, end_column_index: 2
16942 #
16943 # Sheet1 == sheet_id:0
16944 #
16945 # The start index must always be less than or equal to the end index.
16946 # If the start index equals the end index, then the range is empty.
16947 # Empty ranges are typically not meaningful and are usually rendered in the
16948 # UI as `#REF!`.
16949 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
16950 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
16951 "sheetId": 42, # The sheet this range is on.
16952 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
16953 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
16954 },
16955 ],
16956 "requestingUserCanEdit": True or False, # True if the user who requested this protected range can edit the
16957 # protected area.
16958 # This field is read-only.
16959 "description": "A String", # The description of this protected range.
16960 "namedRangeId": "A String", # The named range this protected range is backed by, if any.
16961 #
16962 # When writing, only one of range or namedRangeId
16963 # may be set.
16964 "editors": { # The editors of a protected range. # The users and groups with edit access to the protected range.
16965 # This field is only visible to users with edit access to the protected
16966 # range and the document.
16967 # Editors are not supported with warningOnly protection.
16968 "domainUsersCanEdit": True or False, # True if anyone in the document's domain has edit access to the protected
16969 # range. Domain protection is only supported on documents within a domain.
16970 "users": [ # The email addresses of users with edit access to the protected range.
16971 "A String",
16972 ],
16973 "groups": [ # The email addresses of groups with edit access to the protected range.
16974 "A String",
16975 ],
16976 },
16977 "protectedRangeId": 42, # The ID of the protected range.
16978 # This field is read-only.
16979 "warningOnly": True or False, # True if this this protected range will show a warning when editing.
16980 # Warning-based protection means that every user can edit data in the
16981 # protected range, except editing will prompt a warning asking the user
16982 # to confirm the edit.
16983 #
16984 # When warning: if this field is true, then editors is ignored.
16985 # Additionally, if this field is changed from true to false and the
16986 # `editors` field is not set (nor included in the field mask), then
16987 # the editors will be set to all the editors in the document.
16988 "range": { # A range on a sheet. # The range that is being protected.
16989 # The range may be fully unbounded, in which case this is considered
16990 # a protected sheet.
16991 #
16992 # When writing, only one of range or namedRangeId
16993 # may be set.
16994 # All indexes are zero-based.
16995 # Indexes are half open, e.g the start index is inclusive
16996 # and the end index is exclusive -- [start_index, end_index).
16997 # Missing indexes indicate the range is unbounded on that side.
16998 #
16999 # For example, if "Sheet1" is grid ID 0, then:
17000 #
17001 # Sheet1!A1:A1 == sheet_id: 0,
17002 # start_row_index: 0, end_row_index: 1,
17003 # start_column_index: 0, end_column_index: 1
17004 #
17005 # Sheet1!A3:B4 == sheet_id: 0,
17006 # start_row_index: 2, end_row_index: 4,
17007 # start_column_index: 0, end_column_index: 2
17008 #
17009 # Sheet1!A:B == sheet_id: 0,
17010 # start_column_index: 0, end_column_index: 2
17011 #
17012 # Sheet1!A5:B == sheet_id: 0,
17013 # start_row_index: 4,
17014 # start_column_index: 0, end_column_index: 2
17015 #
17016 # Sheet1 == sheet_id:0
17017 #
17018 # The start index must always be less than or equal to the end index.
17019 # If the start index equals the end index, then the range is empty.
17020 # Empty ranges are typically not meaningful and are usually rendered in the
17021 # UI as `#REF!`.
17022 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
17023 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
17024 "sheetId": 42, # The sheet this range is on.
17025 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
17026 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
17027 },
17028 },
17029 },
17030 "deleteConditionalFormatRule": { # The result of deleting a conditional format rule. # A reply from deleting a conditional format rule.
17031 "rule": { # A rule describing a conditional format. # The rule that was deleted.
17032 "ranges": [ # The ranges that will be formatted if the condition is true.
17033 # All the ranges must be on the same grid.
17034 { # A range on a sheet.
17035 # All indexes are zero-based.
17036 # Indexes are half open, e.g the start index is inclusive
17037 # and the end index is exclusive -- [start_index, end_index).
17038 # Missing indexes indicate the range is unbounded on that side.
17039 #
17040 # For example, if "Sheet1" is grid ID 0, then:
17041 #
17042 # Sheet1!A1:A1 == sheet_id: 0,
17043 # start_row_index: 0, end_row_index: 1,
17044 # start_column_index: 0, end_column_index: 1
17045 #
17046 # Sheet1!A3:B4 == sheet_id: 0,
17047 # start_row_index: 2, end_row_index: 4,
17048 # start_column_index: 0, end_column_index: 2
17049 #
17050 # Sheet1!A:B == sheet_id: 0,
17051 # start_column_index: 0, end_column_index: 2
17052 #
17053 # Sheet1!A5:B == sheet_id: 0,
17054 # start_row_index: 4,
17055 # start_column_index: 0, end_column_index: 2
17056 #
17057 # Sheet1 == sheet_id:0
17058 #
17059 # The start index must always be less than or equal to the end index.
17060 # If the start index equals the end index, then the range is empty.
17061 # Empty ranges are typically not meaningful and are usually rendered in the
17062 # UI as `#REF!`.
17063 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
17064 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
17065 "sheetId": 42, # The sheet this range is on.
17066 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
17067 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
17068 },
17069 ],
17070 "booleanRule": { # A rule that may or may not match, depending on the condition. # The formatting is either "on" or "off" according to the rule.
17071 "condition": { # A condition that can evaluate to true or false. # The condition of the rule. If the condition evaluates to true,
17072 # the format will be applied.
17073 # BooleanConditions are used by conditional formatting,
17074 # data validation, and the criteria in filters.
17075 "type": "A String", # The type of condition.
17076 "values": [ # The values of the condition. The number of supported values depends
17077 # on the condition type. Some support zero values,
17078 # others one or two values,
17079 # and ConditionType.ONE_OF_LIST supports an arbitrary number of values.
17080 { # The value of the condition.
17081 "relativeDate": "A String", # A relative date (based on the current date).
17082 # Valid only if the type is
17083 # DATE_BEFORE,
17084 # DATE_AFTER,
17085 # DATE_ON_OR_BEFORE or
17086 # DATE_ON_OR_AFTER.
17087 #
17088 # Relative dates are not supported in data validation.
17089 # They are supported only in conditional formatting and
17090 # conditional filters.
17091 "userEnteredValue": "A String", # A value the condition is based on.
17092 # The value will be parsed as if the user typed into a cell.
17093 # Formulas are supported (and must begin with an `=`).
17094 },
17095 ],
17096 },
17097 "format": { # The format of a cell. # The format to apply.
17098 # Conditional formatting can only apply a subset of formatting:
17099 # bold, italic,
17100 # strikethrough,
17101 # foreground color &
17102 # background color.
17103 "numberFormat": { # The number format of a cell. # A format describing how number values should be represented to the user.
17104 # When updating, all fields must be set.
17105 "pattern": "A String", # Pattern string used for formatting.
17106 "type": "A String", # The type of the number format.
17107 },
17108 "textDirection": "A String", # The direction of the text in the cell.
17109 "padding": { # The amount of padding around the cell, in pixels. # The padding of the cell.
17110 # When updating padding, every field must be specified.
17111 "top": 42, # The top padding of the cell.
17112 "right": 42, # The right padding of the cell.
17113 "bottom": 42, # The bottom padding of the cell.
17114 "left": 42, # The left padding of the cell.
17115 },
17116 "horizontalAlignment": "A String", # The horizontal alignment of the value in cell.
17117 "backgroundColor": { # Represents a color in the RGBA color space. This representation is designed # The background color of the cell.
17118 # for simplicity of conversion to/from color representations in various
17119 # languages over compactness; for example, the fields of this representation
17120 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
17121 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
17122 # method in iOS; and, with just a little work, it can be easily formatted into
17123 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
17124 #
17125 # Example (Java):
17126 #
17127 # import com.google.type.Color;
17128 #
17129 # // ...
17130 # public static java.awt.Color fromProto(Color protocolor) {
17131 # float alpha = protocolor.hasAlpha()
17132 # ? protocolor.getAlpha().getValue()
17133 # : 1.0;
17134 #
17135 # return new java.awt.Color(
17136 # protocolor.getRed(),
17137 # protocolor.getGreen(),
17138 # protocolor.getBlue(),
17139 # alpha);
17140 # }
17141 #
17142 # public static Color toProto(java.awt.Color color) {
17143 # float red = (float) color.getRed();
17144 # float green = (float) color.getGreen();
17145 # float blue = (float) color.getBlue();
17146 # float denominator = 255.0;
17147 # Color.Builder resultBuilder =
17148 # Color
17149 # .newBuilder()
17150 # .setRed(red / denominator)
17151 # .setGreen(green / denominator)
17152 # .setBlue(blue / denominator);
17153 # int alpha = color.getAlpha();
17154 # if (alpha != 255) {
17155 # result.setAlpha(
17156 # FloatValue
17157 # .newBuilder()
17158 # .setValue(((float) alpha) / denominator)
17159 # .build());
17160 # }
17161 # return resultBuilder.build();
17162 # }
17163 # // ...
17164 #
17165 # Example (iOS / Obj-C):
17166 #
17167 # // ...
17168 # static UIColor* fromProto(Color* protocolor) {
17169 # float red = [protocolor red];
17170 # float green = [protocolor green];
17171 # float blue = [protocolor blue];
17172 # FloatValue* alpha_wrapper = [protocolor alpha];
17173 # float alpha = 1.0;
17174 # if (alpha_wrapper != nil) {
17175 # alpha = [alpha_wrapper value];
17176 # }
17177 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
17178 # }
17179 #
17180 # static Color* toProto(UIColor* color) {
17181 # CGFloat red, green, blue, alpha;
17182 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
17183 # return nil;
17184 # }
17185 # Color* result = [Color alloc] init];
17186 # [result setRed:red];
17187 # [result setGreen:green];
17188 # [result setBlue:blue];
17189 # if (alpha <= 0.9999) {
17190 # [result setAlpha:floatWrapperWithValue(alpha)];
17191 # }
17192 # [result autorelease];
17193 # return result;
17194 # }
17195 # // ...
17196 #
17197 # Example (JavaScript):
17198 #
17199 # // ...
17200 #
17201 # var protoToCssColor = function(rgb_color) {
17202 # var redFrac = rgb_color.red || 0.0;
17203 # var greenFrac = rgb_color.green || 0.0;
17204 # var blueFrac = rgb_color.blue || 0.0;
17205 # var red = Math.floor(redFrac * 255);
17206 # var green = Math.floor(greenFrac * 255);
17207 # var blue = Math.floor(blueFrac * 255);
17208 #
17209 # if (!('alpha' in rgb_color)) {
17210 # return rgbToCssColor_(red, green, blue);
17211 # }
17212 #
17213 # var alphaFrac = rgb_color.alpha.value || 0.0;
17214 # var rgbParams = [red, green, blue].join(',');
17215 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
17216 # };
17217 #
17218 # var rgbToCssColor_ = function(red, green, blue) {
17219 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
17220 # var hexString = rgbNumber.toString(16);
17221 # var missingZeros = 6 - hexString.length;
17222 # var resultBuilder = ['#'];
17223 # for (var i = 0; i < missingZeros; i++) {
17224 # resultBuilder.push('0');
17225 # }
17226 # resultBuilder.push(hexString);
17227 # return resultBuilder.join('');
17228 # };
17229 #
17230 # // ...
17231 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
17232 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
17233 # the final pixel color is defined by the equation:
17234 #
17235 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
17236 #
17237 # This means that a value of 1.0 corresponds to a solid color, whereas
17238 # a value of 0.0 corresponds to a completely transparent color. This
17239 # uses a wrapper message rather than a simple float scalar so that it is
17240 # possible to distinguish between a default value and the value being unset.
17241 # If omitted, this color object is to be rendered as a solid color
17242 # (as if the alpha value had been explicitly given with a value of 1.0).
17243 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
17244 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
17245 },
17246 "verticalAlignment": "A String", # The vertical alignment of the value in cell.
17247 "textFormat": { # The format of a run of text in a cell. # The format of the text in the cell (unless overridden by a format run).
17248 # Absent values indicate that the field isn't specified.
17249 "foregroundColor": { # Represents a color in the RGBA color space. This representation is designed # The foreground color of the text.
17250 # for simplicity of conversion to/from color representations in various
17251 # languages over compactness; for example, the fields of this representation
17252 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
17253 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
17254 # method in iOS; and, with just a little work, it can be easily formatted into
17255 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
17256 #
17257 # Example (Java):
17258 #
17259 # import com.google.type.Color;
17260 #
17261 # // ...
17262 # public static java.awt.Color fromProto(Color protocolor) {
17263 # float alpha = protocolor.hasAlpha()
17264 # ? protocolor.getAlpha().getValue()
17265 # : 1.0;
17266 #
17267 # return new java.awt.Color(
17268 # protocolor.getRed(),
17269 # protocolor.getGreen(),
17270 # protocolor.getBlue(),
17271 # alpha);
17272 # }
17273 #
17274 # public static Color toProto(java.awt.Color color) {
17275 # float red = (float) color.getRed();
17276 # float green = (float) color.getGreen();
17277 # float blue = (float) color.getBlue();
17278 # float denominator = 255.0;
17279 # Color.Builder resultBuilder =
17280 # Color
17281 # .newBuilder()
17282 # .setRed(red / denominator)
17283 # .setGreen(green / denominator)
17284 # .setBlue(blue / denominator);
17285 # int alpha = color.getAlpha();
17286 # if (alpha != 255) {
17287 # result.setAlpha(
17288 # FloatValue
17289 # .newBuilder()
17290 # .setValue(((float) alpha) / denominator)
17291 # .build());
17292 # }
17293 # return resultBuilder.build();
17294 # }
17295 # // ...
17296 #
17297 # Example (iOS / Obj-C):
17298 #
17299 # // ...
17300 # static UIColor* fromProto(Color* protocolor) {
17301 # float red = [protocolor red];
17302 # float green = [protocolor green];
17303 # float blue = [protocolor blue];
17304 # FloatValue* alpha_wrapper = [protocolor alpha];
17305 # float alpha = 1.0;
17306 # if (alpha_wrapper != nil) {
17307 # alpha = [alpha_wrapper value];
17308 # }
17309 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
17310 # }
17311 #
17312 # static Color* toProto(UIColor* color) {
17313 # CGFloat red, green, blue, alpha;
17314 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
17315 # return nil;
17316 # }
17317 # Color* result = [Color alloc] init];
17318 # [result setRed:red];
17319 # [result setGreen:green];
17320 # [result setBlue:blue];
17321 # if (alpha <= 0.9999) {
17322 # [result setAlpha:floatWrapperWithValue(alpha)];
17323 # }
17324 # [result autorelease];
17325 # return result;
17326 # }
17327 # // ...
17328 #
17329 # Example (JavaScript):
17330 #
17331 # // ...
17332 #
17333 # var protoToCssColor = function(rgb_color) {
17334 # var redFrac = rgb_color.red || 0.0;
17335 # var greenFrac = rgb_color.green || 0.0;
17336 # var blueFrac = rgb_color.blue || 0.0;
17337 # var red = Math.floor(redFrac * 255);
17338 # var green = Math.floor(greenFrac * 255);
17339 # var blue = Math.floor(blueFrac * 255);
17340 #
17341 # if (!('alpha' in rgb_color)) {
17342 # return rgbToCssColor_(red, green, blue);
17343 # }
17344 #
17345 # var alphaFrac = rgb_color.alpha.value || 0.0;
17346 # var rgbParams = [red, green, blue].join(',');
17347 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
17348 # };
17349 #
17350 # var rgbToCssColor_ = function(red, green, blue) {
17351 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
17352 # var hexString = rgbNumber.toString(16);
17353 # var missingZeros = 6 - hexString.length;
17354 # var resultBuilder = ['#'];
17355 # for (var i = 0; i < missingZeros; i++) {
17356 # resultBuilder.push('0');
17357 # }
17358 # resultBuilder.push(hexString);
17359 # return resultBuilder.join('');
17360 # };
17361 #
17362 # // ...
17363 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
17364 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
17365 # the final pixel color is defined by the equation:
17366 #
17367 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
17368 #
17369 # This means that a value of 1.0 corresponds to a solid color, whereas
17370 # a value of 0.0 corresponds to a completely transparent color. This
17371 # uses a wrapper message rather than a simple float scalar so that it is
17372 # possible to distinguish between a default value and the value being unset.
17373 # If omitted, this color object is to be rendered as a solid color
17374 # (as if the alpha value had been explicitly given with a value of 1.0).
17375 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
17376 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
17377 },
17378 "bold": True or False, # True if the text is bold.
17379 "strikethrough": True or False, # True if the text has a strikethrough.
17380 "fontFamily": "A String", # The font family.
17381 "fontSize": 42, # The size of the font.
17382 "italic": True or False, # True if the text is italicized.
17383 "underline": True or False, # True if the text is underlined.
17384 },
17385 "hyperlinkDisplayType": "A String", # How a hyperlink, if it exists, should be displayed in the cell.
17386 "borders": { # The borders of the cell. # The borders of the cell.
17387 "top": { # A border along a cell. # The top border of the cell.
17388 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
17389 # for simplicity of conversion to/from color representations in various
17390 # languages over compactness; for example, the fields of this representation
17391 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
17392 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
17393 # method in iOS; and, with just a little work, it can be easily formatted into
17394 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
17395 #
17396 # Example (Java):
17397 #
17398 # import com.google.type.Color;
17399 #
17400 # // ...
17401 # public static java.awt.Color fromProto(Color protocolor) {
17402 # float alpha = protocolor.hasAlpha()
17403 # ? protocolor.getAlpha().getValue()
17404 # : 1.0;
17405 #
17406 # return new java.awt.Color(
17407 # protocolor.getRed(),
17408 # protocolor.getGreen(),
17409 # protocolor.getBlue(),
17410 # alpha);
17411 # }
17412 #
17413 # public static Color toProto(java.awt.Color color) {
17414 # float red = (float) color.getRed();
17415 # float green = (float) color.getGreen();
17416 # float blue = (float) color.getBlue();
17417 # float denominator = 255.0;
17418 # Color.Builder resultBuilder =
17419 # Color
17420 # .newBuilder()
17421 # .setRed(red / denominator)
17422 # .setGreen(green / denominator)
17423 # .setBlue(blue / denominator);
17424 # int alpha = color.getAlpha();
17425 # if (alpha != 255) {
17426 # result.setAlpha(
17427 # FloatValue
17428 # .newBuilder()
17429 # .setValue(((float) alpha) / denominator)
17430 # .build());
17431 # }
17432 # return resultBuilder.build();
17433 # }
17434 # // ...
17435 #
17436 # Example (iOS / Obj-C):
17437 #
17438 # // ...
17439 # static UIColor* fromProto(Color* protocolor) {
17440 # float red = [protocolor red];
17441 # float green = [protocolor green];
17442 # float blue = [protocolor blue];
17443 # FloatValue* alpha_wrapper = [protocolor alpha];
17444 # float alpha = 1.0;
17445 # if (alpha_wrapper != nil) {
17446 # alpha = [alpha_wrapper value];
17447 # }
17448 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
17449 # }
17450 #
17451 # static Color* toProto(UIColor* color) {
17452 # CGFloat red, green, blue, alpha;
17453 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
17454 # return nil;
17455 # }
17456 # Color* result = [Color alloc] init];
17457 # [result setRed:red];
17458 # [result setGreen:green];
17459 # [result setBlue:blue];
17460 # if (alpha <= 0.9999) {
17461 # [result setAlpha:floatWrapperWithValue(alpha)];
17462 # }
17463 # [result autorelease];
17464 # return result;
17465 # }
17466 # // ...
17467 #
17468 # Example (JavaScript):
17469 #
17470 # // ...
17471 #
17472 # var protoToCssColor = function(rgb_color) {
17473 # var redFrac = rgb_color.red || 0.0;
17474 # var greenFrac = rgb_color.green || 0.0;
17475 # var blueFrac = rgb_color.blue || 0.0;
17476 # var red = Math.floor(redFrac * 255);
17477 # var green = Math.floor(greenFrac * 255);
17478 # var blue = Math.floor(blueFrac * 255);
17479 #
17480 # if (!('alpha' in rgb_color)) {
17481 # return rgbToCssColor_(red, green, blue);
17482 # }
17483 #
17484 # var alphaFrac = rgb_color.alpha.value || 0.0;
17485 # var rgbParams = [red, green, blue].join(',');
17486 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
17487 # };
17488 #
17489 # var rgbToCssColor_ = function(red, green, blue) {
17490 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
17491 # var hexString = rgbNumber.toString(16);
17492 # var missingZeros = 6 - hexString.length;
17493 # var resultBuilder = ['#'];
17494 # for (var i = 0; i < missingZeros; i++) {
17495 # resultBuilder.push('0');
17496 # }
17497 # resultBuilder.push(hexString);
17498 # return resultBuilder.join('');
17499 # };
17500 #
17501 # // ...
17502 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
17503 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
17504 # the final pixel color is defined by the equation:
17505 #
17506 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
17507 #
17508 # This means that a value of 1.0 corresponds to a solid color, whereas
17509 # a value of 0.0 corresponds to a completely transparent color. This
17510 # uses a wrapper message rather than a simple float scalar so that it is
17511 # possible to distinguish between a default value and the value being unset.
17512 # If omitted, this color object is to be rendered as a solid color
17513 # (as if the alpha value had been explicitly given with a value of 1.0).
17514 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
17515 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
17516 },
17517 "width": 42, # The width of the border, in pixels.
17518 # Border widths must be between 0 and 3 pixels.
17519 "style": "A String", # The style of the border.
17520 },
17521 "right": { # A border along a cell. # The right border of the cell.
17522 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
17523 # for simplicity of conversion to/from color representations in various
17524 # languages over compactness; for example, the fields of this representation
17525 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
17526 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
17527 # method in iOS; and, with just a little work, it can be easily formatted into
17528 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
17529 #
17530 # Example (Java):
17531 #
17532 # import com.google.type.Color;
17533 #
17534 # // ...
17535 # public static java.awt.Color fromProto(Color protocolor) {
17536 # float alpha = protocolor.hasAlpha()
17537 # ? protocolor.getAlpha().getValue()
17538 # : 1.0;
17539 #
17540 # return new java.awt.Color(
17541 # protocolor.getRed(),
17542 # protocolor.getGreen(),
17543 # protocolor.getBlue(),
17544 # alpha);
17545 # }
17546 #
17547 # public static Color toProto(java.awt.Color color) {
17548 # float red = (float) color.getRed();
17549 # float green = (float) color.getGreen();
17550 # float blue = (float) color.getBlue();
17551 # float denominator = 255.0;
17552 # Color.Builder resultBuilder =
17553 # Color
17554 # .newBuilder()
17555 # .setRed(red / denominator)
17556 # .setGreen(green / denominator)
17557 # .setBlue(blue / denominator);
17558 # int alpha = color.getAlpha();
17559 # if (alpha != 255) {
17560 # result.setAlpha(
17561 # FloatValue
17562 # .newBuilder()
17563 # .setValue(((float) alpha) / denominator)
17564 # .build());
17565 # }
17566 # return resultBuilder.build();
17567 # }
17568 # // ...
17569 #
17570 # Example (iOS / Obj-C):
17571 #
17572 # // ...
17573 # static UIColor* fromProto(Color* protocolor) {
17574 # float red = [protocolor red];
17575 # float green = [protocolor green];
17576 # float blue = [protocolor blue];
17577 # FloatValue* alpha_wrapper = [protocolor alpha];
17578 # float alpha = 1.0;
17579 # if (alpha_wrapper != nil) {
17580 # alpha = [alpha_wrapper value];
17581 # }
17582 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
17583 # }
17584 #
17585 # static Color* toProto(UIColor* color) {
17586 # CGFloat red, green, blue, alpha;
17587 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
17588 # return nil;
17589 # }
17590 # Color* result = [Color alloc] init];
17591 # [result setRed:red];
17592 # [result setGreen:green];
17593 # [result setBlue:blue];
17594 # if (alpha <= 0.9999) {
17595 # [result setAlpha:floatWrapperWithValue(alpha)];
17596 # }
17597 # [result autorelease];
17598 # return result;
17599 # }
17600 # // ...
17601 #
17602 # Example (JavaScript):
17603 #
17604 # // ...
17605 #
17606 # var protoToCssColor = function(rgb_color) {
17607 # var redFrac = rgb_color.red || 0.0;
17608 # var greenFrac = rgb_color.green || 0.0;
17609 # var blueFrac = rgb_color.blue || 0.0;
17610 # var red = Math.floor(redFrac * 255);
17611 # var green = Math.floor(greenFrac * 255);
17612 # var blue = Math.floor(blueFrac * 255);
17613 #
17614 # if (!('alpha' in rgb_color)) {
17615 # return rgbToCssColor_(red, green, blue);
17616 # }
17617 #
17618 # var alphaFrac = rgb_color.alpha.value || 0.0;
17619 # var rgbParams = [red, green, blue].join(',');
17620 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
17621 # };
17622 #
17623 # var rgbToCssColor_ = function(red, green, blue) {
17624 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
17625 # var hexString = rgbNumber.toString(16);
17626 # var missingZeros = 6 - hexString.length;
17627 # var resultBuilder = ['#'];
17628 # for (var i = 0; i < missingZeros; i++) {
17629 # resultBuilder.push('0');
17630 # }
17631 # resultBuilder.push(hexString);
17632 # return resultBuilder.join('');
17633 # };
17634 #
17635 # // ...
17636 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
17637 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
17638 # the final pixel color is defined by the equation:
17639 #
17640 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
17641 #
17642 # This means that a value of 1.0 corresponds to a solid color, whereas
17643 # a value of 0.0 corresponds to a completely transparent color. This
17644 # uses a wrapper message rather than a simple float scalar so that it is
17645 # possible to distinguish between a default value and the value being unset.
17646 # If omitted, this color object is to be rendered as a solid color
17647 # (as if the alpha value had been explicitly given with a value of 1.0).
17648 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
17649 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
17650 },
17651 "width": 42, # The width of the border, in pixels.
17652 # Border widths must be between 0 and 3 pixels.
17653 "style": "A String", # The style of the border.
17654 },
17655 "bottom": { # A border along a cell. # The bottom border of the cell.
17656 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
17657 # for simplicity of conversion to/from color representations in various
17658 # languages over compactness; for example, the fields of this representation
17659 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
17660 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
17661 # method in iOS; and, with just a little work, it can be easily formatted into
17662 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
17663 #
17664 # Example (Java):
17665 #
17666 # import com.google.type.Color;
17667 #
17668 # // ...
17669 # public static java.awt.Color fromProto(Color protocolor) {
17670 # float alpha = protocolor.hasAlpha()
17671 # ? protocolor.getAlpha().getValue()
17672 # : 1.0;
17673 #
17674 # return new java.awt.Color(
17675 # protocolor.getRed(),
17676 # protocolor.getGreen(),
17677 # protocolor.getBlue(),
17678 # alpha);
17679 # }
17680 #
17681 # public static Color toProto(java.awt.Color color) {
17682 # float red = (float) color.getRed();
17683 # float green = (float) color.getGreen();
17684 # float blue = (float) color.getBlue();
17685 # float denominator = 255.0;
17686 # Color.Builder resultBuilder =
17687 # Color
17688 # .newBuilder()
17689 # .setRed(red / denominator)
17690 # .setGreen(green / denominator)
17691 # .setBlue(blue / denominator);
17692 # int alpha = color.getAlpha();
17693 # if (alpha != 255) {
17694 # result.setAlpha(
17695 # FloatValue
17696 # .newBuilder()
17697 # .setValue(((float) alpha) / denominator)
17698 # .build());
17699 # }
17700 # return resultBuilder.build();
17701 # }
17702 # // ...
17703 #
17704 # Example (iOS / Obj-C):
17705 #
17706 # // ...
17707 # static UIColor* fromProto(Color* protocolor) {
17708 # float red = [protocolor red];
17709 # float green = [protocolor green];
17710 # float blue = [protocolor blue];
17711 # FloatValue* alpha_wrapper = [protocolor alpha];
17712 # float alpha = 1.0;
17713 # if (alpha_wrapper != nil) {
17714 # alpha = [alpha_wrapper value];
17715 # }
17716 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
17717 # }
17718 #
17719 # static Color* toProto(UIColor* color) {
17720 # CGFloat red, green, blue, alpha;
17721 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
17722 # return nil;
17723 # }
17724 # Color* result = [Color alloc] init];
17725 # [result setRed:red];
17726 # [result setGreen:green];
17727 # [result setBlue:blue];
17728 # if (alpha <= 0.9999) {
17729 # [result setAlpha:floatWrapperWithValue(alpha)];
17730 # }
17731 # [result autorelease];
17732 # return result;
17733 # }
17734 # // ...
17735 #
17736 # Example (JavaScript):
17737 #
17738 # // ...
17739 #
17740 # var protoToCssColor = function(rgb_color) {
17741 # var redFrac = rgb_color.red || 0.0;
17742 # var greenFrac = rgb_color.green || 0.0;
17743 # var blueFrac = rgb_color.blue || 0.0;
17744 # var red = Math.floor(redFrac * 255);
17745 # var green = Math.floor(greenFrac * 255);
17746 # var blue = Math.floor(blueFrac * 255);
17747 #
17748 # if (!('alpha' in rgb_color)) {
17749 # return rgbToCssColor_(red, green, blue);
17750 # }
17751 #
17752 # var alphaFrac = rgb_color.alpha.value || 0.0;
17753 # var rgbParams = [red, green, blue].join(',');
17754 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
17755 # };
17756 #
17757 # var rgbToCssColor_ = function(red, green, blue) {
17758 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
17759 # var hexString = rgbNumber.toString(16);
17760 # var missingZeros = 6 - hexString.length;
17761 # var resultBuilder = ['#'];
17762 # for (var i = 0; i < missingZeros; i++) {
17763 # resultBuilder.push('0');
17764 # }
17765 # resultBuilder.push(hexString);
17766 # return resultBuilder.join('');
17767 # };
17768 #
17769 # // ...
17770 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
17771 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
17772 # the final pixel color is defined by the equation:
17773 #
17774 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
17775 #
17776 # This means that a value of 1.0 corresponds to a solid color, whereas
17777 # a value of 0.0 corresponds to a completely transparent color. This
17778 # uses a wrapper message rather than a simple float scalar so that it is
17779 # possible to distinguish between a default value and the value being unset.
17780 # If omitted, this color object is to be rendered as a solid color
17781 # (as if the alpha value had been explicitly given with a value of 1.0).
17782 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
17783 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
17784 },
17785 "width": 42, # The width of the border, in pixels.
17786 # Border widths must be between 0 and 3 pixels.
17787 "style": "A String", # The style of the border.
17788 },
17789 "left": { # A border along a cell. # The left border of the cell.
17790 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
17791 # for simplicity of conversion to/from color representations in various
17792 # languages over compactness; for example, the fields of this representation
17793 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
17794 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
17795 # method in iOS; and, with just a little work, it can be easily formatted into
17796 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
17797 #
17798 # Example (Java):
17799 #
17800 # import com.google.type.Color;
17801 #
17802 # // ...
17803 # public static java.awt.Color fromProto(Color protocolor) {
17804 # float alpha = protocolor.hasAlpha()
17805 # ? protocolor.getAlpha().getValue()
17806 # : 1.0;
17807 #
17808 # return new java.awt.Color(
17809 # protocolor.getRed(),
17810 # protocolor.getGreen(),
17811 # protocolor.getBlue(),
17812 # alpha);
17813 # }
17814 #
17815 # public static Color toProto(java.awt.Color color) {
17816 # float red = (float) color.getRed();
17817 # float green = (float) color.getGreen();
17818 # float blue = (float) color.getBlue();
17819 # float denominator = 255.0;
17820 # Color.Builder resultBuilder =
17821 # Color
17822 # .newBuilder()
17823 # .setRed(red / denominator)
17824 # .setGreen(green / denominator)
17825 # .setBlue(blue / denominator);
17826 # int alpha = color.getAlpha();
17827 # if (alpha != 255) {
17828 # result.setAlpha(
17829 # FloatValue
17830 # .newBuilder()
17831 # .setValue(((float) alpha) / denominator)
17832 # .build());
17833 # }
17834 # return resultBuilder.build();
17835 # }
17836 # // ...
17837 #
17838 # Example (iOS / Obj-C):
17839 #
17840 # // ...
17841 # static UIColor* fromProto(Color* protocolor) {
17842 # float red = [protocolor red];
17843 # float green = [protocolor green];
17844 # float blue = [protocolor blue];
17845 # FloatValue* alpha_wrapper = [protocolor alpha];
17846 # float alpha = 1.0;
17847 # if (alpha_wrapper != nil) {
17848 # alpha = [alpha_wrapper value];
17849 # }
17850 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
17851 # }
17852 #
17853 # static Color* toProto(UIColor* color) {
17854 # CGFloat red, green, blue, alpha;
17855 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
17856 # return nil;
17857 # }
17858 # Color* result = [Color alloc] init];
17859 # [result setRed:red];
17860 # [result setGreen:green];
17861 # [result setBlue:blue];
17862 # if (alpha <= 0.9999) {
17863 # [result setAlpha:floatWrapperWithValue(alpha)];
17864 # }
17865 # [result autorelease];
17866 # return result;
17867 # }
17868 # // ...
17869 #
17870 # Example (JavaScript):
17871 #
17872 # // ...
17873 #
17874 # var protoToCssColor = function(rgb_color) {
17875 # var redFrac = rgb_color.red || 0.0;
17876 # var greenFrac = rgb_color.green || 0.0;
17877 # var blueFrac = rgb_color.blue || 0.0;
17878 # var red = Math.floor(redFrac * 255);
17879 # var green = Math.floor(greenFrac * 255);
17880 # var blue = Math.floor(blueFrac * 255);
17881 #
17882 # if (!('alpha' in rgb_color)) {
17883 # return rgbToCssColor_(red, green, blue);
17884 # }
17885 #
17886 # var alphaFrac = rgb_color.alpha.value || 0.0;
17887 # var rgbParams = [red, green, blue].join(',');
17888 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
17889 # };
17890 #
17891 # var rgbToCssColor_ = function(red, green, blue) {
17892 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
17893 # var hexString = rgbNumber.toString(16);
17894 # var missingZeros = 6 - hexString.length;
17895 # var resultBuilder = ['#'];
17896 # for (var i = 0; i < missingZeros; i++) {
17897 # resultBuilder.push('0');
17898 # }
17899 # resultBuilder.push(hexString);
17900 # return resultBuilder.join('');
17901 # };
17902 #
17903 # // ...
17904 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
17905 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
17906 # the final pixel color is defined by the equation:
17907 #
17908 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
17909 #
17910 # This means that a value of 1.0 corresponds to a solid color, whereas
17911 # a value of 0.0 corresponds to a completely transparent color. This
17912 # uses a wrapper message rather than a simple float scalar so that it is
17913 # possible to distinguish between a default value and the value being unset.
17914 # If omitted, this color object is to be rendered as a solid color
17915 # (as if the alpha value had been explicitly given with a value of 1.0).
17916 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
17917 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
17918 },
17919 "width": 42, # The width of the border, in pixels.
17920 # Border widths must be between 0 and 3 pixels.
17921 "style": "A String", # The style of the border.
17922 },
17923 },
17924 "wrapStrategy": "A String", # The wrap strategy for the value in the cell.
17925 },
17926 },
17927 "gradientRule": { # A rule that applies a gradient color scale format, based on # The formatting will vary based on the gradients in the rule.
17928 # the interpolation points listed. The format of a cell will vary
17929 # based on its contents as compared to the values of the interpolation
17930 # points.
17931 "maxpoint": { # A single interpolation point a gradient conditional format. # The final interpolation point.
17932 # These pin the gradient color scale according to the color,
17933 # type and value chosen.
17934 "color": { # Represents a color in the RGBA color space. This representation is designed # The color this interpolation point should use.
17935 # for simplicity of conversion to/from color representations in various
17936 # languages over compactness; for example, the fields of this representation
17937 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
17938 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
17939 # method in iOS; and, with just a little work, it can be easily formatted into
17940 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
17941 #
17942 # Example (Java):
17943 #
17944 # import com.google.type.Color;
17945 #
17946 # // ...
17947 # public static java.awt.Color fromProto(Color protocolor) {
17948 # float alpha = protocolor.hasAlpha()
17949 # ? protocolor.getAlpha().getValue()
17950 # : 1.0;
17951 #
17952 # return new java.awt.Color(
17953 # protocolor.getRed(),
17954 # protocolor.getGreen(),
17955 # protocolor.getBlue(),
17956 # alpha);
17957 # }
17958 #
17959 # public static Color toProto(java.awt.Color color) {
17960 # float red = (float) color.getRed();
17961 # float green = (float) color.getGreen();
17962 # float blue = (float) color.getBlue();
17963 # float denominator = 255.0;
17964 # Color.Builder resultBuilder =
17965 # Color
17966 # .newBuilder()
17967 # .setRed(red / denominator)
17968 # .setGreen(green / denominator)
17969 # .setBlue(blue / denominator);
17970 # int alpha = color.getAlpha();
17971 # if (alpha != 255) {
17972 # result.setAlpha(
17973 # FloatValue
17974 # .newBuilder()
17975 # .setValue(((float) alpha) / denominator)
17976 # .build());
17977 # }
17978 # return resultBuilder.build();
17979 # }
17980 # // ...
17981 #
17982 # Example (iOS / Obj-C):
17983 #
17984 # // ...
17985 # static UIColor* fromProto(Color* protocolor) {
17986 # float red = [protocolor red];
17987 # float green = [protocolor green];
17988 # float blue = [protocolor blue];
17989 # FloatValue* alpha_wrapper = [protocolor alpha];
17990 # float alpha = 1.0;
17991 # if (alpha_wrapper != nil) {
17992 # alpha = [alpha_wrapper value];
17993 # }
17994 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
17995 # }
17996 #
17997 # static Color* toProto(UIColor* color) {
17998 # CGFloat red, green, blue, alpha;
17999 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
18000 # return nil;
18001 # }
18002 # Color* result = [Color alloc] init];
18003 # [result setRed:red];
18004 # [result setGreen:green];
18005 # [result setBlue:blue];
18006 # if (alpha <= 0.9999) {
18007 # [result setAlpha:floatWrapperWithValue(alpha)];
18008 # }
18009 # [result autorelease];
18010 # return result;
18011 # }
18012 # // ...
18013 #
18014 # Example (JavaScript):
18015 #
18016 # // ...
18017 #
18018 # var protoToCssColor = function(rgb_color) {
18019 # var redFrac = rgb_color.red || 0.0;
18020 # var greenFrac = rgb_color.green || 0.0;
18021 # var blueFrac = rgb_color.blue || 0.0;
18022 # var red = Math.floor(redFrac * 255);
18023 # var green = Math.floor(greenFrac * 255);
18024 # var blue = Math.floor(blueFrac * 255);
18025 #
18026 # if (!('alpha' in rgb_color)) {
18027 # return rgbToCssColor_(red, green, blue);
18028 # }
18029 #
18030 # var alphaFrac = rgb_color.alpha.value || 0.0;
18031 # var rgbParams = [red, green, blue].join(',');
18032 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
18033 # };
18034 #
18035 # var rgbToCssColor_ = function(red, green, blue) {
18036 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
18037 # var hexString = rgbNumber.toString(16);
18038 # var missingZeros = 6 - hexString.length;
18039 # var resultBuilder = ['#'];
18040 # for (var i = 0; i < missingZeros; i++) {
18041 # resultBuilder.push('0');
18042 # }
18043 # resultBuilder.push(hexString);
18044 # return resultBuilder.join('');
18045 # };
18046 #
18047 # // ...
18048 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
18049 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
18050 # the final pixel color is defined by the equation:
18051 #
18052 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
18053 #
18054 # This means that a value of 1.0 corresponds to a solid color, whereas
18055 # a value of 0.0 corresponds to a completely transparent color. This
18056 # uses a wrapper message rather than a simple float scalar so that it is
18057 # possible to distinguish between a default value and the value being unset.
18058 # If omitted, this color object is to be rendered as a solid color
18059 # (as if the alpha value had been explicitly given with a value of 1.0).
18060 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
18061 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
18062 },
18063 "type": "A String", # How the value should be interpreted.
18064 "value": "A String", # The value this interpolation point uses. May be a formula.
18065 # Unused if type is MIN or
18066 # MAX.
18067 },
18068 "midpoint": { # A single interpolation point a gradient conditional format. # An optional midway interpolation point.
18069 # These pin the gradient color scale according to the color,
18070 # type and value chosen.
18071 "color": { # Represents a color in the RGBA color space. This representation is designed # The color this interpolation point should use.
18072 # for simplicity of conversion to/from color representations in various
18073 # languages over compactness; for example, the fields of this representation
18074 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
18075 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
18076 # method in iOS; and, with just a little work, it can be easily formatted into
18077 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
18078 #
18079 # Example (Java):
18080 #
18081 # import com.google.type.Color;
18082 #
18083 # // ...
18084 # public static java.awt.Color fromProto(Color protocolor) {
18085 # float alpha = protocolor.hasAlpha()
18086 # ? protocolor.getAlpha().getValue()
18087 # : 1.0;
18088 #
18089 # return new java.awt.Color(
18090 # protocolor.getRed(),
18091 # protocolor.getGreen(),
18092 # protocolor.getBlue(),
18093 # alpha);
18094 # }
18095 #
18096 # public static Color toProto(java.awt.Color color) {
18097 # float red = (float) color.getRed();
18098 # float green = (float) color.getGreen();
18099 # float blue = (float) color.getBlue();
18100 # float denominator = 255.0;
18101 # Color.Builder resultBuilder =
18102 # Color
18103 # .newBuilder()
18104 # .setRed(red / denominator)
18105 # .setGreen(green / denominator)
18106 # .setBlue(blue / denominator);
18107 # int alpha = color.getAlpha();
18108 # if (alpha != 255) {
18109 # result.setAlpha(
18110 # FloatValue
18111 # .newBuilder()
18112 # .setValue(((float) alpha) / denominator)
18113 # .build());
18114 # }
18115 # return resultBuilder.build();
18116 # }
18117 # // ...
18118 #
18119 # Example (iOS / Obj-C):
18120 #
18121 # // ...
18122 # static UIColor* fromProto(Color* protocolor) {
18123 # float red = [protocolor red];
18124 # float green = [protocolor green];
18125 # float blue = [protocolor blue];
18126 # FloatValue* alpha_wrapper = [protocolor alpha];
18127 # float alpha = 1.0;
18128 # if (alpha_wrapper != nil) {
18129 # alpha = [alpha_wrapper value];
18130 # }
18131 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
18132 # }
18133 #
18134 # static Color* toProto(UIColor* color) {
18135 # CGFloat red, green, blue, alpha;
18136 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
18137 # return nil;
18138 # }
18139 # Color* result = [Color alloc] init];
18140 # [result setRed:red];
18141 # [result setGreen:green];
18142 # [result setBlue:blue];
18143 # if (alpha <= 0.9999) {
18144 # [result setAlpha:floatWrapperWithValue(alpha)];
18145 # }
18146 # [result autorelease];
18147 # return result;
18148 # }
18149 # // ...
18150 #
18151 # Example (JavaScript):
18152 #
18153 # // ...
18154 #
18155 # var protoToCssColor = function(rgb_color) {
18156 # var redFrac = rgb_color.red || 0.0;
18157 # var greenFrac = rgb_color.green || 0.0;
18158 # var blueFrac = rgb_color.blue || 0.0;
18159 # var red = Math.floor(redFrac * 255);
18160 # var green = Math.floor(greenFrac * 255);
18161 # var blue = Math.floor(blueFrac * 255);
18162 #
18163 # if (!('alpha' in rgb_color)) {
18164 # return rgbToCssColor_(red, green, blue);
18165 # }
18166 #
18167 # var alphaFrac = rgb_color.alpha.value || 0.0;
18168 # var rgbParams = [red, green, blue].join(',');
18169 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
18170 # };
18171 #
18172 # var rgbToCssColor_ = function(red, green, blue) {
18173 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
18174 # var hexString = rgbNumber.toString(16);
18175 # var missingZeros = 6 - hexString.length;
18176 # var resultBuilder = ['#'];
18177 # for (var i = 0; i < missingZeros; i++) {
18178 # resultBuilder.push('0');
18179 # }
18180 # resultBuilder.push(hexString);
18181 # return resultBuilder.join('');
18182 # };
18183 #
18184 # // ...
18185 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
18186 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
18187 # the final pixel color is defined by the equation:
18188 #
18189 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
18190 #
18191 # This means that a value of 1.0 corresponds to a solid color, whereas
18192 # a value of 0.0 corresponds to a completely transparent color. This
18193 # uses a wrapper message rather than a simple float scalar so that it is
18194 # possible to distinguish between a default value and the value being unset.
18195 # If omitted, this color object is to be rendered as a solid color
18196 # (as if the alpha value had been explicitly given with a value of 1.0).
18197 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
18198 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
18199 },
18200 "type": "A String", # How the value should be interpreted.
18201 "value": "A String", # The value this interpolation point uses. May be a formula.
18202 # Unused if type is MIN or
18203 # MAX.
18204 },
18205 "minpoint": { # A single interpolation point a gradient conditional format. # The starting interpolation point.
18206 # These pin the gradient color scale according to the color,
18207 # type and value chosen.
18208 "color": { # Represents a color in the RGBA color space. This representation is designed # The color this interpolation point should use.
18209 # for simplicity of conversion to/from color representations in various
18210 # languages over compactness; for example, the fields of this representation
18211 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
18212 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
18213 # method in iOS; and, with just a little work, it can be easily formatted into
18214 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
18215 #
18216 # Example (Java):
18217 #
18218 # import com.google.type.Color;
18219 #
18220 # // ...
18221 # public static java.awt.Color fromProto(Color protocolor) {
18222 # float alpha = protocolor.hasAlpha()
18223 # ? protocolor.getAlpha().getValue()
18224 # : 1.0;
18225 #
18226 # return new java.awt.Color(
18227 # protocolor.getRed(),
18228 # protocolor.getGreen(),
18229 # protocolor.getBlue(),
18230 # alpha);
18231 # }
18232 #
18233 # public static Color toProto(java.awt.Color color) {
18234 # float red = (float) color.getRed();
18235 # float green = (float) color.getGreen();
18236 # float blue = (float) color.getBlue();
18237 # float denominator = 255.0;
18238 # Color.Builder resultBuilder =
18239 # Color
18240 # .newBuilder()
18241 # .setRed(red / denominator)
18242 # .setGreen(green / denominator)
18243 # .setBlue(blue / denominator);
18244 # int alpha = color.getAlpha();
18245 # if (alpha != 255) {
18246 # result.setAlpha(
18247 # FloatValue
18248 # .newBuilder()
18249 # .setValue(((float) alpha) / denominator)
18250 # .build());
18251 # }
18252 # return resultBuilder.build();
18253 # }
18254 # // ...
18255 #
18256 # Example (iOS / Obj-C):
18257 #
18258 # // ...
18259 # static UIColor* fromProto(Color* protocolor) {
18260 # float red = [protocolor red];
18261 # float green = [protocolor green];
18262 # float blue = [protocolor blue];
18263 # FloatValue* alpha_wrapper = [protocolor alpha];
18264 # float alpha = 1.0;
18265 # if (alpha_wrapper != nil) {
18266 # alpha = [alpha_wrapper value];
18267 # }
18268 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
18269 # }
18270 #
18271 # static Color* toProto(UIColor* color) {
18272 # CGFloat red, green, blue, alpha;
18273 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
18274 # return nil;
18275 # }
18276 # Color* result = [Color alloc] init];
18277 # [result setRed:red];
18278 # [result setGreen:green];
18279 # [result setBlue:blue];
18280 # if (alpha <= 0.9999) {
18281 # [result setAlpha:floatWrapperWithValue(alpha)];
18282 # }
18283 # [result autorelease];
18284 # return result;
18285 # }
18286 # // ...
18287 #
18288 # Example (JavaScript):
18289 #
18290 # // ...
18291 #
18292 # var protoToCssColor = function(rgb_color) {
18293 # var redFrac = rgb_color.red || 0.0;
18294 # var greenFrac = rgb_color.green || 0.0;
18295 # var blueFrac = rgb_color.blue || 0.0;
18296 # var red = Math.floor(redFrac * 255);
18297 # var green = Math.floor(greenFrac * 255);
18298 # var blue = Math.floor(blueFrac * 255);
18299 #
18300 # if (!('alpha' in rgb_color)) {
18301 # return rgbToCssColor_(red, green, blue);
18302 # }
18303 #
18304 # var alphaFrac = rgb_color.alpha.value || 0.0;
18305 # var rgbParams = [red, green, blue].join(',');
18306 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
18307 # };
18308 #
18309 # var rgbToCssColor_ = function(red, green, blue) {
18310 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
18311 # var hexString = rgbNumber.toString(16);
18312 # var missingZeros = 6 - hexString.length;
18313 # var resultBuilder = ['#'];
18314 # for (var i = 0; i < missingZeros; i++) {
18315 # resultBuilder.push('0');
18316 # }
18317 # resultBuilder.push(hexString);
18318 # return resultBuilder.join('');
18319 # };
18320 #
18321 # // ...
18322 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
18323 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
18324 # the final pixel color is defined by the equation:
18325 #
18326 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
18327 #
18328 # This means that a value of 1.0 corresponds to a solid color, whereas
18329 # a value of 0.0 corresponds to a completely transparent color. This
18330 # uses a wrapper message rather than a simple float scalar so that it is
18331 # possible to distinguish between a default value and the value being unset.
18332 # If omitted, this color object is to be rendered as a solid color
18333 # (as if the alpha value had been explicitly given with a value of 1.0).
18334 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
18335 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
18336 },
18337 "type": "A String", # How the value should be interpreted.
18338 "value": "A String", # The value this interpolation point uses. May be a formula.
18339 # Unused if type is MIN or
18340 # MAX.
18341 },
18342 },
18343 },
18344 },
18345 "addFilterView": { # The result of adding a filter view. # A reply from adding a filter view.
18346 "filter": { # A filter view. # The newly added filter view.
18347 "title": "A String", # The name of the filter view.
18348 "namedRangeId": "A String", # The named range this filter view is backed by, if any.
18349 #
18350 # When writing, only one of range or namedRangeId
18351 # may be set.
18352 "filterViewId": 42, # The ID of the filter view.
18353 "range": { # A range on a sheet. # The range this filter view covers.
18354 #
18355 # When writing, only one of range or namedRangeId
18356 # may be set.
18357 # All indexes are zero-based.
18358 # Indexes are half open, e.g the start index is inclusive
18359 # and the end index is exclusive -- [start_index, end_index).
18360 # Missing indexes indicate the range is unbounded on that side.
18361 #
18362 # For example, if "Sheet1" is grid ID 0, then:
18363 #
18364 # Sheet1!A1:A1 == sheet_id: 0,
18365 # start_row_index: 0, end_row_index: 1,
18366 # start_column_index: 0, end_column_index: 1
18367 #
18368 # Sheet1!A3:B4 == sheet_id: 0,
18369 # start_row_index: 2, end_row_index: 4,
18370 # start_column_index: 0, end_column_index: 2
18371 #
18372 # Sheet1!A:B == sheet_id: 0,
18373 # start_column_index: 0, end_column_index: 2
18374 #
18375 # Sheet1!A5:B == sheet_id: 0,
18376 # start_row_index: 4,
18377 # start_column_index: 0, end_column_index: 2
18378 #
18379 # Sheet1 == sheet_id:0
18380 #
18381 # The start index must always be less than or equal to the end index.
18382 # If the start index equals the end index, then the range is empty.
18383 # Empty ranges are typically not meaningful and are usually rendered in the
18384 # UI as `#REF!`.
18385 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
18386 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
18387 "sheetId": 42, # The sheet this range is on.
18388 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
18389 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
18390 },
18391 "sortSpecs": [ # The sort order per column. Later specifications are used when values
18392 # are equal in the earlier specifications.
18393 { # A sort order associated with a specific column or row.
18394 "sortOrder": "A String", # The order data should be sorted.
18395 "dimensionIndex": 42, # The dimension the sort should be applied to.
18396 },
18397 ],
18398 "criteria": { # The criteria for showing/hiding values per column.
18399 # The map's key is the column index, and the value is the criteria for
18400 # that column.
18401 "a_key": { # Criteria for showing/hiding rows in a filter, filter view.
18402 "hiddenValues": [ # Values that should be hidden.
18403 "A String",
18404 ],
18405 "condition": { # A condition that can evaluate to true or false. # A condition that must be true for values to be shown.
18406 # (This does not override hiddenValues -- if a value is listed there,
18407 # it will still be hidden.)
18408 # BooleanConditions are used by conditional formatting,
18409 # data validation, and the criteria in filters.
18410 "type": "A String", # The type of condition.
18411 "values": [ # The values of the condition. The number of supported values depends
18412 # on the condition type. Some support zero values,
18413 # others one or two values,
18414 # and ConditionType.ONE_OF_LIST supports an arbitrary number of values.
18415 { # The value of the condition.
18416 "relativeDate": "A String", # A relative date (based on the current date).
18417 # Valid only if the type is
18418 # DATE_BEFORE,
18419 # DATE_AFTER,
18420 # DATE_ON_OR_BEFORE or
18421 # DATE_ON_OR_AFTER.
18422 #
18423 # Relative dates are not supported in data validation.
18424 # They are supported only in conditional formatting and
18425 # conditional filters.
18426 "userEnteredValue": "A String", # A value the condition is based on.
18427 # The value will be parsed as if the user typed into a cell.
18428 # Formulas are supported (and must begin with an `=`).
18429 },
18430 ],
18431 },
18432 },
18433 },
18434 },
18435 },
18436 },
18437 ],
18438 }</pre>
18439</div>
18440
18441<div class="method">
18442 <code class="details" id="create">create(body, x__xgafv=None)</code>
18443 <pre>Creates a spreadsheet, returning the newly created spreadsheet.
18444
18445Args:
18446 body: object, The request body. (required)
18447 The object takes the form of:
18448
18449{ # Resource that represents a spreadsheet.
18450 "spreadsheetId": "A String", # The ID of the spreadsheet.
18451 # This field is read-only.
18452 "namedRanges": [ # The named ranges defined in a spreadsheet.
18453 { # A named range.
18454 "namedRangeId": "A String", # The ID of the named range.
18455 "range": { # A range on a sheet. # The range this represents.
18456 # All indexes are zero-based.
18457 # Indexes are half open, e.g the start index is inclusive
18458 # and the end index is exclusive -- [start_index, end_index).
18459 # Missing indexes indicate the range is unbounded on that side.
18460 #
18461 # For example, if "Sheet1" is grid ID 0, then:
18462 #
18463 # Sheet1!A1:A1 == sheet_id: 0,
18464 # start_row_index: 0, end_row_index: 1,
18465 # start_column_index: 0, end_column_index: 1
18466 #
18467 # Sheet1!A3:B4 == sheet_id: 0,
18468 # start_row_index: 2, end_row_index: 4,
18469 # start_column_index: 0, end_column_index: 2
18470 #
18471 # Sheet1!A:B == sheet_id: 0,
18472 # start_column_index: 0, end_column_index: 2
18473 #
18474 # Sheet1!A5:B == sheet_id: 0,
18475 # start_row_index: 4,
18476 # start_column_index: 0, end_column_index: 2
18477 #
18478 # Sheet1 == sheet_id:0
18479 #
18480 # The start index must always be less than or equal to the end index.
18481 # If the start index equals the end index, then the range is empty.
18482 # Empty ranges are typically not meaningful and are usually rendered in the
18483 # UI as `#REF!`.
18484 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
18485 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
18486 "sheetId": 42, # The sheet this range is on.
18487 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
18488 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
18489 },
18490 "name": "A String", # The name of the named range.
18491 },
18492 ],
18493 "properties": { # Properties of a spreadsheet. # Overall properties of a spreadsheet.
18494 "locale": "A String", # The locale of the spreadsheet in one of the following formats:
18495 # * an ISO 639-1 language code such as `en`
18496 # * an ISO 639-2 language code such as `fil`, if no 639-1 code exists
18497 # * a combination of the ISO language code and country code, such as `en_US`
18498 # Note: when updating this field, not all locales/languages are supported.
18499 "timeZone": "A String", # The time zone of the spreadsheet, in CLDR format such as
18500 # `America/New_York`. If the time zone isn't recognized, this may
18501 # be a custom time zone such as `GMT-07:00`.
18502 "autoRecalc": "A String", # The amount of time to wait before volatile functions are recalculated.
18503 "defaultFormat": { # The format of a cell. # The default format of all cells in the spreadsheet.
18504 # CellData.effectiveFormat will not be set if the cell's format is equal
18505 # to this default format.
18506 # This field is read-only.
18507 "numberFormat": { # The number format of a cell. # A format describing how number values should be represented to the user.
18508 # When updating, all fields must be set.
18509 "pattern": "A String", # Pattern string used for formatting.
18510 "type": "A String", # The type of the number format.
18511 },
18512 "textDirection": "A String", # The direction of the text in the cell.
18513 "padding": { # The amount of padding around the cell, in pixels. # The padding of the cell.
18514 # When updating padding, every field must be specified.
18515 "top": 42, # The top padding of the cell.
18516 "right": 42, # The right padding of the cell.
18517 "bottom": 42, # The bottom padding of the cell.
18518 "left": 42, # The left padding of the cell.
18519 },
18520 "horizontalAlignment": "A String", # The horizontal alignment of the value in cell.
18521 "backgroundColor": { # Represents a color in the RGBA color space. This representation is designed # The background color of the cell.
18522 # for simplicity of conversion to/from color representations in various
18523 # languages over compactness; for example, the fields of this representation
18524 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
18525 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
18526 # method in iOS; and, with just a little work, it can be easily formatted into
18527 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
18528 #
18529 # Example (Java):
18530 #
18531 # import com.google.type.Color;
18532 #
18533 # // ...
18534 # public static java.awt.Color fromProto(Color protocolor) {
18535 # float alpha = protocolor.hasAlpha()
18536 # ? protocolor.getAlpha().getValue()
18537 # : 1.0;
18538 #
18539 # return new java.awt.Color(
18540 # protocolor.getRed(),
18541 # protocolor.getGreen(),
18542 # protocolor.getBlue(),
18543 # alpha);
18544 # }
18545 #
18546 # public static Color toProto(java.awt.Color color) {
18547 # float red = (float) color.getRed();
18548 # float green = (float) color.getGreen();
18549 # float blue = (float) color.getBlue();
18550 # float denominator = 255.0;
18551 # Color.Builder resultBuilder =
18552 # Color
18553 # .newBuilder()
18554 # .setRed(red / denominator)
18555 # .setGreen(green / denominator)
18556 # .setBlue(blue / denominator);
18557 # int alpha = color.getAlpha();
18558 # if (alpha != 255) {
18559 # result.setAlpha(
18560 # FloatValue
18561 # .newBuilder()
18562 # .setValue(((float) alpha) / denominator)
18563 # .build());
18564 # }
18565 # return resultBuilder.build();
18566 # }
18567 # // ...
18568 #
18569 # Example (iOS / Obj-C):
18570 #
18571 # // ...
18572 # static UIColor* fromProto(Color* protocolor) {
18573 # float red = [protocolor red];
18574 # float green = [protocolor green];
18575 # float blue = [protocolor blue];
18576 # FloatValue* alpha_wrapper = [protocolor alpha];
18577 # float alpha = 1.0;
18578 # if (alpha_wrapper != nil) {
18579 # alpha = [alpha_wrapper value];
18580 # }
18581 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
18582 # }
18583 #
18584 # static Color* toProto(UIColor* color) {
18585 # CGFloat red, green, blue, alpha;
18586 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
18587 # return nil;
18588 # }
18589 # Color* result = [Color alloc] init];
18590 # [result setRed:red];
18591 # [result setGreen:green];
18592 # [result setBlue:blue];
18593 # if (alpha <= 0.9999) {
18594 # [result setAlpha:floatWrapperWithValue(alpha)];
18595 # }
18596 # [result autorelease];
18597 # return result;
18598 # }
18599 # // ...
18600 #
18601 # Example (JavaScript):
18602 #
18603 # // ...
18604 #
18605 # var protoToCssColor = function(rgb_color) {
18606 # var redFrac = rgb_color.red || 0.0;
18607 # var greenFrac = rgb_color.green || 0.0;
18608 # var blueFrac = rgb_color.blue || 0.0;
18609 # var red = Math.floor(redFrac * 255);
18610 # var green = Math.floor(greenFrac * 255);
18611 # var blue = Math.floor(blueFrac * 255);
18612 #
18613 # if (!('alpha' in rgb_color)) {
18614 # return rgbToCssColor_(red, green, blue);
18615 # }
18616 #
18617 # var alphaFrac = rgb_color.alpha.value || 0.0;
18618 # var rgbParams = [red, green, blue].join(',');
18619 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
18620 # };
18621 #
18622 # var rgbToCssColor_ = function(red, green, blue) {
18623 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
18624 # var hexString = rgbNumber.toString(16);
18625 # var missingZeros = 6 - hexString.length;
18626 # var resultBuilder = ['#'];
18627 # for (var i = 0; i < missingZeros; i++) {
18628 # resultBuilder.push('0');
18629 # }
18630 # resultBuilder.push(hexString);
18631 # return resultBuilder.join('');
18632 # };
18633 #
18634 # // ...
18635 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
18636 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
18637 # the final pixel color is defined by the equation:
18638 #
18639 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
18640 #
18641 # This means that a value of 1.0 corresponds to a solid color, whereas
18642 # a value of 0.0 corresponds to a completely transparent color. This
18643 # uses a wrapper message rather than a simple float scalar so that it is
18644 # possible to distinguish between a default value and the value being unset.
18645 # If omitted, this color object is to be rendered as a solid color
18646 # (as if the alpha value had been explicitly given with a value of 1.0).
18647 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
18648 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
18649 },
18650 "verticalAlignment": "A String", # The vertical alignment of the value in cell.
18651 "textFormat": { # The format of a run of text in a cell. # The format of the text in the cell (unless overridden by a format run).
18652 # Absent values indicate that the field isn't specified.
18653 "foregroundColor": { # Represents a color in the RGBA color space. This representation is designed # The foreground color of the text.
18654 # for simplicity of conversion to/from color representations in various
18655 # languages over compactness; for example, the fields of this representation
18656 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
18657 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
18658 # method in iOS; and, with just a little work, it can be easily formatted into
18659 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
18660 #
18661 # Example (Java):
18662 #
18663 # import com.google.type.Color;
18664 #
18665 # // ...
18666 # public static java.awt.Color fromProto(Color protocolor) {
18667 # float alpha = protocolor.hasAlpha()
18668 # ? protocolor.getAlpha().getValue()
18669 # : 1.0;
18670 #
18671 # return new java.awt.Color(
18672 # protocolor.getRed(),
18673 # protocolor.getGreen(),
18674 # protocolor.getBlue(),
18675 # alpha);
18676 # }
18677 #
18678 # public static Color toProto(java.awt.Color color) {
18679 # float red = (float) color.getRed();
18680 # float green = (float) color.getGreen();
18681 # float blue = (float) color.getBlue();
18682 # float denominator = 255.0;
18683 # Color.Builder resultBuilder =
18684 # Color
18685 # .newBuilder()
18686 # .setRed(red / denominator)
18687 # .setGreen(green / denominator)
18688 # .setBlue(blue / denominator);
18689 # int alpha = color.getAlpha();
18690 # if (alpha != 255) {
18691 # result.setAlpha(
18692 # FloatValue
18693 # .newBuilder()
18694 # .setValue(((float) alpha) / denominator)
18695 # .build());
18696 # }
18697 # return resultBuilder.build();
18698 # }
18699 # // ...
18700 #
18701 # Example (iOS / Obj-C):
18702 #
18703 # // ...
18704 # static UIColor* fromProto(Color* protocolor) {
18705 # float red = [protocolor red];
18706 # float green = [protocolor green];
18707 # float blue = [protocolor blue];
18708 # FloatValue* alpha_wrapper = [protocolor alpha];
18709 # float alpha = 1.0;
18710 # if (alpha_wrapper != nil) {
18711 # alpha = [alpha_wrapper value];
18712 # }
18713 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
18714 # }
18715 #
18716 # static Color* toProto(UIColor* color) {
18717 # CGFloat red, green, blue, alpha;
18718 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
18719 # return nil;
18720 # }
18721 # Color* result = [Color alloc] init];
18722 # [result setRed:red];
18723 # [result setGreen:green];
18724 # [result setBlue:blue];
18725 # if (alpha <= 0.9999) {
18726 # [result setAlpha:floatWrapperWithValue(alpha)];
18727 # }
18728 # [result autorelease];
18729 # return result;
18730 # }
18731 # // ...
18732 #
18733 # Example (JavaScript):
18734 #
18735 # // ...
18736 #
18737 # var protoToCssColor = function(rgb_color) {
18738 # var redFrac = rgb_color.red || 0.0;
18739 # var greenFrac = rgb_color.green || 0.0;
18740 # var blueFrac = rgb_color.blue || 0.0;
18741 # var red = Math.floor(redFrac * 255);
18742 # var green = Math.floor(greenFrac * 255);
18743 # var blue = Math.floor(blueFrac * 255);
18744 #
18745 # if (!('alpha' in rgb_color)) {
18746 # return rgbToCssColor_(red, green, blue);
18747 # }
18748 #
18749 # var alphaFrac = rgb_color.alpha.value || 0.0;
18750 # var rgbParams = [red, green, blue].join(',');
18751 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
18752 # };
18753 #
18754 # var rgbToCssColor_ = function(red, green, blue) {
18755 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
18756 # var hexString = rgbNumber.toString(16);
18757 # var missingZeros = 6 - hexString.length;
18758 # var resultBuilder = ['#'];
18759 # for (var i = 0; i < missingZeros; i++) {
18760 # resultBuilder.push('0');
18761 # }
18762 # resultBuilder.push(hexString);
18763 # return resultBuilder.join('');
18764 # };
18765 #
18766 # // ...
18767 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
18768 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
18769 # the final pixel color is defined by the equation:
18770 #
18771 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
18772 #
18773 # This means that a value of 1.0 corresponds to a solid color, whereas
18774 # a value of 0.0 corresponds to a completely transparent color. This
18775 # uses a wrapper message rather than a simple float scalar so that it is
18776 # possible to distinguish between a default value and the value being unset.
18777 # If omitted, this color object is to be rendered as a solid color
18778 # (as if the alpha value had been explicitly given with a value of 1.0).
18779 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
18780 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
18781 },
18782 "bold": True or False, # True if the text is bold.
18783 "strikethrough": True or False, # True if the text has a strikethrough.
18784 "fontFamily": "A String", # The font family.
18785 "fontSize": 42, # The size of the font.
18786 "italic": True or False, # True if the text is italicized.
18787 "underline": True or False, # True if the text is underlined.
18788 },
18789 "hyperlinkDisplayType": "A String", # How a hyperlink, if it exists, should be displayed in the cell.
18790 "borders": { # The borders of the cell. # The borders of the cell.
18791 "top": { # A border along a cell. # The top border of the cell.
18792 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
18793 # for simplicity of conversion to/from color representations in various
18794 # languages over compactness; for example, the fields of this representation
18795 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
18796 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
18797 # method in iOS; and, with just a little work, it can be easily formatted into
18798 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
18799 #
18800 # Example (Java):
18801 #
18802 # import com.google.type.Color;
18803 #
18804 # // ...
18805 # public static java.awt.Color fromProto(Color protocolor) {
18806 # float alpha = protocolor.hasAlpha()
18807 # ? protocolor.getAlpha().getValue()
18808 # : 1.0;
18809 #
18810 # return new java.awt.Color(
18811 # protocolor.getRed(),
18812 # protocolor.getGreen(),
18813 # protocolor.getBlue(),
18814 # alpha);
18815 # }
18816 #
18817 # public static Color toProto(java.awt.Color color) {
18818 # float red = (float) color.getRed();
18819 # float green = (float) color.getGreen();
18820 # float blue = (float) color.getBlue();
18821 # float denominator = 255.0;
18822 # Color.Builder resultBuilder =
18823 # Color
18824 # .newBuilder()
18825 # .setRed(red / denominator)
18826 # .setGreen(green / denominator)
18827 # .setBlue(blue / denominator);
18828 # int alpha = color.getAlpha();
18829 # if (alpha != 255) {
18830 # result.setAlpha(
18831 # FloatValue
18832 # .newBuilder()
18833 # .setValue(((float) alpha) / denominator)
18834 # .build());
18835 # }
18836 # return resultBuilder.build();
18837 # }
18838 # // ...
18839 #
18840 # Example (iOS / Obj-C):
18841 #
18842 # // ...
18843 # static UIColor* fromProto(Color* protocolor) {
18844 # float red = [protocolor red];
18845 # float green = [protocolor green];
18846 # float blue = [protocolor blue];
18847 # FloatValue* alpha_wrapper = [protocolor alpha];
18848 # float alpha = 1.0;
18849 # if (alpha_wrapper != nil) {
18850 # alpha = [alpha_wrapper value];
18851 # }
18852 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
18853 # }
18854 #
18855 # static Color* toProto(UIColor* color) {
18856 # CGFloat red, green, blue, alpha;
18857 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
18858 # return nil;
18859 # }
18860 # Color* result = [Color alloc] init];
18861 # [result setRed:red];
18862 # [result setGreen:green];
18863 # [result setBlue:blue];
18864 # if (alpha <= 0.9999) {
18865 # [result setAlpha:floatWrapperWithValue(alpha)];
18866 # }
18867 # [result autorelease];
18868 # return result;
18869 # }
18870 # // ...
18871 #
18872 # Example (JavaScript):
18873 #
18874 # // ...
18875 #
18876 # var protoToCssColor = function(rgb_color) {
18877 # var redFrac = rgb_color.red || 0.0;
18878 # var greenFrac = rgb_color.green || 0.0;
18879 # var blueFrac = rgb_color.blue || 0.0;
18880 # var red = Math.floor(redFrac * 255);
18881 # var green = Math.floor(greenFrac * 255);
18882 # var blue = Math.floor(blueFrac * 255);
18883 #
18884 # if (!('alpha' in rgb_color)) {
18885 # return rgbToCssColor_(red, green, blue);
18886 # }
18887 #
18888 # var alphaFrac = rgb_color.alpha.value || 0.0;
18889 # var rgbParams = [red, green, blue].join(',');
18890 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
18891 # };
18892 #
18893 # var rgbToCssColor_ = function(red, green, blue) {
18894 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
18895 # var hexString = rgbNumber.toString(16);
18896 # var missingZeros = 6 - hexString.length;
18897 # var resultBuilder = ['#'];
18898 # for (var i = 0; i < missingZeros; i++) {
18899 # resultBuilder.push('0');
18900 # }
18901 # resultBuilder.push(hexString);
18902 # return resultBuilder.join('');
18903 # };
18904 #
18905 # // ...
18906 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
18907 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
18908 # the final pixel color is defined by the equation:
18909 #
18910 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
18911 #
18912 # This means that a value of 1.0 corresponds to a solid color, whereas
18913 # a value of 0.0 corresponds to a completely transparent color. This
18914 # uses a wrapper message rather than a simple float scalar so that it is
18915 # possible to distinguish between a default value and the value being unset.
18916 # If omitted, this color object is to be rendered as a solid color
18917 # (as if the alpha value had been explicitly given with a value of 1.0).
18918 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
18919 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
18920 },
18921 "width": 42, # The width of the border, in pixels.
18922 # Border widths must be between 0 and 3 pixels.
18923 "style": "A String", # The style of the border.
18924 },
18925 "right": { # A border along a cell. # The right border of the cell.
18926 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
18927 # for simplicity of conversion to/from color representations in various
18928 # languages over compactness; for example, the fields of this representation
18929 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
18930 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
18931 # method in iOS; and, with just a little work, it can be easily formatted into
18932 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
18933 #
18934 # Example (Java):
18935 #
18936 # import com.google.type.Color;
18937 #
18938 # // ...
18939 # public static java.awt.Color fromProto(Color protocolor) {
18940 # float alpha = protocolor.hasAlpha()
18941 # ? protocolor.getAlpha().getValue()
18942 # : 1.0;
18943 #
18944 # return new java.awt.Color(
18945 # protocolor.getRed(),
18946 # protocolor.getGreen(),
18947 # protocolor.getBlue(),
18948 # alpha);
18949 # }
18950 #
18951 # public static Color toProto(java.awt.Color color) {
18952 # float red = (float) color.getRed();
18953 # float green = (float) color.getGreen();
18954 # float blue = (float) color.getBlue();
18955 # float denominator = 255.0;
18956 # Color.Builder resultBuilder =
18957 # Color
18958 # .newBuilder()
18959 # .setRed(red / denominator)
18960 # .setGreen(green / denominator)
18961 # .setBlue(blue / denominator);
18962 # int alpha = color.getAlpha();
18963 # if (alpha != 255) {
18964 # result.setAlpha(
18965 # FloatValue
18966 # .newBuilder()
18967 # .setValue(((float) alpha) / denominator)
18968 # .build());
18969 # }
18970 # return resultBuilder.build();
18971 # }
18972 # // ...
18973 #
18974 # Example (iOS / Obj-C):
18975 #
18976 # // ...
18977 # static UIColor* fromProto(Color* protocolor) {
18978 # float red = [protocolor red];
18979 # float green = [protocolor green];
18980 # float blue = [protocolor blue];
18981 # FloatValue* alpha_wrapper = [protocolor alpha];
18982 # float alpha = 1.0;
18983 # if (alpha_wrapper != nil) {
18984 # alpha = [alpha_wrapper value];
18985 # }
18986 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
18987 # }
18988 #
18989 # static Color* toProto(UIColor* color) {
18990 # CGFloat red, green, blue, alpha;
18991 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
18992 # return nil;
18993 # }
18994 # Color* result = [Color alloc] init];
18995 # [result setRed:red];
18996 # [result setGreen:green];
18997 # [result setBlue:blue];
18998 # if (alpha <= 0.9999) {
18999 # [result setAlpha:floatWrapperWithValue(alpha)];
19000 # }
19001 # [result autorelease];
19002 # return result;
19003 # }
19004 # // ...
19005 #
19006 # Example (JavaScript):
19007 #
19008 # // ...
19009 #
19010 # var protoToCssColor = function(rgb_color) {
19011 # var redFrac = rgb_color.red || 0.0;
19012 # var greenFrac = rgb_color.green || 0.0;
19013 # var blueFrac = rgb_color.blue || 0.0;
19014 # var red = Math.floor(redFrac * 255);
19015 # var green = Math.floor(greenFrac * 255);
19016 # var blue = Math.floor(blueFrac * 255);
19017 #
19018 # if (!('alpha' in rgb_color)) {
19019 # return rgbToCssColor_(red, green, blue);
19020 # }
19021 #
19022 # var alphaFrac = rgb_color.alpha.value || 0.0;
19023 # var rgbParams = [red, green, blue].join(',');
19024 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
19025 # };
19026 #
19027 # var rgbToCssColor_ = function(red, green, blue) {
19028 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
19029 # var hexString = rgbNumber.toString(16);
19030 # var missingZeros = 6 - hexString.length;
19031 # var resultBuilder = ['#'];
19032 # for (var i = 0; i < missingZeros; i++) {
19033 # resultBuilder.push('0');
19034 # }
19035 # resultBuilder.push(hexString);
19036 # return resultBuilder.join('');
19037 # };
19038 #
19039 # // ...
19040 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
19041 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
19042 # the final pixel color is defined by the equation:
19043 #
19044 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
19045 #
19046 # This means that a value of 1.0 corresponds to a solid color, whereas
19047 # a value of 0.0 corresponds to a completely transparent color. This
19048 # uses a wrapper message rather than a simple float scalar so that it is
19049 # possible to distinguish between a default value and the value being unset.
19050 # If omitted, this color object is to be rendered as a solid color
19051 # (as if the alpha value had been explicitly given with a value of 1.0).
19052 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
19053 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
19054 },
19055 "width": 42, # The width of the border, in pixels.
19056 # Border widths must be between 0 and 3 pixels.
19057 "style": "A String", # The style of the border.
19058 },
19059 "bottom": { # A border along a cell. # The bottom border of the cell.
19060 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
19061 # for simplicity of conversion to/from color representations in various
19062 # languages over compactness; for example, the fields of this representation
19063 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
19064 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
19065 # method in iOS; and, with just a little work, it can be easily formatted into
19066 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
19067 #
19068 # Example (Java):
19069 #
19070 # import com.google.type.Color;
19071 #
19072 # // ...
19073 # public static java.awt.Color fromProto(Color protocolor) {
19074 # float alpha = protocolor.hasAlpha()
19075 # ? protocolor.getAlpha().getValue()
19076 # : 1.0;
19077 #
19078 # return new java.awt.Color(
19079 # protocolor.getRed(),
19080 # protocolor.getGreen(),
19081 # protocolor.getBlue(),
19082 # alpha);
19083 # }
19084 #
19085 # public static Color toProto(java.awt.Color color) {
19086 # float red = (float) color.getRed();
19087 # float green = (float) color.getGreen();
19088 # float blue = (float) color.getBlue();
19089 # float denominator = 255.0;
19090 # Color.Builder resultBuilder =
19091 # Color
19092 # .newBuilder()
19093 # .setRed(red / denominator)
19094 # .setGreen(green / denominator)
19095 # .setBlue(blue / denominator);
19096 # int alpha = color.getAlpha();
19097 # if (alpha != 255) {
19098 # result.setAlpha(
19099 # FloatValue
19100 # .newBuilder()
19101 # .setValue(((float) alpha) / denominator)
19102 # .build());
19103 # }
19104 # return resultBuilder.build();
19105 # }
19106 # // ...
19107 #
19108 # Example (iOS / Obj-C):
19109 #
19110 # // ...
19111 # static UIColor* fromProto(Color* protocolor) {
19112 # float red = [protocolor red];
19113 # float green = [protocolor green];
19114 # float blue = [protocolor blue];
19115 # FloatValue* alpha_wrapper = [protocolor alpha];
19116 # float alpha = 1.0;
19117 # if (alpha_wrapper != nil) {
19118 # alpha = [alpha_wrapper value];
19119 # }
19120 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
19121 # }
19122 #
19123 # static Color* toProto(UIColor* color) {
19124 # CGFloat red, green, blue, alpha;
19125 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
19126 # return nil;
19127 # }
19128 # Color* result = [Color alloc] init];
19129 # [result setRed:red];
19130 # [result setGreen:green];
19131 # [result setBlue:blue];
19132 # if (alpha <= 0.9999) {
19133 # [result setAlpha:floatWrapperWithValue(alpha)];
19134 # }
19135 # [result autorelease];
19136 # return result;
19137 # }
19138 # // ...
19139 #
19140 # Example (JavaScript):
19141 #
19142 # // ...
19143 #
19144 # var protoToCssColor = function(rgb_color) {
19145 # var redFrac = rgb_color.red || 0.0;
19146 # var greenFrac = rgb_color.green || 0.0;
19147 # var blueFrac = rgb_color.blue || 0.0;
19148 # var red = Math.floor(redFrac * 255);
19149 # var green = Math.floor(greenFrac * 255);
19150 # var blue = Math.floor(blueFrac * 255);
19151 #
19152 # if (!('alpha' in rgb_color)) {
19153 # return rgbToCssColor_(red, green, blue);
19154 # }
19155 #
19156 # var alphaFrac = rgb_color.alpha.value || 0.0;
19157 # var rgbParams = [red, green, blue].join(',');
19158 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
19159 # };
19160 #
19161 # var rgbToCssColor_ = function(red, green, blue) {
19162 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
19163 # var hexString = rgbNumber.toString(16);
19164 # var missingZeros = 6 - hexString.length;
19165 # var resultBuilder = ['#'];
19166 # for (var i = 0; i < missingZeros; i++) {
19167 # resultBuilder.push('0');
19168 # }
19169 # resultBuilder.push(hexString);
19170 # return resultBuilder.join('');
19171 # };
19172 #
19173 # // ...
19174 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
19175 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
19176 # the final pixel color is defined by the equation:
19177 #
19178 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
19179 #
19180 # This means that a value of 1.0 corresponds to a solid color, whereas
19181 # a value of 0.0 corresponds to a completely transparent color. This
19182 # uses a wrapper message rather than a simple float scalar so that it is
19183 # possible to distinguish between a default value and the value being unset.
19184 # If omitted, this color object is to be rendered as a solid color
19185 # (as if the alpha value had been explicitly given with a value of 1.0).
19186 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
19187 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
19188 },
19189 "width": 42, # The width of the border, in pixels.
19190 # Border widths must be between 0 and 3 pixels.
19191 "style": "A String", # The style of the border.
19192 },
19193 "left": { # A border along a cell. # The left border of the cell.
19194 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
19195 # for simplicity of conversion to/from color representations in various
19196 # languages over compactness; for example, the fields of this representation
19197 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
19198 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
19199 # method in iOS; and, with just a little work, it can be easily formatted into
19200 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
19201 #
19202 # Example (Java):
19203 #
19204 # import com.google.type.Color;
19205 #
19206 # // ...
19207 # public static java.awt.Color fromProto(Color protocolor) {
19208 # float alpha = protocolor.hasAlpha()
19209 # ? protocolor.getAlpha().getValue()
19210 # : 1.0;
19211 #
19212 # return new java.awt.Color(
19213 # protocolor.getRed(),
19214 # protocolor.getGreen(),
19215 # protocolor.getBlue(),
19216 # alpha);
19217 # }
19218 #
19219 # public static Color toProto(java.awt.Color color) {
19220 # float red = (float) color.getRed();
19221 # float green = (float) color.getGreen();
19222 # float blue = (float) color.getBlue();
19223 # float denominator = 255.0;
19224 # Color.Builder resultBuilder =
19225 # Color
19226 # .newBuilder()
19227 # .setRed(red / denominator)
19228 # .setGreen(green / denominator)
19229 # .setBlue(blue / denominator);
19230 # int alpha = color.getAlpha();
19231 # if (alpha != 255) {
19232 # result.setAlpha(
19233 # FloatValue
19234 # .newBuilder()
19235 # .setValue(((float) alpha) / denominator)
19236 # .build());
19237 # }
19238 # return resultBuilder.build();
19239 # }
19240 # // ...
19241 #
19242 # Example (iOS / Obj-C):
19243 #
19244 # // ...
19245 # static UIColor* fromProto(Color* protocolor) {
19246 # float red = [protocolor red];
19247 # float green = [protocolor green];
19248 # float blue = [protocolor blue];
19249 # FloatValue* alpha_wrapper = [protocolor alpha];
19250 # float alpha = 1.0;
19251 # if (alpha_wrapper != nil) {
19252 # alpha = [alpha_wrapper value];
19253 # }
19254 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
19255 # }
19256 #
19257 # static Color* toProto(UIColor* color) {
19258 # CGFloat red, green, blue, alpha;
19259 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
19260 # return nil;
19261 # }
19262 # Color* result = [Color alloc] init];
19263 # [result setRed:red];
19264 # [result setGreen:green];
19265 # [result setBlue:blue];
19266 # if (alpha <= 0.9999) {
19267 # [result setAlpha:floatWrapperWithValue(alpha)];
19268 # }
19269 # [result autorelease];
19270 # return result;
19271 # }
19272 # // ...
19273 #
19274 # Example (JavaScript):
19275 #
19276 # // ...
19277 #
19278 # var protoToCssColor = function(rgb_color) {
19279 # var redFrac = rgb_color.red || 0.0;
19280 # var greenFrac = rgb_color.green || 0.0;
19281 # var blueFrac = rgb_color.blue || 0.0;
19282 # var red = Math.floor(redFrac * 255);
19283 # var green = Math.floor(greenFrac * 255);
19284 # var blue = Math.floor(blueFrac * 255);
19285 #
19286 # if (!('alpha' in rgb_color)) {
19287 # return rgbToCssColor_(red, green, blue);
19288 # }
19289 #
19290 # var alphaFrac = rgb_color.alpha.value || 0.0;
19291 # var rgbParams = [red, green, blue].join(',');
19292 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
19293 # };
19294 #
19295 # var rgbToCssColor_ = function(red, green, blue) {
19296 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
19297 # var hexString = rgbNumber.toString(16);
19298 # var missingZeros = 6 - hexString.length;
19299 # var resultBuilder = ['#'];
19300 # for (var i = 0; i < missingZeros; i++) {
19301 # resultBuilder.push('0');
19302 # }
19303 # resultBuilder.push(hexString);
19304 # return resultBuilder.join('');
19305 # };
19306 #
19307 # // ...
19308 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
19309 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
19310 # the final pixel color is defined by the equation:
19311 #
19312 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
19313 #
19314 # This means that a value of 1.0 corresponds to a solid color, whereas
19315 # a value of 0.0 corresponds to a completely transparent color. This
19316 # uses a wrapper message rather than a simple float scalar so that it is
19317 # possible to distinguish between a default value and the value being unset.
19318 # If omitted, this color object is to be rendered as a solid color
19319 # (as if the alpha value had been explicitly given with a value of 1.0).
19320 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
19321 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
19322 },
19323 "width": 42, # The width of the border, in pixels.
19324 # Border widths must be between 0 and 3 pixels.
19325 "style": "A String", # The style of the border.
19326 },
19327 },
19328 "wrapStrategy": "A String", # The wrap strategy for the value in the cell.
19329 },
19330 "title": "A String", # The title of the spreadsheet.
19331 },
19332 "sheets": [ # The sheets that are part of a spreadsheet.
19333 { # A sheet in a spreadsheet.
19334 "conditionalFormats": [ # The conditional format rules in this sheet.
19335 { # A rule describing a conditional format.
19336 "ranges": [ # The ranges that will be formatted if the condition is true.
19337 # All the ranges must be on the same grid.
19338 { # A range on a sheet.
19339 # All indexes are zero-based.
19340 # Indexes are half open, e.g the start index is inclusive
19341 # and the end index is exclusive -- [start_index, end_index).
19342 # Missing indexes indicate the range is unbounded on that side.
19343 #
19344 # For example, if "Sheet1" is grid ID 0, then:
19345 #
19346 # Sheet1!A1:A1 == sheet_id: 0,
19347 # start_row_index: 0, end_row_index: 1,
19348 # start_column_index: 0, end_column_index: 1
19349 #
19350 # Sheet1!A3:B4 == sheet_id: 0,
19351 # start_row_index: 2, end_row_index: 4,
19352 # start_column_index: 0, end_column_index: 2
19353 #
19354 # Sheet1!A:B == sheet_id: 0,
19355 # start_column_index: 0, end_column_index: 2
19356 #
19357 # Sheet1!A5:B == sheet_id: 0,
19358 # start_row_index: 4,
19359 # start_column_index: 0, end_column_index: 2
19360 #
19361 # Sheet1 == sheet_id:0
19362 #
19363 # The start index must always be less than or equal to the end index.
19364 # If the start index equals the end index, then the range is empty.
19365 # Empty ranges are typically not meaningful and are usually rendered in the
19366 # UI as `#REF!`.
19367 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
19368 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
19369 "sheetId": 42, # The sheet this range is on.
19370 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
19371 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
19372 },
19373 ],
19374 "booleanRule": { # A rule that may or may not match, depending on the condition. # The formatting is either "on" or "off" according to the rule.
19375 "condition": { # A condition that can evaluate to true or false. # The condition of the rule. If the condition evaluates to true,
19376 # the format will be applied.
19377 # BooleanConditions are used by conditional formatting,
19378 # data validation, and the criteria in filters.
19379 "type": "A String", # The type of condition.
19380 "values": [ # The values of the condition. The number of supported values depends
19381 # on the condition type. Some support zero values,
19382 # others one or two values,
19383 # and ConditionType.ONE_OF_LIST supports an arbitrary number of values.
19384 { # The value of the condition.
19385 "relativeDate": "A String", # A relative date (based on the current date).
19386 # Valid only if the type is
19387 # DATE_BEFORE,
19388 # DATE_AFTER,
19389 # DATE_ON_OR_BEFORE or
19390 # DATE_ON_OR_AFTER.
19391 #
19392 # Relative dates are not supported in data validation.
19393 # They are supported only in conditional formatting and
19394 # conditional filters.
19395 "userEnteredValue": "A String", # A value the condition is based on.
19396 # The value will be parsed as if the user typed into a cell.
19397 # Formulas are supported (and must begin with an `=`).
19398 },
19399 ],
19400 },
19401 "format": { # The format of a cell. # The format to apply.
19402 # Conditional formatting can only apply a subset of formatting:
19403 # bold, italic,
19404 # strikethrough,
19405 # foreground color &
19406 # background color.
19407 "numberFormat": { # The number format of a cell. # A format describing how number values should be represented to the user.
19408 # When updating, all fields must be set.
19409 "pattern": "A String", # Pattern string used for formatting.
19410 "type": "A String", # The type of the number format.
19411 },
19412 "textDirection": "A String", # The direction of the text in the cell.
19413 "padding": { # The amount of padding around the cell, in pixels. # The padding of the cell.
19414 # When updating padding, every field must be specified.
19415 "top": 42, # The top padding of the cell.
19416 "right": 42, # The right padding of the cell.
19417 "bottom": 42, # The bottom padding of the cell.
19418 "left": 42, # The left padding of the cell.
19419 },
19420 "horizontalAlignment": "A String", # The horizontal alignment of the value in cell.
19421 "backgroundColor": { # Represents a color in the RGBA color space. This representation is designed # The background color of the cell.
19422 # for simplicity of conversion to/from color representations in various
19423 # languages over compactness; for example, the fields of this representation
19424 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
19425 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
19426 # method in iOS; and, with just a little work, it can be easily formatted into
19427 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
19428 #
19429 # Example (Java):
19430 #
19431 # import com.google.type.Color;
19432 #
19433 # // ...
19434 # public static java.awt.Color fromProto(Color protocolor) {
19435 # float alpha = protocolor.hasAlpha()
19436 # ? protocolor.getAlpha().getValue()
19437 # : 1.0;
19438 #
19439 # return new java.awt.Color(
19440 # protocolor.getRed(),
19441 # protocolor.getGreen(),
19442 # protocolor.getBlue(),
19443 # alpha);
19444 # }
19445 #
19446 # public static Color toProto(java.awt.Color color) {
19447 # float red = (float) color.getRed();
19448 # float green = (float) color.getGreen();
19449 # float blue = (float) color.getBlue();
19450 # float denominator = 255.0;
19451 # Color.Builder resultBuilder =
19452 # Color
19453 # .newBuilder()
19454 # .setRed(red / denominator)
19455 # .setGreen(green / denominator)
19456 # .setBlue(blue / denominator);
19457 # int alpha = color.getAlpha();
19458 # if (alpha != 255) {
19459 # result.setAlpha(
19460 # FloatValue
19461 # .newBuilder()
19462 # .setValue(((float) alpha) / denominator)
19463 # .build());
19464 # }
19465 # return resultBuilder.build();
19466 # }
19467 # // ...
19468 #
19469 # Example (iOS / Obj-C):
19470 #
19471 # // ...
19472 # static UIColor* fromProto(Color* protocolor) {
19473 # float red = [protocolor red];
19474 # float green = [protocolor green];
19475 # float blue = [protocolor blue];
19476 # FloatValue* alpha_wrapper = [protocolor alpha];
19477 # float alpha = 1.0;
19478 # if (alpha_wrapper != nil) {
19479 # alpha = [alpha_wrapper value];
19480 # }
19481 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
19482 # }
19483 #
19484 # static Color* toProto(UIColor* color) {
19485 # CGFloat red, green, blue, alpha;
19486 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
19487 # return nil;
19488 # }
19489 # Color* result = [Color alloc] init];
19490 # [result setRed:red];
19491 # [result setGreen:green];
19492 # [result setBlue:blue];
19493 # if (alpha <= 0.9999) {
19494 # [result setAlpha:floatWrapperWithValue(alpha)];
19495 # }
19496 # [result autorelease];
19497 # return result;
19498 # }
19499 # // ...
19500 #
19501 # Example (JavaScript):
19502 #
19503 # // ...
19504 #
19505 # var protoToCssColor = function(rgb_color) {
19506 # var redFrac = rgb_color.red || 0.0;
19507 # var greenFrac = rgb_color.green || 0.0;
19508 # var blueFrac = rgb_color.blue || 0.0;
19509 # var red = Math.floor(redFrac * 255);
19510 # var green = Math.floor(greenFrac * 255);
19511 # var blue = Math.floor(blueFrac * 255);
19512 #
19513 # if (!('alpha' in rgb_color)) {
19514 # return rgbToCssColor_(red, green, blue);
19515 # }
19516 #
19517 # var alphaFrac = rgb_color.alpha.value || 0.0;
19518 # var rgbParams = [red, green, blue].join(',');
19519 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
19520 # };
19521 #
19522 # var rgbToCssColor_ = function(red, green, blue) {
19523 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
19524 # var hexString = rgbNumber.toString(16);
19525 # var missingZeros = 6 - hexString.length;
19526 # var resultBuilder = ['#'];
19527 # for (var i = 0; i < missingZeros; i++) {
19528 # resultBuilder.push('0');
19529 # }
19530 # resultBuilder.push(hexString);
19531 # return resultBuilder.join('');
19532 # };
19533 #
19534 # // ...
19535 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
19536 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
19537 # the final pixel color is defined by the equation:
19538 #
19539 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
19540 #
19541 # This means that a value of 1.0 corresponds to a solid color, whereas
19542 # a value of 0.0 corresponds to a completely transparent color. This
19543 # uses a wrapper message rather than a simple float scalar so that it is
19544 # possible to distinguish between a default value and the value being unset.
19545 # If omitted, this color object is to be rendered as a solid color
19546 # (as if the alpha value had been explicitly given with a value of 1.0).
19547 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
19548 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
19549 },
19550 "verticalAlignment": "A String", # The vertical alignment of the value in cell.
19551 "textFormat": { # The format of a run of text in a cell. # The format of the text in the cell (unless overridden by a format run).
19552 # Absent values indicate that the field isn't specified.
19553 "foregroundColor": { # Represents a color in the RGBA color space. This representation is designed # The foreground color of the text.
19554 # for simplicity of conversion to/from color representations in various
19555 # languages over compactness; for example, the fields of this representation
19556 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
19557 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
19558 # method in iOS; and, with just a little work, it can be easily formatted into
19559 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
19560 #
19561 # Example (Java):
19562 #
19563 # import com.google.type.Color;
19564 #
19565 # // ...
19566 # public static java.awt.Color fromProto(Color protocolor) {
19567 # float alpha = protocolor.hasAlpha()
19568 # ? protocolor.getAlpha().getValue()
19569 # : 1.0;
19570 #
19571 # return new java.awt.Color(
19572 # protocolor.getRed(),
19573 # protocolor.getGreen(),
19574 # protocolor.getBlue(),
19575 # alpha);
19576 # }
19577 #
19578 # public static Color toProto(java.awt.Color color) {
19579 # float red = (float) color.getRed();
19580 # float green = (float) color.getGreen();
19581 # float blue = (float) color.getBlue();
19582 # float denominator = 255.0;
19583 # Color.Builder resultBuilder =
19584 # Color
19585 # .newBuilder()
19586 # .setRed(red / denominator)
19587 # .setGreen(green / denominator)
19588 # .setBlue(blue / denominator);
19589 # int alpha = color.getAlpha();
19590 # if (alpha != 255) {
19591 # result.setAlpha(
19592 # FloatValue
19593 # .newBuilder()
19594 # .setValue(((float) alpha) / denominator)
19595 # .build());
19596 # }
19597 # return resultBuilder.build();
19598 # }
19599 # // ...
19600 #
19601 # Example (iOS / Obj-C):
19602 #
19603 # // ...
19604 # static UIColor* fromProto(Color* protocolor) {
19605 # float red = [protocolor red];
19606 # float green = [protocolor green];
19607 # float blue = [protocolor blue];
19608 # FloatValue* alpha_wrapper = [protocolor alpha];
19609 # float alpha = 1.0;
19610 # if (alpha_wrapper != nil) {
19611 # alpha = [alpha_wrapper value];
19612 # }
19613 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
19614 # }
19615 #
19616 # static Color* toProto(UIColor* color) {
19617 # CGFloat red, green, blue, alpha;
19618 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
19619 # return nil;
19620 # }
19621 # Color* result = [Color alloc] init];
19622 # [result setRed:red];
19623 # [result setGreen:green];
19624 # [result setBlue:blue];
19625 # if (alpha <= 0.9999) {
19626 # [result setAlpha:floatWrapperWithValue(alpha)];
19627 # }
19628 # [result autorelease];
19629 # return result;
19630 # }
19631 # // ...
19632 #
19633 # Example (JavaScript):
19634 #
19635 # // ...
19636 #
19637 # var protoToCssColor = function(rgb_color) {
19638 # var redFrac = rgb_color.red || 0.0;
19639 # var greenFrac = rgb_color.green || 0.0;
19640 # var blueFrac = rgb_color.blue || 0.0;
19641 # var red = Math.floor(redFrac * 255);
19642 # var green = Math.floor(greenFrac * 255);
19643 # var blue = Math.floor(blueFrac * 255);
19644 #
19645 # if (!('alpha' in rgb_color)) {
19646 # return rgbToCssColor_(red, green, blue);
19647 # }
19648 #
19649 # var alphaFrac = rgb_color.alpha.value || 0.0;
19650 # var rgbParams = [red, green, blue].join(',');
19651 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
19652 # };
19653 #
19654 # var rgbToCssColor_ = function(red, green, blue) {
19655 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
19656 # var hexString = rgbNumber.toString(16);
19657 # var missingZeros = 6 - hexString.length;
19658 # var resultBuilder = ['#'];
19659 # for (var i = 0; i < missingZeros; i++) {
19660 # resultBuilder.push('0');
19661 # }
19662 # resultBuilder.push(hexString);
19663 # return resultBuilder.join('');
19664 # };
19665 #
19666 # // ...
19667 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
19668 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
19669 # the final pixel color is defined by the equation:
19670 #
19671 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
19672 #
19673 # This means that a value of 1.0 corresponds to a solid color, whereas
19674 # a value of 0.0 corresponds to a completely transparent color. This
19675 # uses a wrapper message rather than a simple float scalar so that it is
19676 # possible to distinguish between a default value and the value being unset.
19677 # If omitted, this color object is to be rendered as a solid color
19678 # (as if the alpha value had been explicitly given with a value of 1.0).
19679 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
19680 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
19681 },
19682 "bold": True or False, # True if the text is bold.
19683 "strikethrough": True or False, # True if the text has a strikethrough.
19684 "fontFamily": "A String", # The font family.
19685 "fontSize": 42, # The size of the font.
19686 "italic": True or False, # True if the text is italicized.
19687 "underline": True or False, # True if the text is underlined.
19688 },
19689 "hyperlinkDisplayType": "A String", # How a hyperlink, if it exists, should be displayed in the cell.
19690 "borders": { # The borders of the cell. # The borders of the cell.
19691 "top": { # A border along a cell. # The top border of the cell.
19692 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
19693 # for simplicity of conversion to/from color representations in various
19694 # languages over compactness; for example, the fields of this representation
19695 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
19696 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
19697 # method in iOS; and, with just a little work, it can be easily formatted into
19698 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
19699 #
19700 # Example (Java):
19701 #
19702 # import com.google.type.Color;
19703 #
19704 # // ...
19705 # public static java.awt.Color fromProto(Color protocolor) {
19706 # float alpha = protocolor.hasAlpha()
19707 # ? protocolor.getAlpha().getValue()
19708 # : 1.0;
19709 #
19710 # return new java.awt.Color(
19711 # protocolor.getRed(),
19712 # protocolor.getGreen(),
19713 # protocolor.getBlue(),
19714 # alpha);
19715 # }
19716 #
19717 # public static Color toProto(java.awt.Color color) {
19718 # float red = (float) color.getRed();
19719 # float green = (float) color.getGreen();
19720 # float blue = (float) color.getBlue();
19721 # float denominator = 255.0;
19722 # Color.Builder resultBuilder =
19723 # Color
19724 # .newBuilder()
19725 # .setRed(red / denominator)
19726 # .setGreen(green / denominator)
19727 # .setBlue(blue / denominator);
19728 # int alpha = color.getAlpha();
19729 # if (alpha != 255) {
19730 # result.setAlpha(
19731 # FloatValue
19732 # .newBuilder()
19733 # .setValue(((float) alpha) / denominator)
19734 # .build());
19735 # }
19736 # return resultBuilder.build();
19737 # }
19738 # // ...
19739 #
19740 # Example (iOS / Obj-C):
19741 #
19742 # // ...
19743 # static UIColor* fromProto(Color* protocolor) {
19744 # float red = [protocolor red];
19745 # float green = [protocolor green];
19746 # float blue = [protocolor blue];
19747 # FloatValue* alpha_wrapper = [protocolor alpha];
19748 # float alpha = 1.0;
19749 # if (alpha_wrapper != nil) {
19750 # alpha = [alpha_wrapper value];
19751 # }
19752 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
19753 # }
19754 #
19755 # static Color* toProto(UIColor* color) {
19756 # CGFloat red, green, blue, alpha;
19757 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
19758 # return nil;
19759 # }
19760 # Color* result = [Color alloc] init];
19761 # [result setRed:red];
19762 # [result setGreen:green];
19763 # [result setBlue:blue];
19764 # if (alpha <= 0.9999) {
19765 # [result setAlpha:floatWrapperWithValue(alpha)];
19766 # }
19767 # [result autorelease];
19768 # return result;
19769 # }
19770 # // ...
19771 #
19772 # Example (JavaScript):
19773 #
19774 # // ...
19775 #
19776 # var protoToCssColor = function(rgb_color) {
19777 # var redFrac = rgb_color.red || 0.0;
19778 # var greenFrac = rgb_color.green || 0.0;
19779 # var blueFrac = rgb_color.blue || 0.0;
19780 # var red = Math.floor(redFrac * 255);
19781 # var green = Math.floor(greenFrac * 255);
19782 # var blue = Math.floor(blueFrac * 255);
19783 #
19784 # if (!('alpha' in rgb_color)) {
19785 # return rgbToCssColor_(red, green, blue);
19786 # }
19787 #
19788 # var alphaFrac = rgb_color.alpha.value || 0.0;
19789 # var rgbParams = [red, green, blue].join(',');
19790 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
19791 # };
19792 #
19793 # var rgbToCssColor_ = function(red, green, blue) {
19794 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
19795 # var hexString = rgbNumber.toString(16);
19796 # var missingZeros = 6 - hexString.length;
19797 # var resultBuilder = ['#'];
19798 # for (var i = 0; i < missingZeros; i++) {
19799 # resultBuilder.push('0');
19800 # }
19801 # resultBuilder.push(hexString);
19802 # return resultBuilder.join('');
19803 # };
19804 #
19805 # // ...
19806 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
19807 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
19808 # the final pixel color is defined by the equation:
19809 #
19810 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
19811 #
19812 # This means that a value of 1.0 corresponds to a solid color, whereas
19813 # a value of 0.0 corresponds to a completely transparent color. This
19814 # uses a wrapper message rather than a simple float scalar so that it is
19815 # possible to distinguish between a default value and the value being unset.
19816 # If omitted, this color object is to be rendered as a solid color
19817 # (as if the alpha value had been explicitly given with a value of 1.0).
19818 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
19819 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
19820 },
19821 "width": 42, # The width of the border, in pixels.
19822 # Border widths must be between 0 and 3 pixels.
19823 "style": "A String", # The style of the border.
19824 },
19825 "right": { # A border along a cell. # The right border of the cell.
19826 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
19827 # for simplicity of conversion to/from color representations in various
19828 # languages over compactness; for example, the fields of this representation
19829 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
19830 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
19831 # method in iOS; and, with just a little work, it can be easily formatted into
19832 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
19833 #
19834 # Example (Java):
19835 #
19836 # import com.google.type.Color;
19837 #
19838 # // ...
19839 # public static java.awt.Color fromProto(Color protocolor) {
19840 # float alpha = protocolor.hasAlpha()
19841 # ? protocolor.getAlpha().getValue()
19842 # : 1.0;
19843 #
19844 # return new java.awt.Color(
19845 # protocolor.getRed(),
19846 # protocolor.getGreen(),
19847 # protocolor.getBlue(),
19848 # alpha);
19849 # }
19850 #
19851 # public static Color toProto(java.awt.Color color) {
19852 # float red = (float) color.getRed();
19853 # float green = (float) color.getGreen();
19854 # float blue = (float) color.getBlue();
19855 # float denominator = 255.0;
19856 # Color.Builder resultBuilder =
19857 # Color
19858 # .newBuilder()
19859 # .setRed(red / denominator)
19860 # .setGreen(green / denominator)
19861 # .setBlue(blue / denominator);
19862 # int alpha = color.getAlpha();
19863 # if (alpha != 255) {
19864 # result.setAlpha(
19865 # FloatValue
19866 # .newBuilder()
19867 # .setValue(((float) alpha) / denominator)
19868 # .build());
19869 # }
19870 # return resultBuilder.build();
19871 # }
19872 # // ...
19873 #
19874 # Example (iOS / Obj-C):
19875 #
19876 # // ...
19877 # static UIColor* fromProto(Color* protocolor) {
19878 # float red = [protocolor red];
19879 # float green = [protocolor green];
19880 # float blue = [protocolor blue];
19881 # FloatValue* alpha_wrapper = [protocolor alpha];
19882 # float alpha = 1.0;
19883 # if (alpha_wrapper != nil) {
19884 # alpha = [alpha_wrapper value];
19885 # }
19886 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
19887 # }
19888 #
19889 # static Color* toProto(UIColor* color) {
19890 # CGFloat red, green, blue, alpha;
19891 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
19892 # return nil;
19893 # }
19894 # Color* result = [Color alloc] init];
19895 # [result setRed:red];
19896 # [result setGreen:green];
19897 # [result setBlue:blue];
19898 # if (alpha <= 0.9999) {
19899 # [result setAlpha:floatWrapperWithValue(alpha)];
19900 # }
19901 # [result autorelease];
19902 # return result;
19903 # }
19904 # // ...
19905 #
19906 # Example (JavaScript):
19907 #
19908 # // ...
19909 #
19910 # var protoToCssColor = function(rgb_color) {
19911 # var redFrac = rgb_color.red || 0.0;
19912 # var greenFrac = rgb_color.green || 0.0;
19913 # var blueFrac = rgb_color.blue || 0.0;
19914 # var red = Math.floor(redFrac * 255);
19915 # var green = Math.floor(greenFrac * 255);
19916 # var blue = Math.floor(blueFrac * 255);
19917 #
19918 # if (!('alpha' in rgb_color)) {
19919 # return rgbToCssColor_(red, green, blue);
19920 # }
19921 #
19922 # var alphaFrac = rgb_color.alpha.value || 0.0;
19923 # var rgbParams = [red, green, blue].join(',');
19924 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
19925 # };
19926 #
19927 # var rgbToCssColor_ = function(red, green, blue) {
19928 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
19929 # var hexString = rgbNumber.toString(16);
19930 # var missingZeros = 6 - hexString.length;
19931 # var resultBuilder = ['#'];
19932 # for (var i = 0; i < missingZeros; i++) {
19933 # resultBuilder.push('0');
19934 # }
19935 # resultBuilder.push(hexString);
19936 # return resultBuilder.join('');
19937 # };
19938 #
19939 # // ...
19940 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
19941 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
19942 # the final pixel color is defined by the equation:
19943 #
19944 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
19945 #
19946 # This means that a value of 1.0 corresponds to a solid color, whereas
19947 # a value of 0.0 corresponds to a completely transparent color. This
19948 # uses a wrapper message rather than a simple float scalar so that it is
19949 # possible to distinguish between a default value and the value being unset.
19950 # If omitted, this color object is to be rendered as a solid color
19951 # (as if the alpha value had been explicitly given with a value of 1.0).
19952 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
19953 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
19954 },
19955 "width": 42, # The width of the border, in pixels.
19956 # Border widths must be between 0 and 3 pixels.
19957 "style": "A String", # The style of the border.
19958 },
19959 "bottom": { # A border along a cell. # The bottom border of the cell.
19960 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
19961 # for simplicity of conversion to/from color representations in various
19962 # languages over compactness; for example, the fields of this representation
19963 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
19964 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
19965 # method in iOS; and, with just a little work, it can be easily formatted into
19966 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
19967 #
19968 # Example (Java):
19969 #
19970 # import com.google.type.Color;
19971 #
19972 # // ...
19973 # public static java.awt.Color fromProto(Color protocolor) {
19974 # float alpha = protocolor.hasAlpha()
19975 # ? protocolor.getAlpha().getValue()
19976 # : 1.0;
19977 #
19978 # return new java.awt.Color(
19979 # protocolor.getRed(),
19980 # protocolor.getGreen(),
19981 # protocolor.getBlue(),
19982 # alpha);
19983 # }
19984 #
19985 # public static Color toProto(java.awt.Color color) {
19986 # float red = (float) color.getRed();
19987 # float green = (float) color.getGreen();
19988 # float blue = (float) color.getBlue();
19989 # float denominator = 255.0;
19990 # Color.Builder resultBuilder =
19991 # Color
19992 # .newBuilder()
19993 # .setRed(red / denominator)
19994 # .setGreen(green / denominator)
19995 # .setBlue(blue / denominator);
19996 # int alpha = color.getAlpha();
19997 # if (alpha != 255) {
19998 # result.setAlpha(
19999 # FloatValue
20000 # .newBuilder()
20001 # .setValue(((float) alpha) / denominator)
20002 # .build());
20003 # }
20004 # return resultBuilder.build();
20005 # }
20006 # // ...
20007 #
20008 # Example (iOS / Obj-C):
20009 #
20010 # // ...
20011 # static UIColor* fromProto(Color* protocolor) {
20012 # float red = [protocolor red];
20013 # float green = [protocolor green];
20014 # float blue = [protocolor blue];
20015 # FloatValue* alpha_wrapper = [protocolor alpha];
20016 # float alpha = 1.0;
20017 # if (alpha_wrapper != nil) {
20018 # alpha = [alpha_wrapper value];
20019 # }
20020 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
20021 # }
20022 #
20023 # static Color* toProto(UIColor* color) {
20024 # CGFloat red, green, blue, alpha;
20025 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
20026 # return nil;
20027 # }
20028 # Color* result = [Color alloc] init];
20029 # [result setRed:red];
20030 # [result setGreen:green];
20031 # [result setBlue:blue];
20032 # if (alpha <= 0.9999) {
20033 # [result setAlpha:floatWrapperWithValue(alpha)];
20034 # }
20035 # [result autorelease];
20036 # return result;
20037 # }
20038 # // ...
20039 #
20040 # Example (JavaScript):
20041 #
20042 # // ...
20043 #
20044 # var protoToCssColor = function(rgb_color) {
20045 # var redFrac = rgb_color.red || 0.0;
20046 # var greenFrac = rgb_color.green || 0.0;
20047 # var blueFrac = rgb_color.blue || 0.0;
20048 # var red = Math.floor(redFrac * 255);
20049 # var green = Math.floor(greenFrac * 255);
20050 # var blue = Math.floor(blueFrac * 255);
20051 #
20052 # if (!('alpha' in rgb_color)) {
20053 # return rgbToCssColor_(red, green, blue);
20054 # }
20055 #
20056 # var alphaFrac = rgb_color.alpha.value || 0.0;
20057 # var rgbParams = [red, green, blue].join(',');
20058 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
20059 # };
20060 #
20061 # var rgbToCssColor_ = function(red, green, blue) {
20062 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
20063 # var hexString = rgbNumber.toString(16);
20064 # var missingZeros = 6 - hexString.length;
20065 # var resultBuilder = ['#'];
20066 # for (var i = 0; i < missingZeros; i++) {
20067 # resultBuilder.push('0');
20068 # }
20069 # resultBuilder.push(hexString);
20070 # return resultBuilder.join('');
20071 # };
20072 #
20073 # // ...
20074 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
20075 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
20076 # the final pixel color is defined by the equation:
20077 #
20078 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
20079 #
20080 # This means that a value of 1.0 corresponds to a solid color, whereas
20081 # a value of 0.0 corresponds to a completely transparent color. This
20082 # uses a wrapper message rather than a simple float scalar so that it is
20083 # possible to distinguish between a default value and the value being unset.
20084 # If omitted, this color object is to be rendered as a solid color
20085 # (as if the alpha value had been explicitly given with a value of 1.0).
20086 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
20087 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
20088 },
20089 "width": 42, # The width of the border, in pixels.
20090 # Border widths must be between 0 and 3 pixels.
20091 "style": "A String", # The style of the border.
20092 },
20093 "left": { # A border along a cell. # The left border of the cell.
20094 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
20095 # for simplicity of conversion to/from color representations in various
20096 # languages over compactness; for example, the fields of this representation
20097 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
20098 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
20099 # method in iOS; and, with just a little work, it can be easily formatted into
20100 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
20101 #
20102 # Example (Java):
20103 #
20104 # import com.google.type.Color;
20105 #
20106 # // ...
20107 # public static java.awt.Color fromProto(Color protocolor) {
20108 # float alpha = protocolor.hasAlpha()
20109 # ? protocolor.getAlpha().getValue()
20110 # : 1.0;
20111 #
20112 # return new java.awt.Color(
20113 # protocolor.getRed(),
20114 # protocolor.getGreen(),
20115 # protocolor.getBlue(),
20116 # alpha);
20117 # }
20118 #
20119 # public static Color toProto(java.awt.Color color) {
20120 # float red = (float) color.getRed();
20121 # float green = (float) color.getGreen();
20122 # float blue = (float) color.getBlue();
20123 # float denominator = 255.0;
20124 # Color.Builder resultBuilder =
20125 # Color
20126 # .newBuilder()
20127 # .setRed(red / denominator)
20128 # .setGreen(green / denominator)
20129 # .setBlue(blue / denominator);
20130 # int alpha = color.getAlpha();
20131 # if (alpha != 255) {
20132 # result.setAlpha(
20133 # FloatValue
20134 # .newBuilder()
20135 # .setValue(((float) alpha) / denominator)
20136 # .build());
20137 # }
20138 # return resultBuilder.build();
20139 # }
20140 # // ...
20141 #
20142 # Example (iOS / Obj-C):
20143 #
20144 # // ...
20145 # static UIColor* fromProto(Color* protocolor) {
20146 # float red = [protocolor red];
20147 # float green = [protocolor green];
20148 # float blue = [protocolor blue];
20149 # FloatValue* alpha_wrapper = [protocolor alpha];
20150 # float alpha = 1.0;
20151 # if (alpha_wrapper != nil) {
20152 # alpha = [alpha_wrapper value];
20153 # }
20154 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
20155 # }
20156 #
20157 # static Color* toProto(UIColor* color) {
20158 # CGFloat red, green, blue, alpha;
20159 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
20160 # return nil;
20161 # }
20162 # Color* result = [Color alloc] init];
20163 # [result setRed:red];
20164 # [result setGreen:green];
20165 # [result setBlue:blue];
20166 # if (alpha <= 0.9999) {
20167 # [result setAlpha:floatWrapperWithValue(alpha)];
20168 # }
20169 # [result autorelease];
20170 # return result;
20171 # }
20172 # // ...
20173 #
20174 # Example (JavaScript):
20175 #
20176 # // ...
20177 #
20178 # var protoToCssColor = function(rgb_color) {
20179 # var redFrac = rgb_color.red || 0.0;
20180 # var greenFrac = rgb_color.green || 0.0;
20181 # var blueFrac = rgb_color.blue || 0.0;
20182 # var red = Math.floor(redFrac * 255);
20183 # var green = Math.floor(greenFrac * 255);
20184 # var blue = Math.floor(blueFrac * 255);
20185 #
20186 # if (!('alpha' in rgb_color)) {
20187 # return rgbToCssColor_(red, green, blue);
20188 # }
20189 #
20190 # var alphaFrac = rgb_color.alpha.value || 0.0;
20191 # var rgbParams = [red, green, blue].join(',');
20192 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
20193 # };
20194 #
20195 # var rgbToCssColor_ = function(red, green, blue) {
20196 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
20197 # var hexString = rgbNumber.toString(16);
20198 # var missingZeros = 6 - hexString.length;
20199 # var resultBuilder = ['#'];
20200 # for (var i = 0; i < missingZeros; i++) {
20201 # resultBuilder.push('0');
20202 # }
20203 # resultBuilder.push(hexString);
20204 # return resultBuilder.join('');
20205 # };
20206 #
20207 # // ...
20208 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
20209 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
20210 # the final pixel color is defined by the equation:
20211 #
20212 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
20213 #
20214 # This means that a value of 1.0 corresponds to a solid color, whereas
20215 # a value of 0.0 corresponds to a completely transparent color. This
20216 # uses a wrapper message rather than a simple float scalar so that it is
20217 # possible to distinguish between a default value and the value being unset.
20218 # If omitted, this color object is to be rendered as a solid color
20219 # (as if the alpha value had been explicitly given with a value of 1.0).
20220 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
20221 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
20222 },
20223 "width": 42, # The width of the border, in pixels.
20224 # Border widths must be between 0 and 3 pixels.
20225 "style": "A String", # The style of the border.
20226 },
20227 },
20228 "wrapStrategy": "A String", # The wrap strategy for the value in the cell.
20229 },
20230 },
20231 "gradientRule": { # A rule that applies a gradient color scale format, based on # The formatting will vary based on the gradients in the rule.
20232 # the interpolation points listed. The format of a cell will vary
20233 # based on its contents as compared to the values of the interpolation
20234 # points.
20235 "maxpoint": { # A single interpolation point a gradient conditional format. # The final interpolation point.
20236 # These pin the gradient color scale according to the color,
20237 # type and value chosen.
20238 "color": { # Represents a color in the RGBA color space. This representation is designed # The color this interpolation point should use.
20239 # for simplicity of conversion to/from color representations in various
20240 # languages over compactness; for example, the fields of this representation
20241 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
20242 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
20243 # method in iOS; and, with just a little work, it can be easily formatted into
20244 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
20245 #
20246 # Example (Java):
20247 #
20248 # import com.google.type.Color;
20249 #
20250 # // ...
20251 # public static java.awt.Color fromProto(Color protocolor) {
20252 # float alpha = protocolor.hasAlpha()
20253 # ? protocolor.getAlpha().getValue()
20254 # : 1.0;
20255 #
20256 # return new java.awt.Color(
20257 # protocolor.getRed(),
20258 # protocolor.getGreen(),
20259 # protocolor.getBlue(),
20260 # alpha);
20261 # }
20262 #
20263 # public static Color toProto(java.awt.Color color) {
20264 # float red = (float) color.getRed();
20265 # float green = (float) color.getGreen();
20266 # float blue = (float) color.getBlue();
20267 # float denominator = 255.0;
20268 # Color.Builder resultBuilder =
20269 # Color
20270 # .newBuilder()
20271 # .setRed(red / denominator)
20272 # .setGreen(green / denominator)
20273 # .setBlue(blue / denominator);
20274 # int alpha = color.getAlpha();
20275 # if (alpha != 255) {
20276 # result.setAlpha(
20277 # FloatValue
20278 # .newBuilder()
20279 # .setValue(((float) alpha) / denominator)
20280 # .build());
20281 # }
20282 # return resultBuilder.build();
20283 # }
20284 # // ...
20285 #
20286 # Example (iOS / Obj-C):
20287 #
20288 # // ...
20289 # static UIColor* fromProto(Color* protocolor) {
20290 # float red = [protocolor red];
20291 # float green = [protocolor green];
20292 # float blue = [protocolor blue];
20293 # FloatValue* alpha_wrapper = [protocolor alpha];
20294 # float alpha = 1.0;
20295 # if (alpha_wrapper != nil) {
20296 # alpha = [alpha_wrapper value];
20297 # }
20298 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
20299 # }
20300 #
20301 # static Color* toProto(UIColor* color) {
20302 # CGFloat red, green, blue, alpha;
20303 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
20304 # return nil;
20305 # }
20306 # Color* result = [Color alloc] init];
20307 # [result setRed:red];
20308 # [result setGreen:green];
20309 # [result setBlue:blue];
20310 # if (alpha <= 0.9999) {
20311 # [result setAlpha:floatWrapperWithValue(alpha)];
20312 # }
20313 # [result autorelease];
20314 # return result;
20315 # }
20316 # // ...
20317 #
20318 # Example (JavaScript):
20319 #
20320 # // ...
20321 #
20322 # var protoToCssColor = function(rgb_color) {
20323 # var redFrac = rgb_color.red || 0.0;
20324 # var greenFrac = rgb_color.green || 0.0;
20325 # var blueFrac = rgb_color.blue || 0.0;
20326 # var red = Math.floor(redFrac * 255);
20327 # var green = Math.floor(greenFrac * 255);
20328 # var blue = Math.floor(blueFrac * 255);
20329 #
20330 # if (!('alpha' in rgb_color)) {
20331 # return rgbToCssColor_(red, green, blue);
20332 # }
20333 #
20334 # var alphaFrac = rgb_color.alpha.value || 0.0;
20335 # var rgbParams = [red, green, blue].join(',');
20336 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
20337 # };
20338 #
20339 # var rgbToCssColor_ = function(red, green, blue) {
20340 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
20341 # var hexString = rgbNumber.toString(16);
20342 # var missingZeros = 6 - hexString.length;
20343 # var resultBuilder = ['#'];
20344 # for (var i = 0; i < missingZeros; i++) {
20345 # resultBuilder.push('0');
20346 # }
20347 # resultBuilder.push(hexString);
20348 # return resultBuilder.join('');
20349 # };
20350 #
20351 # // ...
20352 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
20353 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
20354 # the final pixel color is defined by the equation:
20355 #
20356 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
20357 #
20358 # This means that a value of 1.0 corresponds to a solid color, whereas
20359 # a value of 0.0 corresponds to a completely transparent color. This
20360 # uses a wrapper message rather than a simple float scalar so that it is
20361 # possible to distinguish between a default value and the value being unset.
20362 # If omitted, this color object is to be rendered as a solid color
20363 # (as if the alpha value had been explicitly given with a value of 1.0).
20364 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
20365 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
20366 },
20367 "type": "A String", # How the value should be interpreted.
20368 "value": "A String", # The value this interpolation point uses. May be a formula.
20369 # Unused if type is MIN or
20370 # MAX.
20371 },
20372 "midpoint": { # A single interpolation point a gradient conditional format. # An optional midway interpolation point.
20373 # These pin the gradient color scale according to the color,
20374 # type and value chosen.
20375 "color": { # Represents a color in the RGBA color space. This representation is designed # The color this interpolation point should use.
20376 # for simplicity of conversion to/from color representations in various
20377 # languages over compactness; for example, the fields of this representation
20378 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
20379 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
20380 # method in iOS; and, with just a little work, it can be easily formatted into
20381 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
20382 #
20383 # Example (Java):
20384 #
20385 # import com.google.type.Color;
20386 #
20387 # // ...
20388 # public static java.awt.Color fromProto(Color protocolor) {
20389 # float alpha = protocolor.hasAlpha()
20390 # ? protocolor.getAlpha().getValue()
20391 # : 1.0;
20392 #
20393 # return new java.awt.Color(
20394 # protocolor.getRed(),
20395 # protocolor.getGreen(),
20396 # protocolor.getBlue(),
20397 # alpha);
20398 # }
20399 #
20400 # public static Color toProto(java.awt.Color color) {
20401 # float red = (float) color.getRed();
20402 # float green = (float) color.getGreen();
20403 # float blue = (float) color.getBlue();
20404 # float denominator = 255.0;
20405 # Color.Builder resultBuilder =
20406 # Color
20407 # .newBuilder()
20408 # .setRed(red / denominator)
20409 # .setGreen(green / denominator)
20410 # .setBlue(blue / denominator);
20411 # int alpha = color.getAlpha();
20412 # if (alpha != 255) {
20413 # result.setAlpha(
20414 # FloatValue
20415 # .newBuilder()
20416 # .setValue(((float) alpha) / denominator)
20417 # .build());
20418 # }
20419 # return resultBuilder.build();
20420 # }
20421 # // ...
20422 #
20423 # Example (iOS / Obj-C):
20424 #
20425 # // ...
20426 # static UIColor* fromProto(Color* protocolor) {
20427 # float red = [protocolor red];
20428 # float green = [protocolor green];
20429 # float blue = [protocolor blue];
20430 # FloatValue* alpha_wrapper = [protocolor alpha];
20431 # float alpha = 1.0;
20432 # if (alpha_wrapper != nil) {
20433 # alpha = [alpha_wrapper value];
20434 # }
20435 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
20436 # }
20437 #
20438 # static Color* toProto(UIColor* color) {
20439 # CGFloat red, green, blue, alpha;
20440 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
20441 # return nil;
20442 # }
20443 # Color* result = [Color alloc] init];
20444 # [result setRed:red];
20445 # [result setGreen:green];
20446 # [result setBlue:blue];
20447 # if (alpha <= 0.9999) {
20448 # [result setAlpha:floatWrapperWithValue(alpha)];
20449 # }
20450 # [result autorelease];
20451 # return result;
20452 # }
20453 # // ...
20454 #
20455 # Example (JavaScript):
20456 #
20457 # // ...
20458 #
20459 # var protoToCssColor = function(rgb_color) {
20460 # var redFrac = rgb_color.red || 0.0;
20461 # var greenFrac = rgb_color.green || 0.0;
20462 # var blueFrac = rgb_color.blue || 0.0;
20463 # var red = Math.floor(redFrac * 255);
20464 # var green = Math.floor(greenFrac * 255);
20465 # var blue = Math.floor(blueFrac * 255);
20466 #
20467 # if (!('alpha' in rgb_color)) {
20468 # return rgbToCssColor_(red, green, blue);
20469 # }
20470 #
20471 # var alphaFrac = rgb_color.alpha.value || 0.0;
20472 # var rgbParams = [red, green, blue].join(',');
20473 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
20474 # };
20475 #
20476 # var rgbToCssColor_ = function(red, green, blue) {
20477 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
20478 # var hexString = rgbNumber.toString(16);
20479 # var missingZeros = 6 - hexString.length;
20480 # var resultBuilder = ['#'];
20481 # for (var i = 0; i < missingZeros; i++) {
20482 # resultBuilder.push('0');
20483 # }
20484 # resultBuilder.push(hexString);
20485 # return resultBuilder.join('');
20486 # };
20487 #
20488 # // ...
20489 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
20490 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
20491 # the final pixel color is defined by the equation:
20492 #
20493 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
20494 #
20495 # This means that a value of 1.0 corresponds to a solid color, whereas
20496 # a value of 0.0 corresponds to a completely transparent color. This
20497 # uses a wrapper message rather than a simple float scalar so that it is
20498 # possible to distinguish between a default value and the value being unset.
20499 # If omitted, this color object is to be rendered as a solid color
20500 # (as if the alpha value had been explicitly given with a value of 1.0).
20501 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
20502 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
20503 },
20504 "type": "A String", # How the value should be interpreted.
20505 "value": "A String", # The value this interpolation point uses. May be a formula.
20506 # Unused if type is MIN or
20507 # MAX.
20508 },
20509 "minpoint": { # A single interpolation point a gradient conditional format. # The starting interpolation point.
20510 # These pin the gradient color scale according to the color,
20511 # type and value chosen.
20512 "color": { # Represents a color in the RGBA color space. This representation is designed # The color this interpolation point should use.
20513 # for simplicity of conversion to/from color representations in various
20514 # languages over compactness; for example, the fields of this representation
20515 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
20516 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
20517 # method in iOS; and, with just a little work, it can be easily formatted into
20518 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
20519 #
20520 # Example (Java):
20521 #
20522 # import com.google.type.Color;
20523 #
20524 # // ...
20525 # public static java.awt.Color fromProto(Color protocolor) {
20526 # float alpha = protocolor.hasAlpha()
20527 # ? protocolor.getAlpha().getValue()
20528 # : 1.0;
20529 #
20530 # return new java.awt.Color(
20531 # protocolor.getRed(),
20532 # protocolor.getGreen(),
20533 # protocolor.getBlue(),
20534 # alpha);
20535 # }
20536 #
20537 # public static Color toProto(java.awt.Color color) {
20538 # float red = (float) color.getRed();
20539 # float green = (float) color.getGreen();
20540 # float blue = (float) color.getBlue();
20541 # float denominator = 255.0;
20542 # Color.Builder resultBuilder =
20543 # Color
20544 # .newBuilder()
20545 # .setRed(red / denominator)
20546 # .setGreen(green / denominator)
20547 # .setBlue(blue / denominator);
20548 # int alpha = color.getAlpha();
20549 # if (alpha != 255) {
20550 # result.setAlpha(
20551 # FloatValue
20552 # .newBuilder()
20553 # .setValue(((float) alpha) / denominator)
20554 # .build());
20555 # }
20556 # return resultBuilder.build();
20557 # }
20558 # // ...
20559 #
20560 # Example (iOS / Obj-C):
20561 #
20562 # // ...
20563 # static UIColor* fromProto(Color* protocolor) {
20564 # float red = [protocolor red];
20565 # float green = [protocolor green];
20566 # float blue = [protocolor blue];
20567 # FloatValue* alpha_wrapper = [protocolor alpha];
20568 # float alpha = 1.0;
20569 # if (alpha_wrapper != nil) {
20570 # alpha = [alpha_wrapper value];
20571 # }
20572 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
20573 # }
20574 #
20575 # static Color* toProto(UIColor* color) {
20576 # CGFloat red, green, blue, alpha;
20577 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
20578 # return nil;
20579 # }
20580 # Color* result = [Color alloc] init];
20581 # [result setRed:red];
20582 # [result setGreen:green];
20583 # [result setBlue:blue];
20584 # if (alpha <= 0.9999) {
20585 # [result setAlpha:floatWrapperWithValue(alpha)];
20586 # }
20587 # [result autorelease];
20588 # return result;
20589 # }
20590 # // ...
20591 #
20592 # Example (JavaScript):
20593 #
20594 # // ...
20595 #
20596 # var protoToCssColor = function(rgb_color) {
20597 # var redFrac = rgb_color.red || 0.0;
20598 # var greenFrac = rgb_color.green || 0.0;
20599 # var blueFrac = rgb_color.blue || 0.0;
20600 # var red = Math.floor(redFrac * 255);
20601 # var green = Math.floor(greenFrac * 255);
20602 # var blue = Math.floor(blueFrac * 255);
20603 #
20604 # if (!('alpha' in rgb_color)) {
20605 # return rgbToCssColor_(red, green, blue);
20606 # }
20607 #
20608 # var alphaFrac = rgb_color.alpha.value || 0.0;
20609 # var rgbParams = [red, green, blue].join(',');
20610 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
20611 # };
20612 #
20613 # var rgbToCssColor_ = function(red, green, blue) {
20614 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
20615 # var hexString = rgbNumber.toString(16);
20616 # var missingZeros = 6 - hexString.length;
20617 # var resultBuilder = ['#'];
20618 # for (var i = 0; i < missingZeros; i++) {
20619 # resultBuilder.push('0');
20620 # }
20621 # resultBuilder.push(hexString);
20622 # return resultBuilder.join('');
20623 # };
20624 #
20625 # // ...
20626 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
20627 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
20628 # the final pixel color is defined by the equation:
20629 #
20630 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
20631 #
20632 # This means that a value of 1.0 corresponds to a solid color, whereas
20633 # a value of 0.0 corresponds to a completely transparent color. This
20634 # uses a wrapper message rather than a simple float scalar so that it is
20635 # possible to distinguish between a default value and the value being unset.
20636 # If omitted, this color object is to be rendered as a solid color
20637 # (as if the alpha value had been explicitly given with a value of 1.0).
20638 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
20639 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
20640 },
20641 "type": "A String", # How the value should be interpreted.
20642 "value": "A String", # The value this interpolation point uses. May be a formula.
20643 # Unused if type is MIN or
20644 # MAX.
20645 },
20646 },
20647 },
20648 ],
20649 "merges": [ # The ranges that are merged together.
20650 { # A range on a sheet.
20651 # All indexes are zero-based.
20652 # Indexes are half open, e.g the start index is inclusive
20653 # and the end index is exclusive -- [start_index, end_index).
20654 # Missing indexes indicate the range is unbounded on that side.
20655 #
20656 # For example, if "Sheet1" is grid ID 0, then:
20657 #
20658 # Sheet1!A1:A1 == sheet_id: 0,
20659 # start_row_index: 0, end_row_index: 1,
20660 # start_column_index: 0, end_column_index: 1
20661 #
20662 # Sheet1!A3:B4 == sheet_id: 0,
20663 # start_row_index: 2, end_row_index: 4,
20664 # start_column_index: 0, end_column_index: 2
20665 #
20666 # Sheet1!A:B == sheet_id: 0,
20667 # start_column_index: 0, end_column_index: 2
20668 #
20669 # Sheet1!A5:B == sheet_id: 0,
20670 # start_row_index: 4,
20671 # start_column_index: 0, end_column_index: 2
20672 #
20673 # Sheet1 == sheet_id:0
20674 #
20675 # The start index must always be less than or equal to the end index.
20676 # If the start index equals the end index, then the range is empty.
20677 # Empty ranges are typically not meaningful and are usually rendered in the
20678 # UI as `#REF!`.
20679 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
20680 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
20681 "sheetId": 42, # The sheet this range is on.
20682 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
20683 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
20684 },
20685 ],
20686 "basicFilter": { # The default filter associated with a sheet. # The filter on this sheet, if any.
20687 "range": { # A range on a sheet. # The range the filter covers.
20688 # All indexes are zero-based.
20689 # Indexes are half open, e.g the start index is inclusive
20690 # and the end index is exclusive -- [start_index, end_index).
20691 # Missing indexes indicate the range is unbounded on that side.
20692 #
20693 # For example, if "Sheet1" is grid ID 0, then:
20694 #
20695 # Sheet1!A1:A1 == sheet_id: 0,
20696 # start_row_index: 0, end_row_index: 1,
20697 # start_column_index: 0, end_column_index: 1
20698 #
20699 # Sheet1!A3:B4 == sheet_id: 0,
20700 # start_row_index: 2, end_row_index: 4,
20701 # start_column_index: 0, end_column_index: 2
20702 #
20703 # Sheet1!A:B == sheet_id: 0,
20704 # start_column_index: 0, end_column_index: 2
20705 #
20706 # Sheet1!A5:B == sheet_id: 0,
20707 # start_row_index: 4,
20708 # start_column_index: 0, end_column_index: 2
20709 #
20710 # Sheet1 == sheet_id:0
20711 #
20712 # The start index must always be less than or equal to the end index.
20713 # If the start index equals the end index, then the range is empty.
20714 # Empty ranges are typically not meaningful and are usually rendered in the
20715 # UI as `#REF!`.
20716 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
20717 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
20718 "sheetId": 42, # The sheet this range is on.
20719 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
20720 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
20721 },
20722 "sortSpecs": [ # The sort order per column. Later specifications are used when values
20723 # are equal in the earlier specifications.
20724 { # A sort order associated with a specific column or row.
20725 "sortOrder": "A String", # The order data should be sorted.
20726 "dimensionIndex": 42, # The dimension the sort should be applied to.
20727 },
20728 ],
20729 "criteria": { # The criteria for showing/hiding values per column.
20730 # The map's key is the column index, and the value is the criteria for
20731 # that column.
20732 "a_key": { # Criteria for showing/hiding rows in a filter, filter view.
20733 "hiddenValues": [ # Values that should be hidden.
20734 "A String",
20735 ],
20736 "condition": { # A condition that can evaluate to true or false. # A condition that must be true for values to be shown.
20737 # (This does not override hiddenValues -- if a value is listed there,
20738 # it will still be hidden.)
20739 # BooleanConditions are used by conditional formatting,
20740 # data validation, and the criteria in filters.
20741 "type": "A String", # The type of condition.
20742 "values": [ # The values of the condition. The number of supported values depends
20743 # on the condition type. Some support zero values,
20744 # others one or two values,
20745 # and ConditionType.ONE_OF_LIST supports an arbitrary number of values.
20746 { # The value of the condition.
20747 "relativeDate": "A String", # A relative date (based on the current date).
20748 # Valid only if the type is
20749 # DATE_BEFORE,
20750 # DATE_AFTER,
20751 # DATE_ON_OR_BEFORE or
20752 # DATE_ON_OR_AFTER.
20753 #
20754 # Relative dates are not supported in data validation.
20755 # They are supported only in conditional formatting and
20756 # conditional filters.
20757 "userEnteredValue": "A String", # A value the condition is based on.
20758 # The value will be parsed as if the user typed into a cell.
20759 # Formulas are supported (and must begin with an `=`).
20760 },
20761 ],
20762 },
20763 },
20764 },
20765 },
20766 "charts": [ # The specifications of every chart on this sheet.
20767 { # A chart embedded in a sheet.
20768 "chartId": 42, # The ID of the chart.
20769 "position": { # The position of an embedded object such as a chart. # The position of the chart.
20770 "newSheet": True or False, # If true, the embedded object will be put on a new sheet whose ID
20771 # is chosen for you. Used only when writing.
20772 "sheetId": 42, # The sheet this is on. Set only if the embedded object
20773 # is on its own sheet. Must be non-negative.
20774 "overlayPosition": { # The location an object is overlaid on top of a grid. # The position the object is overlaid on top of a grid.
20775 "anchorCell": { # A coordinate in a sheet. # The cell the object is anchored to.
20776 # All indexes are zero-based.
20777 "rowIndex": 42, # The row index of the coordinate.
20778 "columnIndex": 42, # The column index of the coordinate.
20779 "sheetId": 42, # The sheet this coordinate is on.
20780 },
20781 "offsetYPixels": 42, # The vertical offset, in pixels, that the object is offset
20782 # from the anchor cell.
20783 "widthPixels": 42, # The width of the object, in pixels. Defaults to 600.
20784 "offsetXPixels": 42, # The horizontal offset, in pixels, that the object is offset
20785 # from the anchor cell.
20786 "heightPixels": 42, # The height of the object, in pixels. Defaults to 371.
20787 },
20788 },
20789 "spec": { # The specifications of a chart. # The specification of the chart.
20790 "hiddenDimensionStrategy": "A String", # Determines how the charts will use hidden rows or columns.
20791 # This value is only meaningful if the
20792 # ChartData.sourceRange
20793 # is used for a domain or series.
20794 "pieChart": { # A <a href="/chart/interactive/docs/gallery/piechart">pie chart</a>. # A pie chart specification.
20795 "series": { # The data included in a domain or series. # The data that covers the one and only series of the pie chart.
20796 "sourceRange": { # Source ranges for a chart. # The source ranges of the data.
20797 "sources": [ # The ranges of data for a series or domain.
20798 # Exactly one dimension must have a length of 1,
20799 # and all sources in the list must have the same dimension
20800 # with length 1.
20801 # The domain (if it exists) & all series must have the same number
20802 # of source ranges. If using more than one source range, then the source
20803 # range at a given offset must be contiguous across the domain and series.
20804 #
20805 # For example, these are valid configurations:
20806 #
20807 # domain sources: A1:A5
20808 # series1 sources: B1:B5
20809 # series2 sources: D6:D10
20810 #
20811 # domain sources: A1:A5, C10:C12
20812 # series1 sources: B1:B5, D10:D12
20813 # series2 sources: C1:C5, E10:E12
20814 { # A range on a sheet.
20815 # All indexes are zero-based.
20816 # Indexes are half open, e.g the start index is inclusive
20817 # and the end index is exclusive -- [start_index, end_index).
20818 # Missing indexes indicate the range is unbounded on that side.
20819 #
20820 # For example, if "Sheet1" is grid ID 0, then:
20821 #
20822 # Sheet1!A1:A1 == sheet_id: 0,
20823 # start_row_index: 0, end_row_index: 1,
20824 # start_column_index: 0, end_column_index: 1
20825 #
20826 # Sheet1!A3:B4 == sheet_id: 0,
20827 # start_row_index: 2, end_row_index: 4,
20828 # start_column_index: 0, end_column_index: 2
20829 #
20830 # Sheet1!A:B == sheet_id: 0,
20831 # start_column_index: 0, end_column_index: 2
20832 #
20833 # Sheet1!A5:B == sheet_id: 0,
20834 # start_row_index: 4,
20835 # start_column_index: 0, end_column_index: 2
20836 #
20837 # Sheet1 == sheet_id:0
20838 #
20839 # The start index must always be less than or equal to the end index.
20840 # If the start index equals the end index, then the range is empty.
20841 # Empty ranges are typically not meaningful and are usually rendered in the
20842 # UI as `#REF!`.
20843 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
20844 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
20845 "sheetId": 42, # The sheet this range is on.
20846 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
20847 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
20848 },
20849 ],
20850 },
20851 },
20852 "domain": { # The data included in a domain or series. # The data that covers the domain of the pie chart.
20853 "sourceRange": { # Source ranges for a chart. # The source ranges of the data.
20854 "sources": [ # The ranges of data for a series or domain.
20855 # Exactly one dimension must have a length of 1,
20856 # and all sources in the list must have the same dimension
20857 # with length 1.
20858 # The domain (if it exists) & all series must have the same number
20859 # of source ranges. If using more than one source range, then the source
20860 # range at a given offset must be contiguous across the domain and series.
20861 #
20862 # For example, these are valid configurations:
20863 #
20864 # domain sources: A1:A5
20865 # series1 sources: B1:B5
20866 # series2 sources: D6:D10
20867 #
20868 # domain sources: A1:A5, C10:C12
20869 # series1 sources: B1:B5, D10:D12
20870 # series2 sources: C1:C5, E10:E12
20871 { # A range on a sheet.
20872 # All indexes are zero-based.
20873 # Indexes are half open, e.g the start index is inclusive
20874 # and the end index is exclusive -- [start_index, end_index).
20875 # Missing indexes indicate the range is unbounded on that side.
20876 #
20877 # For example, if "Sheet1" is grid ID 0, then:
20878 #
20879 # Sheet1!A1:A1 == sheet_id: 0,
20880 # start_row_index: 0, end_row_index: 1,
20881 # start_column_index: 0, end_column_index: 1
20882 #
20883 # Sheet1!A3:B4 == sheet_id: 0,
20884 # start_row_index: 2, end_row_index: 4,
20885 # start_column_index: 0, end_column_index: 2
20886 #
20887 # Sheet1!A:B == sheet_id: 0,
20888 # start_column_index: 0, end_column_index: 2
20889 #
20890 # Sheet1!A5:B == sheet_id: 0,
20891 # start_row_index: 4,
20892 # start_column_index: 0, end_column_index: 2
20893 #
20894 # Sheet1 == sheet_id:0
20895 #
20896 # The start index must always be less than or equal to the end index.
20897 # If the start index equals the end index, then the range is empty.
20898 # Empty ranges are typically not meaningful and are usually rendered in the
20899 # UI as `#REF!`.
20900 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
20901 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
20902 "sheetId": 42, # The sheet this range is on.
20903 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
20904 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
20905 },
20906 ],
20907 },
20908 },
20909 "threeDimensional": True or False, # True if the pie is three dimensional.
20910 "legendPosition": "A String", # Where the legend of the pie chart should be drawn.
20911 "pieHole": 3.14, # The size of the hole in the pie chart.
20912 },
20913 "basicChart": { # The specification for a basic chart. See BasicChartType for the list # A basic chart specification, can be one of many kinds of charts.
20914 # See BasicChartType for the list of all charts this supports.
20915 # of charts this supports.
20916 "headerCount": 42, # The number of rows or columns in the data that are "headers".
20917 # If not set, Google Sheets will guess how many rows are headers based
20918 # on the data.
20919 #
20920 # (Note that BasicChartAxis.title may override the axis title
20921 # inferred from the header values.)
20922 "series": [ # The data this chart is visualizing.
20923 { # A single series of data in a chart.
20924 # For example, if charting stock prices over time, multiple series may exist,
20925 # one for the "Open Price", "High Price", "Low Price" and "Close Price".
20926 "series": { # The data included in a domain or series. # The data being visualized in this chart series.
20927 "sourceRange": { # Source ranges for a chart. # The source ranges of the data.
20928 "sources": [ # The ranges of data for a series or domain.
20929 # Exactly one dimension must have a length of 1,
20930 # and all sources in the list must have the same dimension
20931 # with length 1.
20932 # The domain (if it exists) & all series must have the same number
20933 # of source ranges. If using more than one source range, then the source
20934 # range at a given offset must be contiguous across the domain and series.
20935 #
20936 # For example, these are valid configurations:
20937 #
20938 # domain sources: A1:A5
20939 # series1 sources: B1:B5
20940 # series2 sources: D6:D10
20941 #
20942 # domain sources: A1:A5, C10:C12
20943 # series1 sources: B1:B5, D10:D12
20944 # series2 sources: C1:C5, E10:E12
20945 { # A range on a sheet.
20946 # All indexes are zero-based.
20947 # Indexes are half open, e.g the start index is inclusive
20948 # and the end index is exclusive -- [start_index, end_index).
20949 # Missing indexes indicate the range is unbounded on that side.
20950 #
20951 # For example, if "Sheet1" is grid ID 0, then:
20952 #
20953 # Sheet1!A1:A1 == sheet_id: 0,
20954 # start_row_index: 0, end_row_index: 1,
20955 # start_column_index: 0, end_column_index: 1
20956 #
20957 # Sheet1!A3:B4 == sheet_id: 0,
20958 # start_row_index: 2, end_row_index: 4,
20959 # start_column_index: 0, end_column_index: 2
20960 #
20961 # Sheet1!A:B == sheet_id: 0,
20962 # start_column_index: 0, end_column_index: 2
20963 #
20964 # Sheet1!A5:B == sheet_id: 0,
20965 # start_row_index: 4,
20966 # start_column_index: 0, end_column_index: 2
20967 #
20968 # Sheet1 == sheet_id:0
20969 #
20970 # The start index must always be less than or equal to the end index.
20971 # If the start index equals the end index, then the range is empty.
20972 # Empty ranges are typically not meaningful and are usually rendered in the
20973 # UI as `#REF!`.
20974 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
20975 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
20976 "sheetId": 42, # The sheet this range is on.
20977 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
20978 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
20979 },
20980 ],
20981 },
20982 },
20983 "targetAxis": "A String", # The minor axis that will specify the range of values for this series.
20984 # For example, if charting stocks over time, the "Volume" series
20985 # may want to be pinned to the right with the prices pinned to the left,
20986 # because the scale of trading volume is different than the scale of
20987 # prices.
20988 # It is an error to specify an axis that isn't a valid minor axis
20989 # for the chart's type.
20990 "type": "A String", # The type of this series. Valid only if the
20991 # chartType is
20992 # COMBO.
20993 # Different types will change the way the series is visualized.
20994 # Only LINE, AREA,
20995 # and COLUMN are supported.
20996 },
20997 ],
20998 "legendPosition": "A String", # The position of the chart legend.
20999 "domains": [ # The domain of data this is charting.
21000 # Only a single domain is currently supported.
21001 { # The domain of a chart.
21002 # For example, if charting stock prices over time, this would be the date.
21003 "domain": { # The data included in a domain or series. # The data of the domain. For example, if charting stock prices over time,
21004 # this be the data representing the dates.
21005 "sourceRange": { # Source ranges for a chart. # The source ranges of the data.
21006 "sources": [ # The ranges of data for a series or domain.
21007 # Exactly one dimension must have a length of 1,
21008 # and all sources in the list must have the same dimension
21009 # with length 1.
21010 # The domain (if it exists) & all series must have the same number
21011 # of source ranges. If using more than one source range, then the source
21012 # range at a given offset must be contiguous across the domain and series.
21013 #
21014 # For example, these are valid configurations:
21015 #
21016 # domain sources: A1:A5
21017 # series1 sources: B1:B5
21018 # series2 sources: D6:D10
21019 #
21020 # domain sources: A1:A5, C10:C12
21021 # series1 sources: B1:B5, D10:D12
21022 # series2 sources: C1:C5, E10:E12
21023 { # A range on a sheet.
21024 # All indexes are zero-based.
21025 # Indexes are half open, e.g the start index is inclusive
21026 # and the end index is exclusive -- [start_index, end_index).
21027 # Missing indexes indicate the range is unbounded on that side.
21028 #
21029 # For example, if "Sheet1" is grid ID 0, then:
21030 #
21031 # Sheet1!A1:A1 == sheet_id: 0,
21032 # start_row_index: 0, end_row_index: 1,
21033 # start_column_index: 0, end_column_index: 1
21034 #
21035 # Sheet1!A3:B4 == sheet_id: 0,
21036 # start_row_index: 2, end_row_index: 4,
21037 # start_column_index: 0, end_column_index: 2
21038 #
21039 # Sheet1!A:B == sheet_id: 0,
21040 # start_column_index: 0, end_column_index: 2
21041 #
21042 # Sheet1!A5:B == sheet_id: 0,
21043 # start_row_index: 4,
21044 # start_column_index: 0, end_column_index: 2
21045 #
21046 # Sheet1 == sheet_id:0
21047 #
21048 # The start index must always be less than or equal to the end index.
21049 # If the start index equals the end index, then the range is empty.
21050 # Empty ranges are typically not meaningful and are usually rendered in the
21051 # UI as `#REF!`.
21052 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
21053 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
21054 "sheetId": 42, # The sheet this range is on.
21055 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
21056 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
21057 },
21058 ],
21059 },
21060 },
21061 },
21062 ],
21063 "chartType": "A String", # The type of the chart.
21064 "axis": [ # The axis on the chart.
21065 { # An axis of the chart.
21066 # A chart may not have more than one axis per
21067 # axis position.
21068 "position": "A String", # The position of this axis.
21069 "format": { # The format of a run of text in a cell. # The format of the title.
21070 # Only valid if the axis is not associated with the domain.
21071 # Absent values indicate that the field isn't specified.
21072 "foregroundColor": { # Represents a color in the RGBA color space. This representation is designed # The foreground color of the text.
21073 # for simplicity of conversion to/from color representations in various
21074 # languages over compactness; for example, the fields of this representation
21075 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
21076 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
21077 # method in iOS; and, with just a little work, it can be easily formatted into
21078 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
21079 #
21080 # Example (Java):
21081 #
21082 # import com.google.type.Color;
21083 #
21084 # // ...
21085 # public static java.awt.Color fromProto(Color protocolor) {
21086 # float alpha = protocolor.hasAlpha()
21087 # ? protocolor.getAlpha().getValue()
21088 # : 1.0;
21089 #
21090 # return new java.awt.Color(
21091 # protocolor.getRed(),
21092 # protocolor.getGreen(),
21093 # protocolor.getBlue(),
21094 # alpha);
21095 # }
21096 #
21097 # public static Color toProto(java.awt.Color color) {
21098 # float red = (float) color.getRed();
21099 # float green = (float) color.getGreen();
21100 # float blue = (float) color.getBlue();
21101 # float denominator = 255.0;
21102 # Color.Builder resultBuilder =
21103 # Color
21104 # .newBuilder()
21105 # .setRed(red / denominator)
21106 # .setGreen(green / denominator)
21107 # .setBlue(blue / denominator);
21108 # int alpha = color.getAlpha();
21109 # if (alpha != 255) {
21110 # result.setAlpha(
21111 # FloatValue
21112 # .newBuilder()
21113 # .setValue(((float) alpha) / denominator)
21114 # .build());
21115 # }
21116 # return resultBuilder.build();
21117 # }
21118 # // ...
21119 #
21120 # Example (iOS / Obj-C):
21121 #
21122 # // ...
21123 # static UIColor* fromProto(Color* protocolor) {
21124 # float red = [protocolor red];
21125 # float green = [protocolor green];
21126 # float blue = [protocolor blue];
21127 # FloatValue* alpha_wrapper = [protocolor alpha];
21128 # float alpha = 1.0;
21129 # if (alpha_wrapper != nil) {
21130 # alpha = [alpha_wrapper value];
21131 # }
21132 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
21133 # }
21134 #
21135 # static Color* toProto(UIColor* color) {
21136 # CGFloat red, green, blue, alpha;
21137 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
21138 # return nil;
21139 # }
21140 # Color* result = [Color alloc] init];
21141 # [result setRed:red];
21142 # [result setGreen:green];
21143 # [result setBlue:blue];
21144 # if (alpha <= 0.9999) {
21145 # [result setAlpha:floatWrapperWithValue(alpha)];
21146 # }
21147 # [result autorelease];
21148 # return result;
21149 # }
21150 # // ...
21151 #
21152 # Example (JavaScript):
21153 #
21154 # // ...
21155 #
21156 # var protoToCssColor = function(rgb_color) {
21157 # var redFrac = rgb_color.red || 0.0;
21158 # var greenFrac = rgb_color.green || 0.0;
21159 # var blueFrac = rgb_color.blue || 0.0;
21160 # var red = Math.floor(redFrac * 255);
21161 # var green = Math.floor(greenFrac * 255);
21162 # var blue = Math.floor(blueFrac * 255);
21163 #
21164 # if (!('alpha' in rgb_color)) {
21165 # return rgbToCssColor_(red, green, blue);
21166 # }
21167 #
21168 # var alphaFrac = rgb_color.alpha.value || 0.0;
21169 # var rgbParams = [red, green, blue].join(',');
21170 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
21171 # };
21172 #
21173 # var rgbToCssColor_ = function(red, green, blue) {
21174 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
21175 # var hexString = rgbNumber.toString(16);
21176 # var missingZeros = 6 - hexString.length;
21177 # var resultBuilder = ['#'];
21178 # for (var i = 0; i < missingZeros; i++) {
21179 # resultBuilder.push('0');
21180 # }
21181 # resultBuilder.push(hexString);
21182 # return resultBuilder.join('');
21183 # };
21184 #
21185 # // ...
21186 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
21187 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
21188 # the final pixel color is defined by the equation:
21189 #
21190 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
21191 #
21192 # This means that a value of 1.0 corresponds to a solid color, whereas
21193 # a value of 0.0 corresponds to a completely transparent color. This
21194 # uses a wrapper message rather than a simple float scalar so that it is
21195 # possible to distinguish between a default value and the value being unset.
21196 # If omitted, this color object is to be rendered as a solid color
21197 # (as if the alpha value had been explicitly given with a value of 1.0).
21198 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
21199 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
21200 },
21201 "bold": True or False, # True if the text is bold.
21202 "strikethrough": True or False, # True if the text has a strikethrough.
21203 "fontFamily": "A String", # The font family.
21204 "fontSize": 42, # The size of the font.
21205 "italic": True or False, # True if the text is italicized.
21206 "underline": True or False, # True if the text is underlined.
21207 },
21208 "title": "A String", # The title of this axis. If set, this overrides any title inferred
21209 # from headers of the data.
21210 },
21211 ],
21212 },
21213 "title": "A String", # The title of the chart.
21214 },
21215 },
21216 ],
21217 "filterViews": [ # The filter views in this sheet.
21218 { # A filter view.
21219 "title": "A String", # The name of the filter view.
21220 "namedRangeId": "A String", # The named range this filter view is backed by, if any.
21221 #
21222 # When writing, only one of range or namedRangeId
21223 # may be set.
21224 "filterViewId": 42, # The ID of the filter view.
21225 "range": { # A range on a sheet. # The range this filter view covers.
21226 #
21227 # When writing, only one of range or namedRangeId
21228 # may be set.
21229 # All indexes are zero-based.
21230 # Indexes are half open, e.g the start index is inclusive
21231 # and the end index is exclusive -- [start_index, end_index).
21232 # Missing indexes indicate the range is unbounded on that side.
21233 #
21234 # For example, if "Sheet1" is grid ID 0, then:
21235 #
21236 # Sheet1!A1:A1 == sheet_id: 0,
21237 # start_row_index: 0, end_row_index: 1,
21238 # start_column_index: 0, end_column_index: 1
21239 #
21240 # Sheet1!A3:B4 == sheet_id: 0,
21241 # start_row_index: 2, end_row_index: 4,
21242 # start_column_index: 0, end_column_index: 2
21243 #
21244 # Sheet1!A:B == sheet_id: 0,
21245 # start_column_index: 0, end_column_index: 2
21246 #
21247 # Sheet1!A5:B == sheet_id: 0,
21248 # start_row_index: 4,
21249 # start_column_index: 0, end_column_index: 2
21250 #
21251 # Sheet1 == sheet_id:0
21252 #
21253 # The start index must always be less than or equal to the end index.
21254 # If the start index equals the end index, then the range is empty.
21255 # Empty ranges are typically not meaningful and are usually rendered in the
21256 # UI as `#REF!`.
21257 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
21258 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
21259 "sheetId": 42, # The sheet this range is on.
21260 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
21261 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
21262 },
21263 "sortSpecs": [ # The sort order per column. Later specifications are used when values
21264 # are equal in the earlier specifications.
21265 { # A sort order associated with a specific column or row.
21266 "sortOrder": "A String", # The order data should be sorted.
21267 "dimensionIndex": 42, # The dimension the sort should be applied to.
21268 },
21269 ],
21270 "criteria": { # The criteria for showing/hiding values per column.
21271 # The map's key is the column index, and the value is the criteria for
21272 # that column.
21273 "a_key": { # Criteria for showing/hiding rows in a filter, filter view.
21274 "hiddenValues": [ # Values that should be hidden.
21275 "A String",
21276 ],
21277 "condition": { # A condition that can evaluate to true or false. # A condition that must be true for values to be shown.
21278 # (This does not override hiddenValues -- if a value is listed there,
21279 # it will still be hidden.)
21280 # BooleanConditions are used by conditional formatting,
21281 # data validation, and the criteria in filters.
21282 "type": "A String", # The type of condition.
21283 "values": [ # The values of the condition. The number of supported values depends
21284 # on the condition type. Some support zero values,
21285 # others one or two values,
21286 # and ConditionType.ONE_OF_LIST supports an arbitrary number of values.
21287 { # The value of the condition.
21288 "relativeDate": "A String", # A relative date (based on the current date).
21289 # Valid only if the type is
21290 # DATE_BEFORE,
21291 # DATE_AFTER,
21292 # DATE_ON_OR_BEFORE or
21293 # DATE_ON_OR_AFTER.
21294 #
21295 # Relative dates are not supported in data validation.
21296 # They are supported only in conditional formatting and
21297 # conditional filters.
21298 "userEnteredValue": "A String", # A value the condition is based on.
21299 # The value will be parsed as if the user typed into a cell.
21300 # Formulas are supported (and must begin with an `=`).
21301 },
21302 ],
21303 },
21304 },
21305 },
21306 },
21307 ],
21308 "protectedRanges": [ # The protected ranges in this sheet.
21309 { # A protected range.
21310 "unprotectedRanges": [ # The list of unprotected ranges within a protected sheet.
21311 # Unprotected ranges are only supported on protected sheets.
21312 { # A range on a sheet.
21313 # All indexes are zero-based.
21314 # Indexes are half open, e.g the start index is inclusive
21315 # and the end index is exclusive -- [start_index, end_index).
21316 # Missing indexes indicate the range is unbounded on that side.
21317 #
21318 # For example, if "Sheet1" is grid ID 0, then:
21319 #
21320 # Sheet1!A1:A1 == sheet_id: 0,
21321 # start_row_index: 0, end_row_index: 1,
21322 # start_column_index: 0, end_column_index: 1
21323 #
21324 # Sheet1!A3:B4 == sheet_id: 0,
21325 # start_row_index: 2, end_row_index: 4,
21326 # start_column_index: 0, end_column_index: 2
21327 #
21328 # Sheet1!A:B == sheet_id: 0,
21329 # start_column_index: 0, end_column_index: 2
21330 #
21331 # Sheet1!A5:B == sheet_id: 0,
21332 # start_row_index: 4,
21333 # start_column_index: 0, end_column_index: 2
21334 #
21335 # Sheet1 == sheet_id:0
21336 #
21337 # The start index must always be less than or equal to the end index.
21338 # If the start index equals the end index, then the range is empty.
21339 # Empty ranges are typically not meaningful and are usually rendered in the
21340 # UI as `#REF!`.
21341 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
21342 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
21343 "sheetId": 42, # The sheet this range is on.
21344 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
21345 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
21346 },
21347 ],
21348 "requestingUserCanEdit": True or False, # True if the user who requested this protected range can edit the
21349 # protected area.
21350 # This field is read-only.
21351 "description": "A String", # The description of this protected range.
21352 "namedRangeId": "A String", # The named range this protected range is backed by, if any.
21353 #
21354 # When writing, only one of range or namedRangeId
21355 # may be set.
21356 "editors": { # The editors of a protected range. # The users and groups with edit access to the protected range.
21357 # This field is only visible to users with edit access to the protected
21358 # range and the document.
21359 # Editors are not supported with warningOnly protection.
21360 "domainUsersCanEdit": True or False, # True if anyone in the document's domain has edit access to the protected
21361 # range. Domain protection is only supported on documents within a domain.
21362 "users": [ # The email addresses of users with edit access to the protected range.
21363 "A String",
21364 ],
21365 "groups": [ # The email addresses of groups with edit access to the protected range.
21366 "A String",
21367 ],
21368 },
21369 "protectedRangeId": 42, # The ID of the protected range.
21370 # This field is read-only.
21371 "warningOnly": True or False, # True if this this protected range will show a warning when editing.
21372 # Warning-based protection means that every user can edit data in the
21373 # protected range, except editing will prompt a warning asking the user
21374 # to confirm the edit.
21375 #
21376 # When warning: if this field is true, then editors is ignored.
21377 # Additionally, if this field is changed from true to false and the
21378 # `editors` field is not set (nor included in the field mask), then
21379 # the editors will be set to all the editors in the document.
21380 "range": { # A range on a sheet. # The range that is being protected.
21381 # The range may be fully unbounded, in which case this is considered
21382 # a protected sheet.
21383 #
21384 # When writing, only one of range or namedRangeId
21385 # may be set.
21386 # All indexes are zero-based.
21387 # Indexes are half open, e.g the start index is inclusive
21388 # and the end index is exclusive -- [start_index, end_index).
21389 # Missing indexes indicate the range is unbounded on that side.
21390 #
21391 # For example, if "Sheet1" is grid ID 0, then:
21392 #
21393 # Sheet1!A1:A1 == sheet_id: 0,
21394 # start_row_index: 0, end_row_index: 1,
21395 # start_column_index: 0, end_column_index: 1
21396 #
21397 # Sheet1!A3:B4 == sheet_id: 0,
21398 # start_row_index: 2, end_row_index: 4,
21399 # start_column_index: 0, end_column_index: 2
21400 #
21401 # Sheet1!A:B == sheet_id: 0,
21402 # start_column_index: 0, end_column_index: 2
21403 #
21404 # Sheet1!A5:B == sheet_id: 0,
21405 # start_row_index: 4,
21406 # start_column_index: 0, end_column_index: 2
21407 #
21408 # Sheet1 == sheet_id:0
21409 #
21410 # The start index must always be less than or equal to the end index.
21411 # If the start index equals the end index, then the range is empty.
21412 # Empty ranges are typically not meaningful and are usually rendered in the
21413 # UI as `#REF!`.
21414 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
21415 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
21416 "sheetId": 42, # The sheet this range is on.
21417 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
21418 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
21419 },
21420 },
21421 ],
21422 "data": [ # Data in the grid, if this is a grid sheet.
21423 # The number of GridData objects returned is dependent on the number of
21424 # ranges requested on this sheet. For example, if this is representing
21425 # `Sheet1`, and the spreadsheet was requested with ranges
21426 # `Sheet1!A1:C10` and `Sheet1!D15:E20`, then the first GridData will have a
21427 # startRow/startColumn of `0`,
21428 # while the second one will have `startRow 14` (zero-based row 15),
21429 # and `startColumn 3` (zero-based column D).
21430 { # Data in the grid, as well as metadata about the dimensions.
21431 "startRow": 42, # The first row this GridData refers to, zero-based.
21432 "rowMetadata": [ # Metadata about the requested rows in the grid, starting with the row
21433 # in startRow.
21434 { # Properties about a dimension.
21435 "pixelSize": 42, # The height (if a row) or width (if a column) of the dimension in pixels.
21436 "hiddenByUser": True or False, # True if this dimension is explicitly hidden.
21437 "hiddenByFilter": True or False, # True if this dimension is being filtered.
21438 # This field is read-only.
21439 },
21440 ],
21441 "startColumn": 42, # The first column this GridData refers to, zero-based.
21442 "columnMetadata": [ # Metadata about the requested columns in the grid, starting with the column
21443 # in startColumn.
21444 { # Properties about a dimension.
21445 "pixelSize": 42, # The height (if a row) or width (if a column) of the dimension in pixels.
21446 "hiddenByUser": True or False, # True if this dimension is explicitly hidden.
21447 "hiddenByFilter": True or False, # True if this dimension is being filtered.
21448 # This field is read-only.
21449 },
21450 ],
21451 "rowData": [ # The data in the grid, one entry per row,
21452 # starting with the row in startRow.
21453 # The values in RowData will correspond to columns starting
21454 # at startColumn.
21455 { # Data about each cell in a row.
21456 "values": [ # The values in the row, one per column.
21457 { # Data about a specific cell.
21458 "pivotTable": { # A pivot table. # A pivot table anchored at this cell. The size of pivot table itself
21459 # is computed dynamically based on its data, grouping, filters, values,
21460 # etc... Only the top-left cell of the pivot table contains the pivot table
21461 # definition. The other cells will contain the calculated values of the
21462 # results of the pivot in their effectiveValue fields.
21463 "valueLayout": "A String", # Whether values should be listed horizontally (as columns)
21464 # or vertically (as rows).
21465 "rows": [ # Each row grouping in the pivot table.
21466 { # A single grouping (either row or column) in a pivot table.
21467 "showTotals": True or False, # True if the pivot table should include the totals for this grouping.
21468 "valueMetadata": [ # Metadata about values in the grouping.
21469 { # Metadata about a value in a pivot grouping.
21470 "collapsed": True or False, # True if the data corresponding to the value is collapsed.
21471 "value": { # The kinds of value that a cell in a spreadsheet can have. # The calculated value the metadata corresponds to.
21472 # (Note that formulaValue is not valid,
21473 # because the values will be calculated.)
21474 "numberValue": 3.14, # Represents a double value.
21475 # Note: Dates, Times and DateTimes are represented as doubles in
21476 # "serial number" format.
21477 "boolValue": True or False, # Represents a boolean value.
21478 "formulaValue": "A String", # Represents a formula.
21479 "stringValue": "A String", # Represents a string value.
21480 # Leading single quotes are not included. For example, if the user typed
21481 # `'123` into the UI, this would be represented as a `stringValue` of
21482 # `"123"`.
21483 "errorValue": { # An error in a cell. # Represents an error.
21484 # This field is read-only.
21485 "message": "A String", # A message with more information about the error
21486 # (in the spreadsheet's locale).
21487 "type": "A String", # The type of error.
21488 },
21489 },
21490 },
21491 ],
21492 "valueBucket": { # Information about which values in a pivot group should be used for sorting. # The bucket of the opposite pivot group to sort by.
21493 # If not specified, sorting is alphabetical by this group's values.
21494 "buckets": [ # Determines the bucket from which values are chosen to sort.
21495 #
21496 # For example, in a pivot table with one row group & two column groups,
21497 # the row group can list up to two values. The first value corresponds
21498 # to a value within the first column group, and the second value
21499 # corresponds to a value in the second column group. If no values
21500 # are listed, this would indicate that the row should be sorted according
21501 # to the "Grand Total" over the column groups. If a single value is listed,
21502 # this would correspond to using the "Total" of that bucket.
21503 { # The kinds of value that a cell in a spreadsheet can have.
21504 "numberValue": 3.14, # Represents a double value.
21505 # Note: Dates, Times and DateTimes are represented as doubles in
21506 # "serial number" format.
21507 "boolValue": True or False, # Represents a boolean value.
21508 "formulaValue": "A String", # Represents a formula.
21509 "stringValue": "A String", # Represents a string value.
21510 # Leading single quotes are not included. For example, if the user typed
21511 # `'123` into the UI, this would be represented as a `stringValue` of
21512 # `"123"`.
21513 "errorValue": { # An error in a cell. # Represents an error.
21514 # This field is read-only.
21515 "message": "A String", # A message with more information about the error
21516 # (in the spreadsheet's locale).
21517 "type": "A String", # The type of error.
21518 },
21519 },
21520 ],
21521 "valuesIndex": 42, # The offset in the [PivotTable.values] list which the values in this
21522 # grouping should be sorted by.
21523 },
21524 "sortOrder": "A String", # The order the values in this group should be sorted.
21525 "sourceColumnOffset": 42, # The column offset of the source range that this grouping is based on.
21526 #
21527 # For example, if the source was `C10:E15', a `sourceColumnOffset` of `0`
21528 # means this group refers to column `C`, whereas the offset `1` would refer
21529 # to column `D`.
21530 },
21531 ],
21532 "source": { # A range on a sheet. # The range the pivot table is reading data from.
21533 # All indexes are zero-based.
21534 # Indexes are half open, e.g the start index is inclusive
21535 # and the end index is exclusive -- [start_index, end_index).
21536 # Missing indexes indicate the range is unbounded on that side.
21537 #
21538 # For example, if "Sheet1" is grid ID 0, then:
21539 #
21540 # Sheet1!A1:A1 == sheet_id: 0,
21541 # start_row_index: 0, end_row_index: 1,
21542 # start_column_index: 0, end_column_index: 1
21543 #
21544 # Sheet1!A3:B4 == sheet_id: 0,
21545 # start_row_index: 2, end_row_index: 4,
21546 # start_column_index: 0, end_column_index: 2
21547 #
21548 # Sheet1!A:B == sheet_id: 0,
21549 # start_column_index: 0, end_column_index: 2
21550 #
21551 # Sheet1!A5:B == sheet_id: 0,
21552 # start_row_index: 4,
21553 # start_column_index: 0, end_column_index: 2
21554 #
21555 # Sheet1 == sheet_id:0
21556 #
21557 # The start index must always be less than or equal to the end index.
21558 # If the start index equals the end index, then the range is empty.
21559 # Empty ranges are typically not meaningful and are usually rendered in the
21560 # UI as `#REF!`.
21561 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
21562 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
21563 "sheetId": 42, # The sheet this range is on.
21564 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
21565 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
21566 },
21567 "values": [ # A list of values to include in the pivot table.
21568 { # The definition of how a value in a pivot table should be calculated.
21569 "formula": "A String", # A custom formula to calculate the value. The formula must start
21570 # with an `=` character.
21571 "summarizeFunction": "A String", # A function to summarize the value.
21572 # If formula is set, the only supported values are
21573 # SUM and
21574 # CUSTOM.
21575 # If sourceColumnOffset is set, then `CUSTOM`
21576 # is not supported.
21577 "sourceColumnOffset": 42, # The column offset of the source range that this value reads from.
21578 #
21579 # For example, if the source was `C10:E15', a `sourceColumnOffset` of `0`
21580 # means this value refers to column `C`, whereas the offset `1` would
21581 # refer to column `D`.
21582 "name": "A String", # A name to use for the value. This is only used if formula was set.
21583 # Otherwise, the column name is used.
21584 },
21585 ],
21586 "criteria": { # An optional mapping of filters per source column offset.
21587 #
21588 # The filters will be applied before aggregating data into the pivot table.
21589 # The map's key is the column offset of the source range that you want to
21590 # filter, and the value is the criteria for that column.
21591 #
21592 # For example, if the source was `C10:E15', a key of `0` will have the filter
21593 # for column `C`, whereas the key `1` is for column `D`.
21594 "a_key": { # Criteria for showing/hiding rows in a pivot table.
21595 "visibleValues": [ # Values that should be included. Values not listed here are excluded.
21596 "A String",
21597 ],
21598 },
21599 },
21600 "columns": [ # Each column grouping in the pivot table.
21601 { # A single grouping (either row or column) in a pivot table.
21602 "showTotals": True or False, # True if the pivot table should include the totals for this grouping.
21603 "valueMetadata": [ # Metadata about values in the grouping.
21604 { # Metadata about a value in a pivot grouping.
21605 "collapsed": True or False, # True if the data corresponding to the value is collapsed.
21606 "value": { # The kinds of value that a cell in a spreadsheet can have. # The calculated value the metadata corresponds to.
21607 # (Note that formulaValue is not valid,
21608 # because the values will be calculated.)
21609 "numberValue": 3.14, # Represents a double value.
21610 # Note: Dates, Times and DateTimes are represented as doubles in
21611 # "serial number" format.
21612 "boolValue": True or False, # Represents a boolean value.
21613 "formulaValue": "A String", # Represents a formula.
21614 "stringValue": "A String", # Represents a string value.
21615 # Leading single quotes are not included. For example, if the user typed
21616 # `'123` into the UI, this would be represented as a `stringValue` of
21617 # `"123"`.
21618 "errorValue": { # An error in a cell. # Represents an error.
21619 # This field is read-only.
21620 "message": "A String", # A message with more information about the error
21621 # (in the spreadsheet's locale).
21622 "type": "A String", # The type of error.
21623 },
21624 },
21625 },
21626 ],
21627 "valueBucket": { # Information about which values in a pivot group should be used for sorting. # The bucket of the opposite pivot group to sort by.
21628 # If not specified, sorting is alphabetical by this group's values.
21629 "buckets": [ # Determines the bucket from which values are chosen to sort.
21630 #
21631 # For example, in a pivot table with one row group & two column groups,
21632 # the row group can list up to two values. The first value corresponds
21633 # to a value within the first column group, and the second value
21634 # corresponds to a value in the second column group. If no values
21635 # are listed, this would indicate that the row should be sorted according
21636 # to the "Grand Total" over the column groups. If a single value is listed,
21637 # this would correspond to using the "Total" of that bucket.
21638 { # The kinds of value that a cell in a spreadsheet can have.
21639 "numberValue": 3.14, # Represents a double value.
21640 # Note: Dates, Times and DateTimes are represented as doubles in
21641 # "serial number" format.
21642 "boolValue": True or False, # Represents a boolean value.
21643 "formulaValue": "A String", # Represents a formula.
21644 "stringValue": "A String", # Represents a string value.
21645 # Leading single quotes are not included. For example, if the user typed
21646 # `'123` into the UI, this would be represented as a `stringValue` of
21647 # `"123"`.
21648 "errorValue": { # An error in a cell. # Represents an error.
21649 # This field is read-only.
21650 "message": "A String", # A message with more information about the error
21651 # (in the spreadsheet's locale).
21652 "type": "A String", # The type of error.
21653 },
21654 },
21655 ],
21656 "valuesIndex": 42, # The offset in the [PivotTable.values] list which the values in this
21657 # grouping should be sorted by.
21658 },
21659 "sortOrder": "A String", # The order the values in this group should be sorted.
21660 "sourceColumnOffset": 42, # The column offset of the source range that this grouping is based on.
21661 #
21662 # For example, if the source was `C10:E15', a `sourceColumnOffset` of `0`
21663 # means this group refers to column `C`, whereas the offset `1` would refer
21664 # to column `D`.
21665 },
21666 ],
21667 },
21668 "hyperlink": "A String", # A hyperlink this cell points to, if any.
21669 # This field is read-only. (To set it, use a `=HYPERLINK` formula.)
21670 "effectiveValue": { # The kinds of value that a cell in a spreadsheet can have. # The effective value of the cell. For cells with formulas, this will be
21671 # the calculated value. For cells with literals, this will be
21672 # the same as the user_entered_value.
21673 # This field is read-only.
21674 "numberValue": 3.14, # Represents a double value.
21675 # Note: Dates, Times and DateTimes are represented as doubles in
21676 # "serial number" format.
21677 "boolValue": True or False, # Represents a boolean value.
21678 "formulaValue": "A String", # Represents a formula.
21679 "stringValue": "A String", # Represents a string value.
21680 # Leading single quotes are not included. For example, if the user typed
21681 # `'123` into the UI, this would be represented as a `stringValue` of
21682 # `"123"`.
21683 "errorValue": { # An error in a cell. # Represents an error.
21684 # This field is read-only.
21685 "message": "A String", # A message with more information about the error
21686 # (in the spreadsheet's locale).
21687 "type": "A String", # The type of error.
21688 },
21689 },
21690 "formattedValue": "A String", # The formatted value of the cell.
21691 # This is the value as it's shown to the user.
21692 # This field is read-only.
21693 "userEnteredValue": { # The kinds of value that a cell in a spreadsheet can have. # The value the user entered in the cell. e.g, `1234`, `'Hello'`, or `=NOW()`
21694 # Note: Dates, Times and DateTimes are represented as doubles in
21695 # serial number format.
21696 "numberValue": 3.14, # Represents a double value.
21697 # Note: Dates, Times and DateTimes are represented as doubles in
21698 # "serial number" format.
21699 "boolValue": True or False, # Represents a boolean value.
21700 "formulaValue": "A String", # Represents a formula.
21701 "stringValue": "A String", # Represents a string value.
21702 # Leading single quotes are not included. For example, if the user typed
21703 # `'123` into the UI, this would be represented as a `stringValue` of
21704 # `"123"`.
21705 "errorValue": { # An error in a cell. # Represents an error.
21706 # This field is read-only.
21707 "message": "A String", # A message with more information about the error
21708 # (in the spreadsheet's locale).
21709 "type": "A String", # The type of error.
21710 },
21711 },
21712 "note": "A String", # Any note on the cell.
21713 "effectiveFormat": { # The format of a cell. # The effective format being used by the cell.
21714 # This includes the results of applying any conditional formatting and,
21715 # if the cell contains a formula, the computed number format.
21716 # If the effective format is the default format, effective format will
21717 # not be written.
21718 # This field is read-only.
21719 "numberFormat": { # The number format of a cell. # A format describing how number values should be represented to the user.
21720 # When updating, all fields must be set.
21721 "pattern": "A String", # Pattern string used for formatting.
21722 "type": "A String", # The type of the number format.
21723 },
21724 "textDirection": "A String", # The direction of the text in the cell.
21725 "padding": { # The amount of padding around the cell, in pixels. # The padding of the cell.
21726 # When updating padding, every field must be specified.
21727 "top": 42, # The top padding of the cell.
21728 "right": 42, # The right padding of the cell.
21729 "bottom": 42, # The bottom padding of the cell.
21730 "left": 42, # The left padding of the cell.
21731 },
21732 "horizontalAlignment": "A String", # The horizontal alignment of the value in cell.
21733 "backgroundColor": { # Represents a color in the RGBA color space. This representation is designed # The background color of the cell.
21734 # for simplicity of conversion to/from color representations in various
21735 # languages over compactness; for example, the fields of this representation
21736 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
21737 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
21738 # method in iOS; and, with just a little work, it can be easily formatted into
21739 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
21740 #
21741 # Example (Java):
21742 #
21743 # import com.google.type.Color;
21744 #
21745 # // ...
21746 # public static java.awt.Color fromProto(Color protocolor) {
21747 # float alpha = protocolor.hasAlpha()
21748 # ? protocolor.getAlpha().getValue()
21749 # : 1.0;
21750 #
21751 # return new java.awt.Color(
21752 # protocolor.getRed(),
21753 # protocolor.getGreen(),
21754 # protocolor.getBlue(),
21755 # alpha);
21756 # }
21757 #
21758 # public static Color toProto(java.awt.Color color) {
21759 # float red = (float) color.getRed();
21760 # float green = (float) color.getGreen();
21761 # float blue = (float) color.getBlue();
21762 # float denominator = 255.0;
21763 # Color.Builder resultBuilder =
21764 # Color
21765 # .newBuilder()
21766 # .setRed(red / denominator)
21767 # .setGreen(green / denominator)
21768 # .setBlue(blue / denominator);
21769 # int alpha = color.getAlpha();
21770 # if (alpha != 255) {
21771 # result.setAlpha(
21772 # FloatValue
21773 # .newBuilder()
21774 # .setValue(((float) alpha) / denominator)
21775 # .build());
21776 # }
21777 # return resultBuilder.build();
21778 # }
21779 # // ...
21780 #
21781 # Example (iOS / Obj-C):
21782 #
21783 # // ...
21784 # static UIColor* fromProto(Color* protocolor) {
21785 # float red = [protocolor red];
21786 # float green = [protocolor green];
21787 # float blue = [protocolor blue];
21788 # FloatValue* alpha_wrapper = [protocolor alpha];
21789 # float alpha = 1.0;
21790 # if (alpha_wrapper != nil) {
21791 # alpha = [alpha_wrapper value];
21792 # }
21793 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
21794 # }
21795 #
21796 # static Color* toProto(UIColor* color) {
21797 # CGFloat red, green, blue, alpha;
21798 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
21799 # return nil;
21800 # }
21801 # Color* result = [Color alloc] init];
21802 # [result setRed:red];
21803 # [result setGreen:green];
21804 # [result setBlue:blue];
21805 # if (alpha <= 0.9999) {
21806 # [result setAlpha:floatWrapperWithValue(alpha)];
21807 # }
21808 # [result autorelease];
21809 # return result;
21810 # }
21811 # // ...
21812 #
21813 # Example (JavaScript):
21814 #
21815 # // ...
21816 #
21817 # var protoToCssColor = function(rgb_color) {
21818 # var redFrac = rgb_color.red || 0.0;
21819 # var greenFrac = rgb_color.green || 0.0;
21820 # var blueFrac = rgb_color.blue || 0.0;
21821 # var red = Math.floor(redFrac * 255);
21822 # var green = Math.floor(greenFrac * 255);
21823 # var blue = Math.floor(blueFrac * 255);
21824 #
21825 # if (!('alpha' in rgb_color)) {
21826 # return rgbToCssColor_(red, green, blue);
21827 # }
21828 #
21829 # var alphaFrac = rgb_color.alpha.value || 0.0;
21830 # var rgbParams = [red, green, blue].join(',');
21831 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
21832 # };
21833 #
21834 # var rgbToCssColor_ = function(red, green, blue) {
21835 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
21836 # var hexString = rgbNumber.toString(16);
21837 # var missingZeros = 6 - hexString.length;
21838 # var resultBuilder = ['#'];
21839 # for (var i = 0; i < missingZeros; i++) {
21840 # resultBuilder.push('0');
21841 # }
21842 # resultBuilder.push(hexString);
21843 # return resultBuilder.join('');
21844 # };
21845 #
21846 # // ...
21847 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
21848 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
21849 # the final pixel color is defined by the equation:
21850 #
21851 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
21852 #
21853 # This means that a value of 1.0 corresponds to a solid color, whereas
21854 # a value of 0.0 corresponds to a completely transparent color. This
21855 # uses a wrapper message rather than a simple float scalar so that it is
21856 # possible to distinguish between a default value and the value being unset.
21857 # If omitted, this color object is to be rendered as a solid color
21858 # (as if the alpha value had been explicitly given with a value of 1.0).
21859 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
21860 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
21861 },
21862 "verticalAlignment": "A String", # The vertical alignment of the value in cell.
21863 "textFormat": { # The format of a run of text in a cell. # The format of the text in the cell (unless overridden by a format run).
21864 # Absent values indicate that the field isn't specified.
21865 "foregroundColor": { # Represents a color in the RGBA color space. This representation is designed # The foreground color of the text.
21866 # for simplicity of conversion to/from color representations in various
21867 # languages over compactness; for example, the fields of this representation
21868 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
21869 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
21870 # method in iOS; and, with just a little work, it can be easily formatted into
21871 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
21872 #
21873 # Example (Java):
21874 #
21875 # import com.google.type.Color;
21876 #
21877 # // ...
21878 # public static java.awt.Color fromProto(Color protocolor) {
21879 # float alpha = protocolor.hasAlpha()
21880 # ? protocolor.getAlpha().getValue()
21881 # : 1.0;
21882 #
21883 # return new java.awt.Color(
21884 # protocolor.getRed(),
21885 # protocolor.getGreen(),
21886 # protocolor.getBlue(),
21887 # alpha);
21888 # }
21889 #
21890 # public static Color toProto(java.awt.Color color) {
21891 # float red = (float) color.getRed();
21892 # float green = (float) color.getGreen();
21893 # float blue = (float) color.getBlue();
21894 # float denominator = 255.0;
21895 # Color.Builder resultBuilder =
21896 # Color
21897 # .newBuilder()
21898 # .setRed(red / denominator)
21899 # .setGreen(green / denominator)
21900 # .setBlue(blue / denominator);
21901 # int alpha = color.getAlpha();
21902 # if (alpha != 255) {
21903 # result.setAlpha(
21904 # FloatValue
21905 # .newBuilder()
21906 # .setValue(((float) alpha) / denominator)
21907 # .build());
21908 # }
21909 # return resultBuilder.build();
21910 # }
21911 # // ...
21912 #
21913 # Example (iOS / Obj-C):
21914 #
21915 # // ...
21916 # static UIColor* fromProto(Color* protocolor) {
21917 # float red = [protocolor red];
21918 # float green = [protocolor green];
21919 # float blue = [protocolor blue];
21920 # FloatValue* alpha_wrapper = [protocolor alpha];
21921 # float alpha = 1.0;
21922 # if (alpha_wrapper != nil) {
21923 # alpha = [alpha_wrapper value];
21924 # }
21925 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
21926 # }
21927 #
21928 # static Color* toProto(UIColor* color) {
21929 # CGFloat red, green, blue, alpha;
21930 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
21931 # return nil;
21932 # }
21933 # Color* result = [Color alloc] init];
21934 # [result setRed:red];
21935 # [result setGreen:green];
21936 # [result setBlue:blue];
21937 # if (alpha <= 0.9999) {
21938 # [result setAlpha:floatWrapperWithValue(alpha)];
21939 # }
21940 # [result autorelease];
21941 # return result;
21942 # }
21943 # // ...
21944 #
21945 # Example (JavaScript):
21946 #
21947 # // ...
21948 #
21949 # var protoToCssColor = function(rgb_color) {
21950 # var redFrac = rgb_color.red || 0.0;
21951 # var greenFrac = rgb_color.green || 0.0;
21952 # var blueFrac = rgb_color.blue || 0.0;
21953 # var red = Math.floor(redFrac * 255);
21954 # var green = Math.floor(greenFrac * 255);
21955 # var blue = Math.floor(blueFrac * 255);
21956 #
21957 # if (!('alpha' in rgb_color)) {
21958 # return rgbToCssColor_(red, green, blue);
21959 # }
21960 #
21961 # var alphaFrac = rgb_color.alpha.value || 0.0;
21962 # var rgbParams = [red, green, blue].join(',');
21963 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
21964 # };
21965 #
21966 # var rgbToCssColor_ = function(red, green, blue) {
21967 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
21968 # var hexString = rgbNumber.toString(16);
21969 # var missingZeros = 6 - hexString.length;
21970 # var resultBuilder = ['#'];
21971 # for (var i = 0; i < missingZeros; i++) {
21972 # resultBuilder.push('0');
21973 # }
21974 # resultBuilder.push(hexString);
21975 # return resultBuilder.join('');
21976 # };
21977 #
21978 # // ...
21979 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
21980 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
21981 # the final pixel color is defined by the equation:
21982 #
21983 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
21984 #
21985 # This means that a value of 1.0 corresponds to a solid color, whereas
21986 # a value of 0.0 corresponds to a completely transparent color. This
21987 # uses a wrapper message rather than a simple float scalar so that it is
21988 # possible to distinguish between a default value and the value being unset.
21989 # If omitted, this color object is to be rendered as a solid color
21990 # (as if the alpha value had been explicitly given with a value of 1.0).
21991 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
21992 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
21993 },
21994 "bold": True or False, # True if the text is bold.
21995 "strikethrough": True or False, # True if the text has a strikethrough.
21996 "fontFamily": "A String", # The font family.
21997 "fontSize": 42, # The size of the font.
21998 "italic": True or False, # True if the text is italicized.
21999 "underline": True or False, # True if the text is underlined.
22000 },
22001 "hyperlinkDisplayType": "A String", # How a hyperlink, if it exists, should be displayed in the cell.
22002 "borders": { # The borders of the cell. # The borders of the cell.
22003 "top": { # A border along a cell. # The top border of the cell.
22004 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
22005 # for simplicity of conversion to/from color representations in various
22006 # languages over compactness; for example, the fields of this representation
22007 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
22008 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
22009 # method in iOS; and, with just a little work, it can be easily formatted into
22010 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
22011 #
22012 # Example (Java):
22013 #
22014 # import com.google.type.Color;
22015 #
22016 # // ...
22017 # public static java.awt.Color fromProto(Color protocolor) {
22018 # float alpha = protocolor.hasAlpha()
22019 # ? protocolor.getAlpha().getValue()
22020 # : 1.0;
22021 #
22022 # return new java.awt.Color(
22023 # protocolor.getRed(),
22024 # protocolor.getGreen(),
22025 # protocolor.getBlue(),
22026 # alpha);
22027 # }
22028 #
22029 # public static Color toProto(java.awt.Color color) {
22030 # float red = (float) color.getRed();
22031 # float green = (float) color.getGreen();
22032 # float blue = (float) color.getBlue();
22033 # float denominator = 255.0;
22034 # Color.Builder resultBuilder =
22035 # Color
22036 # .newBuilder()
22037 # .setRed(red / denominator)
22038 # .setGreen(green / denominator)
22039 # .setBlue(blue / denominator);
22040 # int alpha = color.getAlpha();
22041 # if (alpha != 255) {
22042 # result.setAlpha(
22043 # FloatValue
22044 # .newBuilder()
22045 # .setValue(((float) alpha) / denominator)
22046 # .build());
22047 # }
22048 # return resultBuilder.build();
22049 # }
22050 # // ...
22051 #
22052 # Example (iOS / Obj-C):
22053 #
22054 # // ...
22055 # static UIColor* fromProto(Color* protocolor) {
22056 # float red = [protocolor red];
22057 # float green = [protocolor green];
22058 # float blue = [protocolor blue];
22059 # FloatValue* alpha_wrapper = [protocolor alpha];
22060 # float alpha = 1.0;
22061 # if (alpha_wrapper != nil) {
22062 # alpha = [alpha_wrapper value];
22063 # }
22064 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
22065 # }
22066 #
22067 # static Color* toProto(UIColor* color) {
22068 # CGFloat red, green, blue, alpha;
22069 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
22070 # return nil;
22071 # }
22072 # Color* result = [Color alloc] init];
22073 # [result setRed:red];
22074 # [result setGreen:green];
22075 # [result setBlue:blue];
22076 # if (alpha <= 0.9999) {
22077 # [result setAlpha:floatWrapperWithValue(alpha)];
22078 # }
22079 # [result autorelease];
22080 # return result;
22081 # }
22082 # // ...
22083 #
22084 # Example (JavaScript):
22085 #
22086 # // ...
22087 #
22088 # var protoToCssColor = function(rgb_color) {
22089 # var redFrac = rgb_color.red || 0.0;
22090 # var greenFrac = rgb_color.green || 0.0;
22091 # var blueFrac = rgb_color.blue || 0.0;
22092 # var red = Math.floor(redFrac * 255);
22093 # var green = Math.floor(greenFrac * 255);
22094 # var blue = Math.floor(blueFrac * 255);
22095 #
22096 # if (!('alpha' in rgb_color)) {
22097 # return rgbToCssColor_(red, green, blue);
22098 # }
22099 #
22100 # var alphaFrac = rgb_color.alpha.value || 0.0;
22101 # var rgbParams = [red, green, blue].join(',');
22102 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
22103 # };
22104 #
22105 # var rgbToCssColor_ = function(red, green, blue) {
22106 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
22107 # var hexString = rgbNumber.toString(16);
22108 # var missingZeros = 6 - hexString.length;
22109 # var resultBuilder = ['#'];
22110 # for (var i = 0; i < missingZeros; i++) {
22111 # resultBuilder.push('0');
22112 # }
22113 # resultBuilder.push(hexString);
22114 # return resultBuilder.join('');
22115 # };
22116 #
22117 # // ...
22118 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
22119 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
22120 # the final pixel color is defined by the equation:
22121 #
22122 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
22123 #
22124 # This means that a value of 1.0 corresponds to a solid color, whereas
22125 # a value of 0.0 corresponds to a completely transparent color. This
22126 # uses a wrapper message rather than a simple float scalar so that it is
22127 # possible to distinguish between a default value and the value being unset.
22128 # If omitted, this color object is to be rendered as a solid color
22129 # (as if the alpha value had been explicitly given with a value of 1.0).
22130 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
22131 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
22132 },
22133 "width": 42, # The width of the border, in pixels.
22134 # Border widths must be between 0 and 3 pixels.
22135 "style": "A String", # The style of the border.
22136 },
22137 "right": { # A border along a cell. # The right border of the cell.
22138 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
22139 # for simplicity of conversion to/from color representations in various
22140 # languages over compactness; for example, the fields of this representation
22141 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
22142 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
22143 # method in iOS; and, with just a little work, it can be easily formatted into
22144 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
22145 #
22146 # Example (Java):
22147 #
22148 # import com.google.type.Color;
22149 #
22150 # // ...
22151 # public static java.awt.Color fromProto(Color protocolor) {
22152 # float alpha = protocolor.hasAlpha()
22153 # ? protocolor.getAlpha().getValue()
22154 # : 1.0;
22155 #
22156 # return new java.awt.Color(
22157 # protocolor.getRed(),
22158 # protocolor.getGreen(),
22159 # protocolor.getBlue(),
22160 # alpha);
22161 # }
22162 #
22163 # public static Color toProto(java.awt.Color color) {
22164 # float red = (float) color.getRed();
22165 # float green = (float) color.getGreen();
22166 # float blue = (float) color.getBlue();
22167 # float denominator = 255.0;
22168 # Color.Builder resultBuilder =
22169 # Color
22170 # .newBuilder()
22171 # .setRed(red / denominator)
22172 # .setGreen(green / denominator)
22173 # .setBlue(blue / denominator);
22174 # int alpha = color.getAlpha();
22175 # if (alpha != 255) {
22176 # result.setAlpha(
22177 # FloatValue
22178 # .newBuilder()
22179 # .setValue(((float) alpha) / denominator)
22180 # .build());
22181 # }
22182 # return resultBuilder.build();
22183 # }
22184 # // ...
22185 #
22186 # Example (iOS / Obj-C):
22187 #
22188 # // ...
22189 # static UIColor* fromProto(Color* protocolor) {
22190 # float red = [protocolor red];
22191 # float green = [protocolor green];
22192 # float blue = [protocolor blue];
22193 # FloatValue* alpha_wrapper = [protocolor alpha];
22194 # float alpha = 1.0;
22195 # if (alpha_wrapper != nil) {
22196 # alpha = [alpha_wrapper value];
22197 # }
22198 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
22199 # }
22200 #
22201 # static Color* toProto(UIColor* color) {
22202 # CGFloat red, green, blue, alpha;
22203 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
22204 # return nil;
22205 # }
22206 # Color* result = [Color alloc] init];
22207 # [result setRed:red];
22208 # [result setGreen:green];
22209 # [result setBlue:blue];
22210 # if (alpha <= 0.9999) {
22211 # [result setAlpha:floatWrapperWithValue(alpha)];
22212 # }
22213 # [result autorelease];
22214 # return result;
22215 # }
22216 # // ...
22217 #
22218 # Example (JavaScript):
22219 #
22220 # // ...
22221 #
22222 # var protoToCssColor = function(rgb_color) {
22223 # var redFrac = rgb_color.red || 0.0;
22224 # var greenFrac = rgb_color.green || 0.0;
22225 # var blueFrac = rgb_color.blue || 0.0;
22226 # var red = Math.floor(redFrac * 255);
22227 # var green = Math.floor(greenFrac * 255);
22228 # var blue = Math.floor(blueFrac * 255);
22229 #
22230 # if (!('alpha' in rgb_color)) {
22231 # return rgbToCssColor_(red, green, blue);
22232 # }
22233 #
22234 # var alphaFrac = rgb_color.alpha.value || 0.0;
22235 # var rgbParams = [red, green, blue].join(',');
22236 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
22237 # };
22238 #
22239 # var rgbToCssColor_ = function(red, green, blue) {
22240 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
22241 # var hexString = rgbNumber.toString(16);
22242 # var missingZeros = 6 - hexString.length;
22243 # var resultBuilder = ['#'];
22244 # for (var i = 0; i < missingZeros; i++) {
22245 # resultBuilder.push('0');
22246 # }
22247 # resultBuilder.push(hexString);
22248 # return resultBuilder.join('');
22249 # };
22250 #
22251 # // ...
22252 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
22253 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
22254 # the final pixel color is defined by the equation:
22255 #
22256 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
22257 #
22258 # This means that a value of 1.0 corresponds to a solid color, whereas
22259 # a value of 0.0 corresponds to a completely transparent color. This
22260 # uses a wrapper message rather than a simple float scalar so that it is
22261 # possible to distinguish between a default value and the value being unset.
22262 # If omitted, this color object is to be rendered as a solid color
22263 # (as if the alpha value had been explicitly given with a value of 1.0).
22264 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
22265 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
22266 },
22267 "width": 42, # The width of the border, in pixels.
22268 # Border widths must be between 0 and 3 pixels.
22269 "style": "A String", # The style of the border.
22270 },
22271 "bottom": { # A border along a cell. # The bottom border of the cell.
22272 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
22273 # for simplicity of conversion to/from color representations in various
22274 # languages over compactness; for example, the fields of this representation
22275 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
22276 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
22277 # method in iOS; and, with just a little work, it can be easily formatted into
22278 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
22279 #
22280 # Example (Java):
22281 #
22282 # import com.google.type.Color;
22283 #
22284 # // ...
22285 # public static java.awt.Color fromProto(Color protocolor) {
22286 # float alpha = protocolor.hasAlpha()
22287 # ? protocolor.getAlpha().getValue()
22288 # : 1.0;
22289 #
22290 # return new java.awt.Color(
22291 # protocolor.getRed(),
22292 # protocolor.getGreen(),
22293 # protocolor.getBlue(),
22294 # alpha);
22295 # }
22296 #
22297 # public static Color toProto(java.awt.Color color) {
22298 # float red = (float) color.getRed();
22299 # float green = (float) color.getGreen();
22300 # float blue = (float) color.getBlue();
22301 # float denominator = 255.0;
22302 # Color.Builder resultBuilder =
22303 # Color
22304 # .newBuilder()
22305 # .setRed(red / denominator)
22306 # .setGreen(green / denominator)
22307 # .setBlue(blue / denominator);
22308 # int alpha = color.getAlpha();
22309 # if (alpha != 255) {
22310 # result.setAlpha(
22311 # FloatValue
22312 # .newBuilder()
22313 # .setValue(((float) alpha) / denominator)
22314 # .build());
22315 # }
22316 # return resultBuilder.build();
22317 # }
22318 # // ...
22319 #
22320 # Example (iOS / Obj-C):
22321 #
22322 # // ...
22323 # static UIColor* fromProto(Color* protocolor) {
22324 # float red = [protocolor red];
22325 # float green = [protocolor green];
22326 # float blue = [protocolor blue];
22327 # FloatValue* alpha_wrapper = [protocolor alpha];
22328 # float alpha = 1.0;
22329 # if (alpha_wrapper != nil) {
22330 # alpha = [alpha_wrapper value];
22331 # }
22332 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
22333 # }
22334 #
22335 # static Color* toProto(UIColor* color) {
22336 # CGFloat red, green, blue, alpha;
22337 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
22338 # return nil;
22339 # }
22340 # Color* result = [Color alloc] init];
22341 # [result setRed:red];
22342 # [result setGreen:green];
22343 # [result setBlue:blue];
22344 # if (alpha <= 0.9999) {
22345 # [result setAlpha:floatWrapperWithValue(alpha)];
22346 # }
22347 # [result autorelease];
22348 # return result;
22349 # }
22350 # // ...
22351 #
22352 # Example (JavaScript):
22353 #
22354 # // ...
22355 #
22356 # var protoToCssColor = function(rgb_color) {
22357 # var redFrac = rgb_color.red || 0.0;
22358 # var greenFrac = rgb_color.green || 0.0;
22359 # var blueFrac = rgb_color.blue || 0.0;
22360 # var red = Math.floor(redFrac * 255);
22361 # var green = Math.floor(greenFrac * 255);
22362 # var blue = Math.floor(blueFrac * 255);
22363 #
22364 # if (!('alpha' in rgb_color)) {
22365 # return rgbToCssColor_(red, green, blue);
22366 # }
22367 #
22368 # var alphaFrac = rgb_color.alpha.value || 0.0;
22369 # var rgbParams = [red, green, blue].join(',');
22370 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
22371 # };
22372 #
22373 # var rgbToCssColor_ = function(red, green, blue) {
22374 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
22375 # var hexString = rgbNumber.toString(16);
22376 # var missingZeros = 6 - hexString.length;
22377 # var resultBuilder = ['#'];
22378 # for (var i = 0; i < missingZeros; i++) {
22379 # resultBuilder.push('0');
22380 # }
22381 # resultBuilder.push(hexString);
22382 # return resultBuilder.join('');
22383 # };
22384 #
22385 # // ...
22386 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
22387 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
22388 # the final pixel color is defined by the equation:
22389 #
22390 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
22391 #
22392 # This means that a value of 1.0 corresponds to a solid color, whereas
22393 # a value of 0.0 corresponds to a completely transparent color. This
22394 # uses a wrapper message rather than a simple float scalar so that it is
22395 # possible to distinguish between a default value and the value being unset.
22396 # If omitted, this color object is to be rendered as a solid color
22397 # (as if the alpha value had been explicitly given with a value of 1.0).
22398 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
22399 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
22400 },
22401 "width": 42, # The width of the border, in pixels.
22402 # Border widths must be between 0 and 3 pixels.
22403 "style": "A String", # The style of the border.
22404 },
22405 "left": { # A border along a cell. # The left border of the cell.
22406 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
22407 # for simplicity of conversion to/from color representations in various
22408 # languages over compactness; for example, the fields of this representation
22409 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
22410 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
22411 # method in iOS; and, with just a little work, it can be easily formatted into
22412 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
22413 #
22414 # Example (Java):
22415 #
22416 # import com.google.type.Color;
22417 #
22418 # // ...
22419 # public static java.awt.Color fromProto(Color protocolor) {
22420 # float alpha = protocolor.hasAlpha()
22421 # ? protocolor.getAlpha().getValue()
22422 # : 1.0;
22423 #
22424 # return new java.awt.Color(
22425 # protocolor.getRed(),
22426 # protocolor.getGreen(),
22427 # protocolor.getBlue(),
22428 # alpha);
22429 # }
22430 #
22431 # public static Color toProto(java.awt.Color color) {
22432 # float red = (float) color.getRed();
22433 # float green = (float) color.getGreen();
22434 # float blue = (float) color.getBlue();
22435 # float denominator = 255.0;
22436 # Color.Builder resultBuilder =
22437 # Color
22438 # .newBuilder()
22439 # .setRed(red / denominator)
22440 # .setGreen(green / denominator)
22441 # .setBlue(blue / denominator);
22442 # int alpha = color.getAlpha();
22443 # if (alpha != 255) {
22444 # result.setAlpha(
22445 # FloatValue
22446 # .newBuilder()
22447 # .setValue(((float) alpha) / denominator)
22448 # .build());
22449 # }
22450 # return resultBuilder.build();
22451 # }
22452 # // ...
22453 #
22454 # Example (iOS / Obj-C):
22455 #
22456 # // ...
22457 # static UIColor* fromProto(Color* protocolor) {
22458 # float red = [protocolor red];
22459 # float green = [protocolor green];
22460 # float blue = [protocolor blue];
22461 # FloatValue* alpha_wrapper = [protocolor alpha];
22462 # float alpha = 1.0;
22463 # if (alpha_wrapper != nil) {
22464 # alpha = [alpha_wrapper value];
22465 # }
22466 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
22467 # }
22468 #
22469 # static Color* toProto(UIColor* color) {
22470 # CGFloat red, green, blue, alpha;
22471 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
22472 # return nil;
22473 # }
22474 # Color* result = [Color alloc] init];
22475 # [result setRed:red];
22476 # [result setGreen:green];
22477 # [result setBlue:blue];
22478 # if (alpha <= 0.9999) {
22479 # [result setAlpha:floatWrapperWithValue(alpha)];
22480 # }
22481 # [result autorelease];
22482 # return result;
22483 # }
22484 # // ...
22485 #
22486 # Example (JavaScript):
22487 #
22488 # // ...
22489 #
22490 # var protoToCssColor = function(rgb_color) {
22491 # var redFrac = rgb_color.red || 0.0;
22492 # var greenFrac = rgb_color.green || 0.0;
22493 # var blueFrac = rgb_color.blue || 0.0;
22494 # var red = Math.floor(redFrac * 255);
22495 # var green = Math.floor(greenFrac * 255);
22496 # var blue = Math.floor(blueFrac * 255);
22497 #
22498 # if (!('alpha' in rgb_color)) {
22499 # return rgbToCssColor_(red, green, blue);
22500 # }
22501 #
22502 # var alphaFrac = rgb_color.alpha.value || 0.0;
22503 # var rgbParams = [red, green, blue].join(',');
22504 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
22505 # };
22506 #
22507 # var rgbToCssColor_ = function(red, green, blue) {
22508 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
22509 # var hexString = rgbNumber.toString(16);
22510 # var missingZeros = 6 - hexString.length;
22511 # var resultBuilder = ['#'];
22512 # for (var i = 0; i < missingZeros; i++) {
22513 # resultBuilder.push('0');
22514 # }
22515 # resultBuilder.push(hexString);
22516 # return resultBuilder.join('');
22517 # };
22518 #
22519 # // ...
22520 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
22521 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
22522 # the final pixel color is defined by the equation:
22523 #
22524 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
22525 #
22526 # This means that a value of 1.0 corresponds to a solid color, whereas
22527 # a value of 0.0 corresponds to a completely transparent color. This
22528 # uses a wrapper message rather than a simple float scalar so that it is
22529 # possible to distinguish between a default value and the value being unset.
22530 # If omitted, this color object is to be rendered as a solid color
22531 # (as if the alpha value had been explicitly given with a value of 1.0).
22532 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
22533 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
22534 },
22535 "width": 42, # The width of the border, in pixels.
22536 # Border widths must be between 0 and 3 pixels.
22537 "style": "A String", # The style of the border.
22538 },
22539 },
22540 "wrapStrategy": "A String", # The wrap strategy for the value in the cell.
22541 },
22542 "userEnteredFormat": { # The format of a cell. # The format the user entered for the cell.
22543 #
22544 # When writing, the new format will be merged with the existing format.
22545 "numberFormat": { # The number format of a cell. # A format describing how number values should be represented to the user.
22546 # When updating, all fields must be set.
22547 "pattern": "A String", # Pattern string used for formatting.
22548 "type": "A String", # The type of the number format.
22549 },
22550 "textDirection": "A String", # The direction of the text in the cell.
22551 "padding": { # The amount of padding around the cell, in pixels. # The padding of the cell.
22552 # When updating padding, every field must be specified.
22553 "top": 42, # The top padding of the cell.
22554 "right": 42, # The right padding of the cell.
22555 "bottom": 42, # The bottom padding of the cell.
22556 "left": 42, # The left padding of the cell.
22557 },
22558 "horizontalAlignment": "A String", # The horizontal alignment of the value in cell.
22559 "backgroundColor": { # Represents a color in the RGBA color space. This representation is designed # The background color of the cell.
22560 # for simplicity of conversion to/from color representations in various
22561 # languages over compactness; for example, the fields of this representation
22562 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
22563 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
22564 # method in iOS; and, with just a little work, it can be easily formatted into
22565 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
22566 #
22567 # Example (Java):
22568 #
22569 # import com.google.type.Color;
22570 #
22571 # // ...
22572 # public static java.awt.Color fromProto(Color protocolor) {
22573 # float alpha = protocolor.hasAlpha()
22574 # ? protocolor.getAlpha().getValue()
22575 # : 1.0;
22576 #
22577 # return new java.awt.Color(
22578 # protocolor.getRed(),
22579 # protocolor.getGreen(),
22580 # protocolor.getBlue(),
22581 # alpha);
22582 # }
22583 #
22584 # public static Color toProto(java.awt.Color color) {
22585 # float red = (float) color.getRed();
22586 # float green = (float) color.getGreen();
22587 # float blue = (float) color.getBlue();
22588 # float denominator = 255.0;
22589 # Color.Builder resultBuilder =
22590 # Color
22591 # .newBuilder()
22592 # .setRed(red / denominator)
22593 # .setGreen(green / denominator)
22594 # .setBlue(blue / denominator);
22595 # int alpha = color.getAlpha();
22596 # if (alpha != 255) {
22597 # result.setAlpha(
22598 # FloatValue
22599 # .newBuilder()
22600 # .setValue(((float) alpha) / denominator)
22601 # .build());
22602 # }
22603 # return resultBuilder.build();
22604 # }
22605 # // ...
22606 #
22607 # Example (iOS / Obj-C):
22608 #
22609 # // ...
22610 # static UIColor* fromProto(Color* protocolor) {
22611 # float red = [protocolor red];
22612 # float green = [protocolor green];
22613 # float blue = [protocolor blue];
22614 # FloatValue* alpha_wrapper = [protocolor alpha];
22615 # float alpha = 1.0;
22616 # if (alpha_wrapper != nil) {
22617 # alpha = [alpha_wrapper value];
22618 # }
22619 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
22620 # }
22621 #
22622 # static Color* toProto(UIColor* color) {
22623 # CGFloat red, green, blue, alpha;
22624 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
22625 # return nil;
22626 # }
22627 # Color* result = [Color alloc] init];
22628 # [result setRed:red];
22629 # [result setGreen:green];
22630 # [result setBlue:blue];
22631 # if (alpha <= 0.9999) {
22632 # [result setAlpha:floatWrapperWithValue(alpha)];
22633 # }
22634 # [result autorelease];
22635 # return result;
22636 # }
22637 # // ...
22638 #
22639 # Example (JavaScript):
22640 #
22641 # // ...
22642 #
22643 # var protoToCssColor = function(rgb_color) {
22644 # var redFrac = rgb_color.red || 0.0;
22645 # var greenFrac = rgb_color.green || 0.0;
22646 # var blueFrac = rgb_color.blue || 0.0;
22647 # var red = Math.floor(redFrac * 255);
22648 # var green = Math.floor(greenFrac * 255);
22649 # var blue = Math.floor(blueFrac * 255);
22650 #
22651 # if (!('alpha' in rgb_color)) {
22652 # return rgbToCssColor_(red, green, blue);
22653 # }
22654 #
22655 # var alphaFrac = rgb_color.alpha.value || 0.0;
22656 # var rgbParams = [red, green, blue].join(',');
22657 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
22658 # };
22659 #
22660 # var rgbToCssColor_ = function(red, green, blue) {
22661 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
22662 # var hexString = rgbNumber.toString(16);
22663 # var missingZeros = 6 - hexString.length;
22664 # var resultBuilder = ['#'];
22665 # for (var i = 0; i < missingZeros; i++) {
22666 # resultBuilder.push('0');
22667 # }
22668 # resultBuilder.push(hexString);
22669 # return resultBuilder.join('');
22670 # };
22671 #
22672 # // ...
22673 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
22674 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
22675 # the final pixel color is defined by the equation:
22676 #
22677 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
22678 #
22679 # This means that a value of 1.0 corresponds to a solid color, whereas
22680 # a value of 0.0 corresponds to a completely transparent color. This
22681 # uses a wrapper message rather than a simple float scalar so that it is
22682 # possible to distinguish between a default value and the value being unset.
22683 # If omitted, this color object is to be rendered as a solid color
22684 # (as if the alpha value had been explicitly given with a value of 1.0).
22685 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
22686 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
22687 },
22688 "verticalAlignment": "A String", # The vertical alignment of the value in cell.
22689 "textFormat": { # The format of a run of text in a cell. # The format of the text in the cell (unless overridden by a format run).
22690 # Absent values indicate that the field isn't specified.
22691 "foregroundColor": { # Represents a color in the RGBA color space. This representation is designed # The foreground color of the text.
22692 # for simplicity of conversion to/from color representations in various
22693 # languages over compactness; for example, the fields of this representation
22694 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
22695 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
22696 # method in iOS; and, with just a little work, it can be easily formatted into
22697 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
22698 #
22699 # Example (Java):
22700 #
22701 # import com.google.type.Color;
22702 #
22703 # // ...
22704 # public static java.awt.Color fromProto(Color protocolor) {
22705 # float alpha = protocolor.hasAlpha()
22706 # ? protocolor.getAlpha().getValue()
22707 # : 1.0;
22708 #
22709 # return new java.awt.Color(
22710 # protocolor.getRed(),
22711 # protocolor.getGreen(),
22712 # protocolor.getBlue(),
22713 # alpha);
22714 # }
22715 #
22716 # public static Color toProto(java.awt.Color color) {
22717 # float red = (float) color.getRed();
22718 # float green = (float) color.getGreen();
22719 # float blue = (float) color.getBlue();
22720 # float denominator = 255.0;
22721 # Color.Builder resultBuilder =
22722 # Color
22723 # .newBuilder()
22724 # .setRed(red / denominator)
22725 # .setGreen(green / denominator)
22726 # .setBlue(blue / denominator);
22727 # int alpha = color.getAlpha();
22728 # if (alpha != 255) {
22729 # result.setAlpha(
22730 # FloatValue
22731 # .newBuilder()
22732 # .setValue(((float) alpha) / denominator)
22733 # .build());
22734 # }
22735 # return resultBuilder.build();
22736 # }
22737 # // ...
22738 #
22739 # Example (iOS / Obj-C):
22740 #
22741 # // ...
22742 # static UIColor* fromProto(Color* protocolor) {
22743 # float red = [protocolor red];
22744 # float green = [protocolor green];
22745 # float blue = [protocolor blue];
22746 # FloatValue* alpha_wrapper = [protocolor alpha];
22747 # float alpha = 1.0;
22748 # if (alpha_wrapper != nil) {
22749 # alpha = [alpha_wrapper value];
22750 # }
22751 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
22752 # }
22753 #
22754 # static Color* toProto(UIColor* color) {
22755 # CGFloat red, green, blue, alpha;
22756 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
22757 # return nil;
22758 # }
22759 # Color* result = [Color alloc] init];
22760 # [result setRed:red];
22761 # [result setGreen:green];
22762 # [result setBlue:blue];
22763 # if (alpha <= 0.9999) {
22764 # [result setAlpha:floatWrapperWithValue(alpha)];
22765 # }
22766 # [result autorelease];
22767 # return result;
22768 # }
22769 # // ...
22770 #
22771 # Example (JavaScript):
22772 #
22773 # // ...
22774 #
22775 # var protoToCssColor = function(rgb_color) {
22776 # var redFrac = rgb_color.red || 0.0;
22777 # var greenFrac = rgb_color.green || 0.0;
22778 # var blueFrac = rgb_color.blue || 0.0;
22779 # var red = Math.floor(redFrac * 255);
22780 # var green = Math.floor(greenFrac * 255);
22781 # var blue = Math.floor(blueFrac * 255);
22782 #
22783 # if (!('alpha' in rgb_color)) {
22784 # return rgbToCssColor_(red, green, blue);
22785 # }
22786 #
22787 # var alphaFrac = rgb_color.alpha.value || 0.0;
22788 # var rgbParams = [red, green, blue].join(',');
22789 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
22790 # };
22791 #
22792 # var rgbToCssColor_ = function(red, green, blue) {
22793 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
22794 # var hexString = rgbNumber.toString(16);
22795 # var missingZeros = 6 - hexString.length;
22796 # var resultBuilder = ['#'];
22797 # for (var i = 0; i < missingZeros; i++) {
22798 # resultBuilder.push('0');
22799 # }
22800 # resultBuilder.push(hexString);
22801 # return resultBuilder.join('');
22802 # };
22803 #
22804 # // ...
22805 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
22806 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
22807 # the final pixel color is defined by the equation:
22808 #
22809 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
22810 #
22811 # This means that a value of 1.0 corresponds to a solid color, whereas
22812 # a value of 0.0 corresponds to a completely transparent color. This
22813 # uses a wrapper message rather than a simple float scalar so that it is
22814 # possible to distinguish between a default value and the value being unset.
22815 # If omitted, this color object is to be rendered as a solid color
22816 # (as if the alpha value had been explicitly given with a value of 1.0).
22817 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
22818 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
22819 },
22820 "bold": True or False, # True if the text is bold.
22821 "strikethrough": True or False, # True if the text has a strikethrough.
22822 "fontFamily": "A String", # The font family.
22823 "fontSize": 42, # The size of the font.
22824 "italic": True or False, # True if the text is italicized.
22825 "underline": True or False, # True if the text is underlined.
22826 },
22827 "hyperlinkDisplayType": "A String", # How a hyperlink, if it exists, should be displayed in the cell.
22828 "borders": { # The borders of the cell. # The borders of the cell.
22829 "top": { # A border along a cell. # The top border of the cell.
22830 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
22831 # for simplicity of conversion to/from color representations in various
22832 # languages over compactness; for example, the fields of this representation
22833 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
22834 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
22835 # method in iOS; and, with just a little work, it can be easily formatted into
22836 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
22837 #
22838 # Example (Java):
22839 #
22840 # import com.google.type.Color;
22841 #
22842 # // ...
22843 # public static java.awt.Color fromProto(Color protocolor) {
22844 # float alpha = protocolor.hasAlpha()
22845 # ? protocolor.getAlpha().getValue()
22846 # : 1.0;
22847 #
22848 # return new java.awt.Color(
22849 # protocolor.getRed(),
22850 # protocolor.getGreen(),
22851 # protocolor.getBlue(),
22852 # alpha);
22853 # }
22854 #
22855 # public static Color toProto(java.awt.Color color) {
22856 # float red = (float) color.getRed();
22857 # float green = (float) color.getGreen();
22858 # float blue = (float) color.getBlue();
22859 # float denominator = 255.0;
22860 # Color.Builder resultBuilder =
22861 # Color
22862 # .newBuilder()
22863 # .setRed(red / denominator)
22864 # .setGreen(green / denominator)
22865 # .setBlue(blue / denominator);
22866 # int alpha = color.getAlpha();
22867 # if (alpha != 255) {
22868 # result.setAlpha(
22869 # FloatValue
22870 # .newBuilder()
22871 # .setValue(((float) alpha) / denominator)
22872 # .build());
22873 # }
22874 # return resultBuilder.build();
22875 # }
22876 # // ...
22877 #
22878 # Example (iOS / Obj-C):
22879 #
22880 # // ...
22881 # static UIColor* fromProto(Color* protocolor) {
22882 # float red = [protocolor red];
22883 # float green = [protocolor green];
22884 # float blue = [protocolor blue];
22885 # FloatValue* alpha_wrapper = [protocolor alpha];
22886 # float alpha = 1.0;
22887 # if (alpha_wrapper != nil) {
22888 # alpha = [alpha_wrapper value];
22889 # }
22890 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
22891 # }
22892 #
22893 # static Color* toProto(UIColor* color) {
22894 # CGFloat red, green, blue, alpha;
22895 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
22896 # return nil;
22897 # }
22898 # Color* result = [Color alloc] init];
22899 # [result setRed:red];
22900 # [result setGreen:green];
22901 # [result setBlue:blue];
22902 # if (alpha <= 0.9999) {
22903 # [result setAlpha:floatWrapperWithValue(alpha)];
22904 # }
22905 # [result autorelease];
22906 # return result;
22907 # }
22908 # // ...
22909 #
22910 # Example (JavaScript):
22911 #
22912 # // ...
22913 #
22914 # var protoToCssColor = function(rgb_color) {
22915 # var redFrac = rgb_color.red || 0.0;
22916 # var greenFrac = rgb_color.green || 0.0;
22917 # var blueFrac = rgb_color.blue || 0.0;
22918 # var red = Math.floor(redFrac * 255);
22919 # var green = Math.floor(greenFrac * 255);
22920 # var blue = Math.floor(blueFrac * 255);
22921 #
22922 # if (!('alpha' in rgb_color)) {
22923 # return rgbToCssColor_(red, green, blue);
22924 # }
22925 #
22926 # var alphaFrac = rgb_color.alpha.value || 0.0;
22927 # var rgbParams = [red, green, blue].join(',');
22928 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
22929 # };
22930 #
22931 # var rgbToCssColor_ = function(red, green, blue) {
22932 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
22933 # var hexString = rgbNumber.toString(16);
22934 # var missingZeros = 6 - hexString.length;
22935 # var resultBuilder = ['#'];
22936 # for (var i = 0; i < missingZeros; i++) {
22937 # resultBuilder.push('0');
22938 # }
22939 # resultBuilder.push(hexString);
22940 # return resultBuilder.join('');
22941 # };
22942 #
22943 # // ...
22944 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
22945 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
22946 # the final pixel color is defined by the equation:
22947 #
22948 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
22949 #
22950 # This means that a value of 1.0 corresponds to a solid color, whereas
22951 # a value of 0.0 corresponds to a completely transparent color. This
22952 # uses a wrapper message rather than a simple float scalar so that it is
22953 # possible to distinguish between a default value and the value being unset.
22954 # If omitted, this color object is to be rendered as a solid color
22955 # (as if the alpha value had been explicitly given with a value of 1.0).
22956 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
22957 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
22958 },
22959 "width": 42, # The width of the border, in pixels.
22960 # Border widths must be between 0 and 3 pixels.
22961 "style": "A String", # The style of the border.
22962 },
22963 "right": { # A border along a cell. # The right border of the cell.
22964 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
22965 # for simplicity of conversion to/from color representations in various
22966 # languages over compactness; for example, the fields of this representation
22967 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
22968 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
22969 # method in iOS; and, with just a little work, it can be easily formatted into
22970 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
22971 #
22972 # Example (Java):
22973 #
22974 # import com.google.type.Color;
22975 #
22976 # // ...
22977 # public static java.awt.Color fromProto(Color protocolor) {
22978 # float alpha = protocolor.hasAlpha()
22979 # ? protocolor.getAlpha().getValue()
22980 # : 1.0;
22981 #
22982 # return new java.awt.Color(
22983 # protocolor.getRed(),
22984 # protocolor.getGreen(),
22985 # protocolor.getBlue(),
22986 # alpha);
22987 # }
22988 #
22989 # public static Color toProto(java.awt.Color color) {
22990 # float red = (float) color.getRed();
22991 # float green = (float) color.getGreen();
22992 # float blue = (float) color.getBlue();
22993 # float denominator = 255.0;
22994 # Color.Builder resultBuilder =
22995 # Color
22996 # .newBuilder()
22997 # .setRed(red / denominator)
22998 # .setGreen(green / denominator)
22999 # .setBlue(blue / denominator);
23000 # int alpha = color.getAlpha();
23001 # if (alpha != 255) {
23002 # result.setAlpha(
23003 # FloatValue
23004 # .newBuilder()
23005 # .setValue(((float) alpha) / denominator)
23006 # .build());
23007 # }
23008 # return resultBuilder.build();
23009 # }
23010 # // ...
23011 #
23012 # Example (iOS / Obj-C):
23013 #
23014 # // ...
23015 # static UIColor* fromProto(Color* protocolor) {
23016 # float red = [protocolor red];
23017 # float green = [protocolor green];
23018 # float blue = [protocolor blue];
23019 # FloatValue* alpha_wrapper = [protocolor alpha];
23020 # float alpha = 1.0;
23021 # if (alpha_wrapper != nil) {
23022 # alpha = [alpha_wrapper value];
23023 # }
23024 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
23025 # }
23026 #
23027 # static Color* toProto(UIColor* color) {
23028 # CGFloat red, green, blue, alpha;
23029 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
23030 # return nil;
23031 # }
23032 # Color* result = [Color alloc] init];
23033 # [result setRed:red];
23034 # [result setGreen:green];
23035 # [result setBlue:blue];
23036 # if (alpha <= 0.9999) {
23037 # [result setAlpha:floatWrapperWithValue(alpha)];
23038 # }
23039 # [result autorelease];
23040 # return result;
23041 # }
23042 # // ...
23043 #
23044 # Example (JavaScript):
23045 #
23046 # // ...
23047 #
23048 # var protoToCssColor = function(rgb_color) {
23049 # var redFrac = rgb_color.red || 0.0;
23050 # var greenFrac = rgb_color.green || 0.0;
23051 # var blueFrac = rgb_color.blue || 0.0;
23052 # var red = Math.floor(redFrac * 255);
23053 # var green = Math.floor(greenFrac * 255);
23054 # var blue = Math.floor(blueFrac * 255);
23055 #
23056 # if (!('alpha' in rgb_color)) {
23057 # return rgbToCssColor_(red, green, blue);
23058 # }
23059 #
23060 # var alphaFrac = rgb_color.alpha.value || 0.0;
23061 # var rgbParams = [red, green, blue].join(',');
23062 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
23063 # };
23064 #
23065 # var rgbToCssColor_ = function(red, green, blue) {
23066 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
23067 # var hexString = rgbNumber.toString(16);
23068 # var missingZeros = 6 - hexString.length;
23069 # var resultBuilder = ['#'];
23070 # for (var i = 0; i < missingZeros; i++) {
23071 # resultBuilder.push('0');
23072 # }
23073 # resultBuilder.push(hexString);
23074 # return resultBuilder.join('');
23075 # };
23076 #
23077 # // ...
23078 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
23079 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
23080 # the final pixel color is defined by the equation:
23081 #
23082 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
23083 #
23084 # This means that a value of 1.0 corresponds to a solid color, whereas
23085 # a value of 0.0 corresponds to a completely transparent color. This
23086 # uses a wrapper message rather than a simple float scalar so that it is
23087 # possible to distinguish between a default value and the value being unset.
23088 # If omitted, this color object is to be rendered as a solid color
23089 # (as if the alpha value had been explicitly given with a value of 1.0).
23090 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
23091 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
23092 },
23093 "width": 42, # The width of the border, in pixels.
23094 # Border widths must be between 0 and 3 pixels.
23095 "style": "A String", # The style of the border.
23096 },
23097 "bottom": { # A border along a cell. # The bottom border of the cell.
23098 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
23099 # for simplicity of conversion to/from color representations in various
23100 # languages over compactness; for example, the fields of this representation
23101 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
23102 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
23103 # method in iOS; and, with just a little work, it can be easily formatted into
23104 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
23105 #
23106 # Example (Java):
23107 #
23108 # import com.google.type.Color;
23109 #
23110 # // ...
23111 # public static java.awt.Color fromProto(Color protocolor) {
23112 # float alpha = protocolor.hasAlpha()
23113 # ? protocolor.getAlpha().getValue()
23114 # : 1.0;
23115 #
23116 # return new java.awt.Color(
23117 # protocolor.getRed(),
23118 # protocolor.getGreen(),
23119 # protocolor.getBlue(),
23120 # alpha);
23121 # }
23122 #
23123 # public static Color toProto(java.awt.Color color) {
23124 # float red = (float) color.getRed();
23125 # float green = (float) color.getGreen();
23126 # float blue = (float) color.getBlue();
23127 # float denominator = 255.0;
23128 # Color.Builder resultBuilder =
23129 # Color
23130 # .newBuilder()
23131 # .setRed(red / denominator)
23132 # .setGreen(green / denominator)
23133 # .setBlue(blue / denominator);
23134 # int alpha = color.getAlpha();
23135 # if (alpha != 255) {
23136 # result.setAlpha(
23137 # FloatValue
23138 # .newBuilder()
23139 # .setValue(((float) alpha) / denominator)
23140 # .build());
23141 # }
23142 # return resultBuilder.build();
23143 # }
23144 # // ...
23145 #
23146 # Example (iOS / Obj-C):
23147 #
23148 # // ...
23149 # static UIColor* fromProto(Color* protocolor) {
23150 # float red = [protocolor red];
23151 # float green = [protocolor green];
23152 # float blue = [protocolor blue];
23153 # FloatValue* alpha_wrapper = [protocolor alpha];
23154 # float alpha = 1.0;
23155 # if (alpha_wrapper != nil) {
23156 # alpha = [alpha_wrapper value];
23157 # }
23158 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
23159 # }
23160 #
23161 # static Color* toProto(UIColor* color) {
23162 # CGFloat red, green, blue, alpha;
23163 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
23164 # return nil;
23165 # }
23166 # Color* result = [Color alloc] init];
23167 # [result setRed:red];
23168 # [result setGreen:green];
23169 # [result setBlue:blue];
23170 # if (alpha <= 0.9999) {
23171 # [result setAlpha:floatWrapperWithValue(alpha)];
23172 # }
23173 # [result autorelease];
23174 # return result;
23175 # }
23176 # // ...
23177 #
23178 # Example (JavaScript):
23179 #
23180 # // ...
23181 #
23182 # var protoToCssColor = function(rgb_color) {
23183 # var redFrac = rgb_color.red || 0.0;
23184 # var greenFrac = rgb_color.green || 0.0;
23185 # var blueFrac = rgb_color.blue || 0.0;
23186 # var red = Math.floor(redFrac * 255);
23187 # var green = Math.floor(greenFrac * 255);
23188 # var blue = Math.floor(blueFrac * 255);
23189 #
23190 # if (!('alpha' in rgb_color)) {
23191 # return rgbToCssColor_(red, green, blue);
23192 # }
23193 #
23194 # var alphaFrac = rgb_color.alpha.value || 0.0;
23195 # var rgbParams = [red, green, blue].join(',');
23196 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
23197 # };
23198 #
23199 # var rgbToCssColor_ = function(red, green, blue) {
23200 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
23201 # var hexString = rgbNumber.toString(16);
23202 # var missingZeros = 6 - hexString.length;
23203 # var resultBuilder = ['#'];
23204 # for (var i = 0; i < missingZeros; i++) {
23205 # resultBuilder.push('0');
23206 # }
23207 # resultBuilder.push(hexString);
23208 # return resultBuilder.join('');
23209 # };
23210 #
23211 # // ...
23212 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
23213 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
23214 # the final pixel color is defined by the equation:
23215 #
23216 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
23217 #
23218 # This means that a value of 1.0 corresponds to a solid color, whereas
23219 # a value of 0.0 corresponds to a completely transparent color. This
23220 # uses a wrapper message rather than a simple float scalar so that it is
23221 # possible to distinguish between a default value and the value being unset.
23222 # If omitted, this color object is to be rendered as a solid color
23223 # (as if the alpha value had been explicitly given with a value of 1.0).
23224 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
23225 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
23226 },
23227 "width": 42, # The width of the border, in pixels.
23228 # Border widths must be between 0 and 3 pixels.
23229 "style": "A String", # The style of the border.
23230 },
23231 "left": { # A border along a cell. # The left border of the cell.
23232 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
23233 # for simplicity of conversion to/from color representations in various
23234 # languages over compactness; for example, the fields of this representation
23235 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
23236 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
23237 # method in iOS; and, with just a little work, it can be easily formatted into
23238 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
23239 #
23240 # Example (Java):
23241 #
23242 # import com.google.type.Color;
23243 #
23244 # // ...
23245 # public static java.awt.Color fromProto(Color protocolor) {
23246 # float alpha = protocolor.hasAlpha()
23247 # ? protocolor.getAlpha().getValue()
23248 # : 1.0;
23249 #
23250 # return new java.awt.Color(
23251 # protocolor.getRed(),
23252 # protocolor.getGreen(),
23253 # protocolor.getBlue(),
23254 # alpha);
23255 # }
23256 #
23257 # public static Color toProto(java.awt.Color color) {
23258 # float red = (float) color.getRed();
23259 # float green = (float) color.getGreen();
23260 # float blue = (float) color.getBlue();
23261 # float denominator = 255.0;
23262 # Color.Builder resultBuilder =
23263 # Color
23264 # .newBuilder()
23265 # .setRed(red / denominator)
23266 # .setGreen(green / denominator)
23267 # .setBlue(blue / denominator);
23268 # int alpha = color.getAlpha();
23269 # if (alpha != 255) {
23270 # result.setAlpha(
23271 # FloatValue
23272 # .newBuilder()
23273 # .setValue(((float) alpha) / denominator)
23274 # .build());
23275 # }
23276 # return resultBuilder.build();
23277 # }
23278 # // ...
23279 #
23280 # Example (iOS / Obj-C):
23281 #
23282 # // ...
23283 # static UIColor* fromProto(Color* protocolor) {
23284 # float red = [protocolor red];
23285 # float green = [protocolor green];
23286 # float blue = [protocolor blue];
23287 # FloatValue* alpha_wrapper = [protocolor alpha];
23288 # float alpha = 1.0;
23289 # if (alpha_wrapper != nil) {
23290 # alpha = [alpha_wrapper value];
23291 # }
23292 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
23293 # }
23294 #
23295 # static Color* toProto(UIColor* color) {
23296 # CGFloat red, green, blue, alpha;
23297 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
23298 # return nil;
23299 # }
23300 # Color* result = [Color alloc] init];
23301 # [result setRed:red];
23302 # [result setGreen:green];
23303 # [result setBlue:blue];
23304 # if (alpha <= 0.9999) {
23305 # [result setAlpha:floatWrapperWithValue(alpha)];
23306 # }
23307 # [result autorelease];
23308 # return result;
23309 # }
23310 # // ...
23311 #
23312 # Example (JavaScript):
23313 #
23314 # // ...
23315 #
23316 # var protoToCssColor = function(rgb_color) {
23317 # var redFrac = rgb_color.red || 0.0;
23318 # var greenFrac = rgb_color.green || 0.0;
23319 # var blueFrac = rgb_color.blue || 0.0;
23320 # var red = Math.floor(redFrac * 255);
23321 # var green = Math.floor(greenFrac * 255);
23322 # var blue = Math.floor(blueFrac * 255);
23323 #
23324 # if (!('alpha' in rgb_color)) {
23325 # return rgbToCssColor_(red, green, blue);
23326 # }
23327 #
23328 # var alphaFrac = rgb_color.alpha.value || 0.0;
23329 # var rgbParams = [red, green, blue].join(',');
23330 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
23331 # };
23332 #
23333 # var rgbToCssColor_ = function(red, green, blue) {
23334 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
23335 # var hexString = rgbNumber.toString(16);
23336 # var missingZeros = 6 - hexString.length;
23337 # var resultBuilder = ['#'];
23338 # for (var i = 0; i < missingZeros; i++) {
23339 # resultBuilder.push('0');
23340 # }
23341 # resultBuilder.push(hexString);
23342 # return resultBuilder.join('');
23343 # };
23344 #
23345 # // ...
23346 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
23347 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
23348 # the final pixel color is defined by the equation:
23349 #
23350 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
23351 #
23352 # This means that a value of 1.0 corresponds to a solid color, whereas
23353 # a value of 0.0 corresponds to a completely transparent color. This
23354 # uses a wrapper message rather than a simple float scalar so that it is
23355 # possible to distinguish between a default value and the value being unset.
23356 # If omitted, this color object is to be rendered as a solid color
23357 # (as if the alpha value had been explicitly given with a value of 1.0).
23358 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
23359 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
23360 },
23361 "width": 42, # The width of the border, in pixels.
23362 # Border widths must be between 0 and 3 pixels.
23363 "style": "A String", # The style of the border.
23364 },
23365 },
23366 "wrapStrategy": "A String", # The wrap strategy for the value in the cell.
23367 },
23368 "dataValidation": { # A data validation rule. # A data validation rule on the cell, if any.
23369 #
23370 # When writing, the new data validation rule will overwrite any prior rule.
23371 "showCustomUi": True or False, # True if the UI should be customized based on the kind of condition.
23372 # If true, "List" conditions will show a dropdown.
23373 "strict": True or False, # True if invalid data should be rejected.
23374 "inputMessage": "A String", # A message to show the user when adding data to the cell.
23375 "condition": { # A condition that can evaluate to true or false. # The condition that data in the cell must match.
23376 # BooleanConditions are used by conditional formatting,
23377 # data validation, and the criteria in filters.
23378 "type": "A String", # The type of condition.
23379 "values": [ # The values of the condition. The number of supported values depends
23380 # on the condition type. Some support zero values,
23381 # others one or two values,
23382 # and ConditionType.ONE_OF_LIST supports an arbitrary number of values.
23383 { # The value of the condition.
23384 "relativeDate": "A String", # A relative date (based on the current date).
23385 # Valid only if the type is
23386 # DATE_BEFORE,
23387 # DATE_AFTER,
23388 # DATE_ON_OR_BEFORE or
23389 # DATE_ON_OR_AFTER.
23390 #
23391 # Relative dates are not supported in data validation.
23392 # They are supported only in conditional formatting and
23393 # conditional filters.
23394 "userEnteredValue": "A String", # A value the condition is based on.
23395 # The value will be parsed as if the user typed into a cell.
23396 # Formulas are supported (and must begin with an `=`).
23397 },
23398 ],
23399 },
23400 },
23401 "textFormatRuns": [ # Runs of rich text applied to subsections of the cell.
23402 # Runs start at specific indexes in the text and continue until the next
23403 # run. Properties of a run will continue unless explicitly changed
23404 # in a subsequent run (and properties of the first run will continue
23405 # the properties of the cell unless explicitly changed).
23406 #
23407 # When writing, the new runs will overwrite any prior runs.
23408 { # A run of a text format. The format of this run continues until explicitly
23409 # overridden in the next run.
23410 # When updating, all fields must be set.
23411 "startIndex": 42, # The character index where this run starts.
23412 "format": { # The format of a run of text in a cell. # The format of this run. Absent values inherit the cell's format.
23413 # Absent values indicate that the field isn't specified.
23414 "foregroundColor": { # Represents a color in the RGBA color space. This representation is designed # The foreground color of the text.
23415 # for simplicity of conversion to/from color representations in various
23416 # languages over compactness; for example, the fields of this representation
23417 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
23418 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
23419 # method in iOS; and, with just a little work, it can be easily formatted into
23420 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
23421 #
23422 # Example (Java):
23423 #
23424 # import com.google.type.Color;
23425 #
23426 # // ...
23427 # public static java.awt.Color fromProto(Color protocolor) {
23428 # float alpha = protocolor.hasAlpha()
23429 # ? protocolor.getAlpha().getValue()
23430 # : 1.0;
23431 #
23432 # return new java.awt.Color(
23433 # protocolor.getRed(),
23434 # protocolor.getGreen(),
23435 # protocolor.getBlue(),
23436 # alpha);
23437 # }
23438 #
23439 # public static Color toProto(java.awt.Color color) {
23440 # float red = (float) color.getRed();
23441 # float green = (float) color.getGreen();
23442 # float blue = (float) color.getBlue();
23443 # float denominator = 255.0;
23444 # Color.Builder resultBuilder =
23445 # Color
23446 # .newBuilder()
23447 # .setRed(red / denominator)
23448 # .setGreen(green / denominator)
23449 # .setBlue(blue / denominator);
23450 # int alpha = color.getAlpha();
23451 # if (alpha != 255) {
23452 # result.setAlpha(
23453 # FloatValue
23454 # .newBuilder()
23455 # .setValue(((float) alpha) / denominator)
23456 # .build());
23457 # }
23458 # return resultBuilder.build();
23459 # }
23460 # // ...
23461 #
23462 # Example (iOS / Obj-C):
23463 #
23464 # // ...
23465 # static UIColor* fromProto(Color* protocolor) {
23466 # float red = [protocolor red];
23467 # float green = [protocolor green];
23468 # float blue = [protocolor blue];
23469 # FloatValue* alpha_wrapper = [protocolor alpha];
23470 # float alpha = 1.0;
23471 # if (alpha_wrapper != nil) {
23472 # alpha = [alpha_wrapper value];
23473 # }
23474 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
23475 # }
23476 #
23477 # static Color* toProto(UIColor* color) {
23478 # CGFloat red, green, blue, alpha;
23479 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
23480 # return nil;
23481 # }
23482 # Color* result = [Color alloc] init];
23483 # [result setRed:red];
23484 # [result setGreen:green];
23485 # [result setBlue:blue];
23486 # if (alpha <= 0.9999) {
23487 # [result setAlpha:floatWrapperWithValue(alpha)];
23488 # }
23489 # [result autorelease];
23490 # return result;
23491 # }
23492 # // ...
23493 #
23494 # Example (JavaScript):
23495 #
23496 # // ...
23497 #
23498 # var protoToCssColor = function(rgb_color) {
23499 # var redFrac = rgb_color.red || 0.0;
23500 # var greenFrac = rgb_color.green || 0.0;
23501 # var blueFrac = rgb_color.blue || 0.0;
23502 # var red = Math.floor(redFrac * 255);
23503 # var green = Math.floor(greenFrac * 255);
23504 # var blue = Math.floor(blueFrac * 255);
23505 #
23506 # if (!('alpha' in rgb_color)) {
23507 # return rgbToCssColor_(red, green, blue);
23508 # }
23509 #
23510 # var alphaFrac = rgb_color.alpha.value || 0.0;
23511 # var rgbParams = [red, green, blue].join(',');
23512 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
23513 # };
23514 #
23515 # var rgbToCssColor_ = function(red, green, blue) {
23516 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
23517 # var hexString = rgbNumber.toString(16);
23518 # var missingZeros = 6 - hexString.length;
23519 # var resultBuilder = ['#'];
23520 # for (var i = 0; i < missingZeros; i++) {
23521 # resultBuilder.push('0');
23522 # }
23523 # resultBuilder.push(hexString);
23524 # return resultBuilder.join('');
23525 # };
23526 #
23527 # // ...
23528 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
23529 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
23530 # the final pixel color is defined by the equation:
23531 #
23532 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
23533 #
23534 # This means that a value of 1.0 corresponds to a solid color, whereas
23535 # a value of 0.0 corresponds to a completely transparent color. This
23536 # uses a wrapper message rather than a simple float scalar so that it is
23537 # possible to distinguish between a default value and the value being unset.
23538 # If omitted, this color object is to be rendered as a solid color
23539 # (as if the alpha value had been explicitly given with a value of 1.0).
23540 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
23541 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
23542 },
23543 "bold": True or False, # True if the text is bold.
23544 "strikethrough": True or False, # True if the text has a strikethrough.
23545 "fontFamily": "A String", # The font family.
23546 "fontSize": 42, # The size of the font.
23547 "italic": True or False, # True if the text is italicized.
23548 "underline": True or False, # True if the text is underlined.
23549 },
23550 },
23551 ],
23552 },
23553 ],
23554 },
23555 ],
23556 },
23557 ],
23558 "properties": { # Properties of a sheet. # The properties of the sheet.
23559 "sheetType": "A String", # The type of sheet. Defaults to GRID.
23560 # This field cannot be changed once set.
23561 "index": 42, # The index of the sheet within the spreadsheet.
23562 # When adding or updating sheet properties, if this field
23563 # is excluded then the sheet will be added or moved to the end
23564 # of the sheet list.
23565 "title": "A String", # The name of the sheet.
23566 "gridProperties": { # Properties of a grid. # Additional properties of the sheet if this sheet is a grid.
23567 # (If the sheet is an object sheet, containing a chart or image, then
23568 # this field will be absent.)
23569 # When writing it is an error to set any grid properties on non-grid sheets.
23570 "columnCount": 42, # The number of columns in the grid.
23571 "rowCount": 42, # The number of rows in the grid.
23572 "frozenColumnCount": 42, # The number of columns that are frozen in the grid.
23573 "hideGridlines": True or False, # True if the grid isn't showing gridlines in the UI.
23574 "frozenRowCount": 42, # The number of rows that are frozen in the grid.
23575 },
23576 "rightToLeft": True or False, # True if the sheet is an RTL sheet instead of an LTR sheet.
23577 "tabColor": { # Represents a color in the RGBA color space. This representation is designed # The color of the tab in the UI.
23578 # for simplicity of conversion to/from color representations in various
23579 # languages over compactness; for example, the fields of this representation
23580 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
23581 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
23582 # method in iOS; and, with just a little work, it can be easily formatted into
23583 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
23584 #
23585 # Example (Java):
23586 #
23587 # import com.google.type.Color;
23588 #
23589 # // ...
23590 # public static java.awt.Color fromProto(Color protocolor) {
23591 # float alpha = protocolor.hasAlpha()
23592 # ? protocolor.getAlpha().getValue()
23593 # : 1.0;
23594 #
23595 # return new java.awt.Color(
23596 # protocolor.getRed(),
23597 # protocolor.getGreen(),
23598 # protocolor.getBlue(),
23599 # alpha);
23600 # }
23601 #
23602 # public static Color toProto(java.awt.Color color) {
23603 # float red = (float) color.getRed();
23604 # float green = (float) color.getGreen();
23605 # float blue = (float) color.getBlue();
23606 # float denominator = 255.0;
23607 # Color.Builder resultBuilder =
23608 # Color
23609 # .newBuilder()
23610 # .setRed(red / denominator)
23611 # .setGreen(green / denominator)
23612 # .setBlue(blue / denominator);
23613 # int alpha = color.getAlpha();
23614 # if (alpha != 255) {
23615 # result.setAlpha(
23616 # FloatValue
23617 # .newBuilder()
23618 # .setValue(((float) alpha) / denominator)
23619 # .build());
23620 # }
23621 # return resultBuilder.build();
23622 # }
23623 # // ...
23624 #
23625 # Example (iOS / Obj-C):
23626 #
23627 # // ...
23628 # static UIColor* fromProto(Color* protocolor) {
23629 # float red = [protocolor red];
23630 # float green = [protocolor green];
23631 # float blue = [protocolor blue];
23632 # FloatValue* alpha_wrapper = [protocolor alpha];
23633 # float alpha = 1.0;
23634 # if (alpha_wrapper != nil) {
23635 # alpha = [alpha_wrapper value];
23636 # }
23637 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
23638 # }
23639 #
23640 # static Color* toProto(UIColor* color) {
23641 # CGFloat red, green, blue, alpha;
23642 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
23643 # return nil;
23644 # }
23645 # Color* result = [Color alloc] init];
23646 # [result setRed:red];
23647 # [result setGreen:green];
23648 # [result setBlue:blue];
23649 # if (alpha <= 0.9999) {
23650 # [result setAlpha:floatWrapperWithValue(alpha)];
23651 # }
23652 # [result autorelease];
23653 # return result;
23654 # }
23655 # // ...
23656 #
23657 # Example (JavaScript):
23658 #
23659 # // ...
23660 #
23661 # var protoToCssColor = function(rgb_color) {
23662 # var redFrac = rgb_color.red || 0.0;
23663 # var greenFrac = rgb_color.green || 0.0;
23664 # var blueFrac = rgb_color.blue || 0.0;
23665 # var red = Math.floor(redFrac * 255);
23666 # var green = Math.floor(greenFrac * 255);
23667 # var blue = Math.floor(blueFrac * 255);
23668 #
23669 # if (!('alpha' in rgb_color)) {
23670 # return rgbToCssColor_(red, green, blue);
23671 # }
23672 #
23673 # var alphaFrac = rgb_color.alpha.value || 0.0;
23674 # var rgbParams = [red, green, blue].join(',');
23675 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
23676 # };
23677 #
23678 # var rgbToCssColor_ = function(red, green, blue) {
23679 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
23680 # var hexString = rgbNumber.toString(16);
23681 # var missingZeros = 6 - hexString.length;
23682 # var resultBuilder = ['#'];
23683 # for (var i = 0; i < missingZeros; i++) {
23684 # resultBuilder.push('0');
23685 # }
23686 # resultBuilder.push(hexString);
23687 # return resultBuilder.join('');
23688 # };
23689 #
23690 # // ...
23691 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
23692 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
23693 # the final pixel color is defined by the equation:
23694 #
23695 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
23696 #
23697 # This means that a value of 1.0 corresponds to a solid color, whereas
23698 # a value of 0.0 corresponds to a completely transparent color. This
23699 # uses a wrapper message rather than a simple float scalar so that it is
23700 # possible to distinguish between a default value and the value being unset.
23701 # If omitted, this color object is to be rendered as a solid color
23702 # (as if the alpha value had been explicitly given with a value of 1.0).
23703 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
23704 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
23705 },
23706 "hidden": True or False, # True if the sheet is hidden in the UI, false if it's visible.
23707 "sheetId": 42, # The ID of the sheet. Must be non-negative.
23708 # This field cannot be changed once set.
23709 },
23710 },
23711 ],
23712 }
23713
23714 x__xgafv: string, V1 error format.
23715 Allowed values
23716 1 - v1 error format
23717 2 - v2 error format
23718
23719Returns:
23720 An object of the form:
23721
23722 { # Resource that represents a spreadsheet.
23723 "spreadsheetId": "A String", # The ID of the spreadsheet.
23724 # This field is read-only.
23725 "namedRanges": [ # The named ranges defined in a spreadsheet.
23726 { # A named range.
23727 "namedRangeId": "A String", # The ID of the named range.
23728 "range": { # A range on a sheet. # The range this represents.
23729 # All indexes are zero-based.
23730 # Indexes are half open, e.g the start index is inclusive
23731 # and the end index is exclusive -- [start_index, end_index).
23732 # Missing indexes indicate the range is unbounded on that side.
23733 #
23734 # For example, if "Sheet1" is grid ID 0, then:
23735 #
23736 # Sheet1!A1:A1 == sheet_id: 0,
23737 # start_row_index: 0, end_row_index: 1,
23738 # start_column_index: 0, end_column_index: 1
23739 #
23740 # Sheet1!A3:B4 == sheet_id: 0,
23741 # start_row_index: 2, end_row_index: 4,
23742 # start_column_index: 0, end_column_index: 2
23743 #
23744 # Sheet1!A:B == sheet_id: 0,
23745 # start_column_index: 0, end_column_index: 2
23746 #
23747 # Sheet1!A5:B == sheet_id: 0,
23748 # start_row_index: 4,
23749 # start_column_index: 0, end_column_index: 2
23750 #
23751 # Sheet1 == sheet_id:0
23752 #
23753 # The start index must always be less than or equal to the end index.
23754 # If the start index equals the end index, then the range is empty.
23755 # Empty ranges are typically not meaningful and are usually rendered in the
23756 # UI as `#REF!`.
23757 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
23758 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
23759 "sheetId": 42, # The sheet this range is on.
23760 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
23761 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
23762 },
23763 "name": "A String", # The name of the named range.
23764 },
23765 ],
23766 "properties": { # Properties of a spreadsheet. # Overall properties of a spreadsheet.
23767 "locale": "A String", # The locale of the spreadsheet in one of the following formats:
23768 # * an ISO 639-1 language code such as `en`
23769 # * an ISO 639-2 language code such as `fil`, if no 639-1 code exists
23770 # * a combination of the ISO language code and country code, such as `en_US`
23771 # Note: when updating this field, not all locales/languages are supported.
23772 "timeZone": "A String", # The time zone of the spreadsheet, in CLDR format such as
23773 # `America/New_York`. If the time zone isn't recognized, this may
23774 # be a custom time zone such as `GMT-07:00`.
23775 "autoRecalc": "A String", # The amount of time to wait before volatile functions are recalculated.
23776 "defaultFormat": { # The format of a cell. # The default format of all cells in the spreadsheet.
23777 # CellData.effectiveFormat will not be set if the cell's format is equal
23778 # to this default format.
23779 # This field is read-only.
23780 "numberFormat": { # The number format of a cell. # A format describing how number values should be represented to the user.
23781 # When updating, all fields must be set.
23782 "pattern": "A String", # Pattern string used for formatting.
23783 "type": "A String", # The type of the number format.
23784 },
23785 "textDirection": "A String", # The direction of the text in the cell.
23786 "padding": { # The amount of padding around the cell, in pixels. # The padding of the cell.
23787 # When updating padding, every field must be specified.
23788 "top": 42, # The top padding of the cell.
23789 "right": 42, # The right padding of the cell.
23790 "bottom": 42, # The bottom padding of the cell.
23791 "left": 42, # The left padding of the cell.
23792 },
23793 "horizontalAlignment": "A String", # The horizontal alignment of the value in cell.
23794 "backgroundColor": { # Represents a color in the RGBA color space. This representation is designed # The background color of the cell.
23795 # for simplicity of conversion to/from color representations in various
23796 # languages over compactness; for example, the fields of this representation
23797 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
23798 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
23799 # method in iOS; and, with just a little work, it can be easily formatted into
23800 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
23801 #
23802 # Example (Java):
23803 #
23804 # import com.google.type.Color;
23805 #
23806 # // ...
23807 # public static java.awt.Color fromProto(Color protocolor) {
23808 # float alpha = protocolor.hasAlpha()
23809 # ? protocolor.getAlpha().getValue()
23810 # : 1.0;
23811 #
23812 # return new java.awt.Color(
23813 # protocolor.getRed(),
23814 # protocolor.getGreen(),
23815 # protocolor.getBlue(),
23816 # alpha);
23817 # }
23818 #
23819 # public static Color toProto(java.awt.Color color) {
23820 # float red = (float) color.getRed();
23821 # float green = (float) color.getGreen();
23822 # float blue = (float) color.getBlue();
23823 # float denominator = 255.0;
23824 # Color.Builder resultBuilder =
23825 # Color
23826 # .newBuilder()
23827 # .setRed(red / denominator)
23828 # .setGreen(green / denominator)
23829 # .setBlue(blue / denominator);
23830 # int alpha = color.getAlpha();
23831 # if (alpha != 255) {
23832 # result.setAlpha(
23833 # FloatValue
23834 # .newBuilder()
23835 # .setValue(((float) alpha) / denominator)
23836 # .build());
23837 # }
23838 # return resultBuilder.build();
23839 # }
23840 # // ...
23841 #
23842 # Example (iOS / Obj-C):
23843 #
23844 # // ...
23845 # static UIColor* fromProto(Color* protocolor) {
23846 # float red = [protocolor red];
23847 # float green = [protocolor green];
23848 # float blue = [protocolor blue];
23849 # FloatValue* alpha_wrapper = [protocolor alpha];
23850 # float alpha = 1.0;
23851 # if (alpha_wrapper != nil) {
23852 # alpha = [alpha_wrapper value];
23853 # }
23854 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
23855 # }
23856 #
23857 # static Color* toProto(UIColor* color) {
23858 # CGFloat red, green, blue, alpha;
23859 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
23860 # return nil;
23861 # }
23862 # Color* result = [Color alloc] init];
23863 # [result setRed:red];
23864 # [result setGreen:green];
23865 # [result setBlue:blue];
23866 # if (alpha <= 0.9999) {
23867 # [result setAlpha:floatWrapperWithValue(alpha)];
23868 # }
23869 # [result autorelease];
23870 # return result;
23871 # }
23872 # // ...
23873 #
23874 # Example (JavaScript):
23875 #
23876 # // ...
23877 #
23878 # var protoToCssColor = function(rgb_color) {
23879 # var redFrac = rgb_color.red || 0.0;
23880 # var greenFrac = rgb_color.green || 0.0;
23881 # var blueFrac = rgb_color.blue || 0.0;
23882 # var red = Math.floor(redFrac * 255);
23883 # var green = Math.floor(greenFrac * 255);
23884 # var blue = Math.floor(blueFrac * 255);
23885 #
23886 # if (!('alpha' in rgb_color)) {
23887 # return rgbToCssColor_(red, green, blue);
23888 # }
23889 #
23890 # var alphaFrac = rgb_color.alpha.value || 0.0;
23891 # var rgbParams = [red, green, blue].join(',');
23892 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
23893 # };
23894 #
23895 # var rgbToCssColor_ = function(red, green, blue) {
23896 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
23897 # var hexString = rgbNumber.toString(16);
23898 # var missingZeros = 6 - hexString.length;
23899 # var resultBuilder = ['#'];
23900 # for (var i = 0; i < missingZeros; i++) {
23901 # resultBuilder.push('0');
23902 # }
23903 # resultBuilder.push(hexString);
23904 # return resultBuilder.join('');
23905 # };
23906 #
23907 # // ...
23908 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
23909 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
23910 # the final pixel color is defined by the equation:
23911 #
23912 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
23913 #
23914 # This means that a value of 1.0 corresponds to a solid color, whereas
23915 # a value of 0.0 corresponds to a completely transparent color. This
23916 # uses a wrapper message rather than a simple float scalar so that it is
23917 # possible to distinguish between a default value and the value being unset.
23918 # If omitted, this color object is to be rendered as a solid color
23919 # (as if the alpha value had been explicitly given with a value of 1.0).
23920 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
23921 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
23922 },
23923 "verticalAlignment": "A String", # The vertical alignment of the value in cell.
23924 "textFormat": { # The format of a run of text in a cell. # The format of the text in the cell (unless overridden by a format run).
23925 # Absent values indicate that the field isn't specified.
23926 "foregroundColor": { # Represents a color in the RGBA color space. This representation is designed # The foreground color of the text.
23927 # for simplicity of conversion to/from color representations in various
23928 # languages over compactness; for example, the fields of this representation
23929 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
23930 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
23931 # method in iOS; and, with just a little work, it can be easily formatted into
23932 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
23933 #
23934 # Example (Java):
23935 #
23936 # import com.google.type.Color;
23937 #
23938 # // ...
23939 # public static java.awt.Color fromProto(Color protocolor) {
23940 # float alpha = protocolor.hasAlpha()
23941 # ? protocolor.getAlpha().getValue()
23942 # : 1.0;
23943 #
23944 # return new java.awt.Color(
23945 # protocolor.getRed(),
23946 # protocolor.getGreen(),
23947 # protocolor.getBlue(),
23948 # alpha);
23949 # }
23950 #
23951 # public static Color toProto(java.awt.Color color) {
23952 # float red = (float) color.getRed();
23953 # float green = (float) color.getGreen();
23954 # float blue = (float) color.getBlue();
23955 # float denominator = 255.0;
23956 # Color.Builder resultBuilder =
23957 # Color
23958 # .newBuilder()
23959 # .setRed(red / denominator)
23960 # .setGreen(green / denominator)
23961 # .setBlue(blue / denominator);
23962 # int alpha = color.getAlpha();
23963 # if (alpha != 255) {
23964 # result.setAlpha(
23965 # FloatValue
23966 # .newBuilder()
23967 # .setValue(((float) alpha) / denominator)
23968 # .build());
23969 # }
23970 # return resultBuilder.build();
23971 # }
23972 # // ...
23973 #
23974 # Example (iOS / Obj-C):
23975 #
23976 # // ...
23977 # static UIColor* fromProto(Color* protocolor) {
23978 # float red = [protocolor red];
23979 # float green = [protocolor green];
23980 # float blue = [protocolor blue];
23981 # FloatValue* alpha_wrapper = [protocolor alpha];
23982 # float alpha = 1.0;
23983 # if (alpha_wrapper != nil) {
23984 # alpha = [alpha_wrapper value];
23985 # }
23986 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
23987 # }
23988 #
23989 # static Color* toProto(UIColor* color) {
23990 # CGFloat red, green, blue, alpha;
23991 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
23992 # return nil;
23993 # }
23994 # Color* result = [Color alloc] init];
23995 # [result setRed:red];
23996 # [result setGreen:green];
23997 # [result setBlue:blue];
23998 # if (alpha <= 0.9999) {
23999 # [result setAlpha:floatWrapperWithValue(alpha)];
24000 # }
24001 # [result autorelease];
24002 # return result;
24003 # }
24004 # // ...
24005 #
24006 # Example (JavaScript):
24007 #
24008 # // ...
24009 #
24010 # var protoToCssColor = function(rgb_color) {
24011 # var redFrac = rgb_color.red || 0.0;
24012 # var greenFrac = rgb_color.green || 0.0;
24013 # var blueFrac = rgb_color.blue || 0.0;
24014 # var red = Math.floor(redFrac * 255);
24015 # var green = Math.floor(greenFrac * 255);
24016 # var blue = Math.floor(blueFrac * 255);
24017 #
24018 # if (!('alpha' in rgb_color)) {
24019 # return rgbToCssColor_(red, green, blue);
24020 # }
24021 #
24022 # var alphaFrac = rgb_color.alpha.value || 0.0;
24023 # var rgbParams = [red, green, blue].join(',');
24024 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
24025 # };
24026 #
24027 # var rgbToCssColor_ = function(red, green, blue) {
24028 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
24029 # var hexString = rgbNumber.toString(16);
24030 # var missingZeros = 6 - hexString.length;
24031 # var resultBuilder = ['#'];
24032 # for (var i = 0; i < missingZeros; i++) {
24033 # resultBuilder.push('0');
24034 # }
24035 # resultBuilder.push(hexString);
24036 # return resultBuilder.join('');
24037 # };
24038 #
24039 # // ...
24040 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
24041 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
24042 # the final pixel color is defined by the equation:
24043 #
24044 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
24045 #
24046 # This means that a value of 1.0 corresponds to a solid color, whereas
24047 # a value of 0.0 corresponds to a completely transparent color. This
24048 # uses a wrapper message rather than a simple float scalar so that it is
24049 # possible to distinguish between a default value and the value being unset.
24050 # If omitted, this color object is to be rendered as a solid color
24051 # (as if the alpha value had been explicitly given with a value of 1.0).
24052 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
24053 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
24054 },
24055 "bold": True or False, # True if the text is bold.
24056 "strikethrough": True or False, # True if the text has a strikethrough.
24057 "fontFamily": "A String", # The font family.
24058 "fontSize": 42, # The size of the font.
24059 "italic": True or False, # True if the text is italicized.
24060 "underline": True or False, # True if the text is underlined.
24061 },
24062 "hyperlinkDisplayType": "A String", # How a hyperlink, if it exists, should be displayed in the cell.
24063 "borders": { # The borders of the cell. # The borders of the cell.
24064 "top": { # A border along a cell. # The top border of the cell.
24065 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
24066 # for simplicity of conversion to/from color representations in various
24067 # languages over compactness; for example, the fields of this representation
24068 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
24069 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
24070 # method in iOS; and, with just a little work, it can be easily formatted into
24071 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
24072 #
24073 # Example (Java):
24074 #
24075 # import com.google.type.Color;
24076 #
24077 # // ...
24078 # public static java.awt.Color fromProto(Color protocolor) {
24079 # float alpha = protocolor.hasAlpha()
24080 # ? protocolor.getAlpha().getValue()
24081 # : 1.0;
24082 #
24083 # return new java.awt.Color(
24084 # protocolor.getRed(),
24085 # protocolor.getGreen(),
24086 # protocolor.getBlue(),
24087 # alpha);
24088 # }
24089 #
24090 # public static Color toProto(java.awt.Color color) {
24091 # float red = (float) color.getRed();
24092 # float green = (float) color.getGreen();
24093 # float blue = (float) color.getBlue();
24094 # float denominator = 255.0;
24095 # Color.Builder resultBuilder =
24096 # Color
24097 # .newBuilder()
24098 # .setRed(red / denominator)
24099 # .setGreen(green / denominator)
24100 # .setBlue(blue / denominator);
24101 # int alpha = color.getAlpha();
24102 # if (alpha != 255) {
24103 # result.setAlpha(
24104 # FloatValue
24105 # .newBuilder()
24106 # .setValue(((float) alpha) / denominator)
24107 # .build());
24108 # }
24109 # return resultBuilder.build();
24110 # }
24111 # // ...
24112 #
24113 # Example (iOS / Obj-C):
24114 #
24115 # // ...
24116 # static UIColor* fromProto(Color* protocolor) {
24117 # float red = [protocolor red];
24118 # float green = [protocolor green];
24119 # float blue = [protocolor blue];
24120 # FloatValue* alpha_wrapper = [protocolor alpha];
24121 # float alpha = 1.0;
24122 # if (alpha_wrapper != nil) {
24123 # alpha = [alpha_wrapper value];
24124 # }
24125 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
24126 # }
24127 #
24128 # static Color* toProto(UIColor* color) {
24129 # CGFloat red, green, blue, alpha;
24130 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
24131 # return nil;
24132 # }
24133 # Color* result = [Color alloc] init];
24134 # [result setRed:red];
24135 # [result setGreen:green];
24136 # [result setBlue:blue];
24137 # if (alpha <= 0.9999) {
24138 # [result setAlpha:floatWrapperWithValue(alpha)];
24139 # }
24140 # [result autorelease];
24141 # return result;
24142 # }
24143 # // ...
24144 #
24145 # Example (JavaScript):
24146 #
24147 # // ...
24148 #
24149 # var protoToCssColor = function(rgb_color) {
24150 # var redFrac = rgb_color.red || 0.0;
24151 # var greenFrac = rgb_color.green || 0.0;
24152 # var blueFrac = rgb_color.blue || 0.0;
24153 # var red = Math.floor(redFrac * 255);
24154 # var green = Math.floor(greenFrac * 255);
24155 # var blue = Math.floor(blueFrac * 255);
24156 #
24157 # if (!('alpha' in rgb_color)) {
24158 # return rgbToCssColor_(red, green, blue);
24159 # }
24160 #
24161 # var alphaFrac = rgb_color.alpha.value || 0.0;
24162 # var rgbParams = [red, green, blue].join(',');
24163 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
24164 # };
24165 #
24166 # var rgbToCssColor_ = function(red, green, blue) {
24167 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
24168 # var hexString = rgbNumber.toString(16);
24169 # var missingZeros = 6 - hexString.length;
24170 # var resultBuilder = ['#'];
24171 # for (var i = 0; i < missingZeros; i++) {
24172 # resultBuilder.push('0');
24173 # }
24174 # resultBuilder.push(hexString);
24175 # return resultBuilder.join('');
24176 # };
24177 #
24178 # // ...
24179 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
24180 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
24181 # the final pixel color is defined by the equation:
24182 #
24183 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
24184 #
24185 # This means that a value of 1.0 corresponds to a solid color, whereas
24186 # a value of 0.0 corresponds to a completely transparent color. This
24187 # uses a wrapper message rather than a simple float scalar so that it is
24188 # possible to distinguish between a default value and the value being unset.
24189 # If omitted, this color object is to be rendered as a solid color
24190 # (as if the alpha value had been explicitly given with a value of 1.0).
24191 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
24192 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
24193 },
24194 "width": 42, # The width of the border, in pixels.
24195 # Border widths must be between 0 and 3 pixels.
24196 "style": "A String", # The style of the border.
24197 },
24198 "right": { # A border along a cell. # The right border of the cell.
24199 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
24200 # for simplicity of conversion to/from color representations in various
24201 # languages over compactness; for example, the fields of this representation
24202 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
24203 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
24204 # method in iOS; and, with just a little work, it can be easily formatted into
24205 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
24206 #
24207 # Example (Java):
24208 #
24209 # import com.google.type.Color;
24210 #
24211 # // ...
24212 # public static java.awt.Color fromProto(Color protocolor) {
24213 # float alpha = protocolor.hasAlpha()
24214 # ? protocolor.getAlpha().getValue()
24215 # : 1.0;
24216 #
24217 # return new java.awt.Color(
24218 # protocolor.getRed(),
24219 # protocolor.getGreen(),
24220 # protocolor.getBlue(),
24221 # alpha);
24222 # }
24223 #
24224 # public static Color toProto(java.awt.Color color) {
24225 # float red = (float) color.getRed();
24226 # float green = (float) color.getGreen();
24227 # float blue = (float) color.getBlue();
24228 # float denominator = 255.0;
24229 # Color.Builder resultBuilder =
24230 # Color
24231 # .newBuilder()
24232 # .setRed(red / denominator)
24233 # .setGreen(green / denominator)
24234 # .setBlue(blue / denominator);
24235 # int alpha = color.getAlpha();
24236 # if (alpha != 255) {
24237 # result.setAlpha(
24238 # FloatValue
24239 # .newBuilder()
24240 # .setValue(((float) alpha) / denominator)
24241 # .build());
24242 # }
24243 # return resultBuilder.build();
24244 # }
24245 # // ...
24246 #
24247 # Example (iOS / Obj-C):
24248 #
24249 # // ...
24250 # static UIColor* fromProto(Color* protocolor) {
24251 # float red = [protocolor red];
24252 # float green = [protocolor green];
24253 # float blue = [protocolor blue];
24254 # FloatValue* alpha_wrapper = [protocolor alpha];
24255 # float alpha = 1.0;
24256 # if (alpha_wrapper != nil) {
24257 # alpha = [alpha_wrapper value];
24258 # }
24259 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
24260 # }
24261 #
24262 # static Color* toProto(UIColor* color) {
24263 # CGFloat red, green, blue, alpha;
24264 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
24265 # return nil;
24266 # }
24267 # Color* result = [Color alloc] init];
24268 # [result setRed:red];
24269 # [result setGreen:green];
24270 # [result setBlue:blue];
24271 # if (alpha <= 0.9999) {
24272 # [result setAlpha:floatWrapperWithValue(alpha)];
24273 # }
24274 # [result autorelease];
24275 # return result;
24276 # }
24277 # // ...
24278 #
24279 # Example (JavaScript):
24280 #
24281 # // ...
24282 #
24283 # var protoToCssColor = function(rgb_color) {
24284 # var redFrac = rgb_color.red || 0.0;
24285 # var greenFrac = rgb_color.green || 0.0;
24286 # var blueFrac = rgb_color.blue || 0.0;
24287 # var red = Math.floor(redFrac * 255);
24288 # var green = Math.floor(greenFrac * 255);
24289 # var blue = Math.floor(blueFrac * 255);
24290 #
24291 # if (!('alpha' in rgb_color)) {
24292 # return rgbToCssColor_(red, green, blue);
24293 # }
24294 #
24295 # var alphaFrac = rgb_color.alpha.value || 0.0;
24296 # var rgbParams = [red, green, blue].join(',');
24297 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
24298 # };
24299 #
24300 # var rgbToCssColor_ = function(red, green, blue) {
24301 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
24302 # var hexString = rgbNumber.toString(16);
24303 # var missingZeros = 6 - hexString.length;
24304 # var resultBuilder = ['#'];
24305 # for (var i = 0; i < missingZeros; i++) {
24306 # resultBuilder.push('0');
24307 # }
24308 # resultBuilder.push(hexString);
24309 # return resultBuilder.join('');
24310 # };
24311 #
24312 # // ...
24313 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
24314 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
24315 # the final pixel color is defined by the equation:
24316 #
24317 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
24318 #
24319 # This means that a value of 1.0 corresponds to a solid color, whereas
24320 # a value of 0.0 corresponds to a completely transparent color. This
24321 # uses a wrapper message rather than a simple float scalar so that it is
24322 # possible to distinguish between a default value and the value being unset.
24323 # If omitted, this color object is to be rendered as a solid color
24324 # (as if the alpha value had been explicitly given with a value of 1.0).
24325 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
24326 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
24327 },
24328 "width": 42, # The width of the border, in pixels.
24329 # Border widths must be between 0 and 3 pixels.
24330 "style": "A String", # The style of the border.
24331 },
24332 "bottom": { # A border along a cell. # The bottom border of the cell.
24333 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
24334 # for simplicity of conversion to/from color representations in various
24335 # languages over compactness; for example, the fields of this representation
24336 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
24337 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
24338 # method in iOS; and, with just a little work, it can be easily formatted into
24339 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
24340 #
24341 # Example (Java):
24342 #
24343 # import com.google.type.Color;
24344 #
24345 # // ...
24346 # public static java.awt.Color fromProto(Color protocolor) {
24347 # float alpha = protocolor.hasAlpha()
24348 # ? protocolor.getAlpha().getValue()
24349 # : 1.0;
24350 #
24351 # return new java.awt.Color(
24352 # protocolor.getRed(),
24353 # protocolor.getGreen(),
24354 # protocolor.getBlue(),
24355 # alpha);
24356 # }
24357 #
24358 # public static Color toProto(java.awt.Color color) {
24359 # float red = (float) color.getRed();
24360 # float green = (float) color.getGreen();
24361 # float blue = (float) color.getBlue();
24362 # float denominator = 255.0;
24363 # Color.Builder resultBuilder =
24364 # Color
24365 # .newBuilder()
24366 # .setRed(red / denominator)
24367 # .setGreen(green / denominator)
24368 # .setBlue(blue / denominator);
24369 # int alpha = color.getAlpha();
24370 # if (alpha != 255) {
24371 # result.setAlpha(
24372 # FloatValue
24373 # .newBuilder()
24374 # .setValue(((float) alpha) / denominator)
24375 # .build());
24376 # }
24377 # return resultBuilder.build();
24378 # }
24379 # // ...
24380 #
24381 # Example (iOS / Obj-C):
24382 #
24383 # // ...
24384 # static UIColor* fromProto(Color* protocolor) {
24385 # float red = [protocolor red];
24386 # float green = [protocolor green];
24387 # float blue = [protocolor blue];
24388 # FloatValue* alpha_wrapper = [protocolor alpha];
24389 # float alpha = 1.0;
24390 # if (alpha_wrapper != nil) {
24391 # alpha = [alpha_wrapper value];
24392 # }
24393 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
24394 # }
24395 #
24396 # static Color* toProto(UIColor* color) {
24397 # CGFloat red, green, blue, alpha;
24398 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
24399 # return nil;
24400 # }
24401 # Color* result = [Color alloc] init];
24402 # [result setRed:red];
24403 # [result setGreen:green];
24404 # [result setBlue:blue];
24405 # if (alpha <= 0.9999) {
24406 # [result setAlpha:floatWrapperWithValue(alpha)];
24407 # }
24408 # [result autorelease];
24409 # return result;
24410 # }
24411 # // ...
24412 #
24413 # Example (JavaScript):
24414 #
24415 # // ...
24416 #
24417 # var protoToCssColor = function(rgb_color) {
24418 # var redFrac = rgb_color.red || 0.0;
24419 # var greenFrac = rgb_color.green || 0.0;
24420 # var blueFrac = rgb_color.blue || 0.0;
24421 # var red = Math.floor(redFrac * 255);
24422 # var green = Math.floor(greenFrac * 255);
24423 # var blue = Math.floor(blueFrac * 255);
24424 #
24425 # if (!('alpha' in rgb_color)) {
24426 # return rgbToCssColor_(red, green, blue);
24427 # }
24428 #
24429 # var alphaFrac = rgb_color.alpha.value || 0.0;
24430 # var rgbParams = [red, green, blue].join(',');
24431 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
24432 # };
24433 #
24434 # var rgbToCssColor_ = function(red, green, blue) {
24435 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
24436 # var hexString = rgbNumber.toString(16);
24437 # var missingZeros = 6 - hexString.length;
24438 # var resultBuilder = ['#'];
24439 # for (var i = 0; i < missingZeros; i++) {
24440 # resultBuilder.push('0');
24441 # }
24442 # resultBuilder.push(hexString);
24443 # return resultBuilder.join('');
24444 # };
24445 #
24446 # // ...
24447 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
24448 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
24449 # the final pixel color is defined by the equation:
24450 #
24451 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
24452 #
24453 # This means that a value of 1.0 corresponds to a solid color, whereas
24454 # a value of 0.0 corresponds to a completely transparent color. This
24455 # uses a wrapper message rather than a simple float scalar so that it is
24456 # possible to distinguish between a default value and the value being unset.
24457 # If omitted, this color object is to be rendered as a solid color
24458 # (as if the alpha value had been explicitly given with a value of 1.0).
24459 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
24460 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
24461 },
24462 "width": 42, # The width of the border, in pixels.
24463 # Border widths must be between 0 and 3 pixels.
24464 "style": "A String", # The style of the border.
24465 },
24466 "left": { # A border along a cell. # The left border of the cell.
24467 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
24468 # for simplicity of conversion to/from color representations in various
24469 # languages over compactness; for example, the fields of this representation
24470 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
24471 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
24472 # method in iOS; and, with just a little work, it can be easily formatted into
24473 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
24474 #
24475 # Example (Java):
24476 #
24477 # import com.google.type.Color;
24478 #
24479 # // ...
24480 # public static java.awt.Color fromProto(Color protocolor) {
24481 # float alpha = protocolor.hasAlpha()
24482 # ? protocolor.getAlpha().getValue()
24483 # : 1.0;
24484 #
24485 # return new java.awt.Color(
24486 # protocolor.getRed(),
24487 # protocolor.getGreen(),
24488 # protocolor.getBlue(),
24489 # alpha);
24490 # }
24491 #
24492 # public static Color toProto(java.awt.Color color) {
24493 # float red = (float) color.getRed();
24494 # float green = (float) color.getGreen();
24495 # float blue = (float) color.getBlue();
24496 # float denominator = 255.0;
24497 # Color.Builder resultBuilder =
24498 # Color
24499 # .newBuilder()
24500 # .setRed(red / denominator)
24501 # .setGreen(green / denominator)
24502 # .setBlue(blue / denominator);
24503 # int alpha = color.getAlpha();
24504 # if (alpha != 255) {
24505 # result.setAlpha(
24506 # FloatValue
24507 # .newBuilder()
24508 # .setValue(((float) alpha) / denominator)
24509 # .build());
24510 # }
24511 # return resultBuilder.build();
24512 # }
24513 # // ...
24514 #
24515 # Example (iOS / Obj-C):
24516 #
24517 # // ...
24518 # static UIColor* fromProto(Color* protocolor) {
24519 # float red = [protocolor red];
24520 # float green = [protocolor green];
24521 # float blue = [protocolor blue];
24522 # FloatValue* alpha_wrapper = [protocolor alpha];
24523 # float alpha = 1.0;
24524 # if (alpha_wrapper != nil) {
24525 # alpha = [alpha_wrapper value];
24526 # }
24527 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
24528 # }
24529 #
24530 # static Color* toProto(UIColor* color) {
24531 # CGFloat red, green, blue, alpha;
24532 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
24533 # return nil;
24534 # }
24535 # Color* result = [Color alloc] init];
24536 # [result setRed:red];
24537 # [result setGreen:green];
24538 # [result setBlue:blue];
24539 # if (alpha <= 0.9999) {
24540 # [result setAlpha:floatWrapperWithValue(alpha)];
24541 # }
24542 # [result autorelease];
24543 # return result;
24544 # }
24545 # // ...
24546 #
24547 # Example (JavaScript):
24548 #
24549 # // ...
24550 #
24551 # var protoToCssColor = function(rgb_color) {
24552 # var redFrac = rgb_color.red || 0.0;
24553 # var greenFrac = rgb_color.green || 0.0;
24554 # var blueFrac = rgb_color.blue || 0.0;
24555 # var red = Math.floor(redFrac * 255);
24556 # var green = Math.floor(greenFrac * 255);
24557 # var blue = Math.floor(blueFrac * 255);
24558 #
24559 # if (!('alpha' in rgb_color)) {
24560 # return rgbToCssColor_(red, green, blue);
24561 # }
24562 #
24563 # var alphaFrac = rgb_color.alpha.value || 0.0;
24564 # var rgbParams = [red, green, blue].join(',');
24565 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
24566 # };
24567 #
24568 # var rgbToCssColor_ = function(red, green, blue) {
24569 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
24570 # var hexString = rgbNumber.toString(16);
24571 # var missingZeros = 6 - hexString.length;
24572 # var resultBuilder = ['#'];
24573 # for (var i = 0; i < missingZeros; i++) {
24574 # resultBuilder.push('0');
24575 # }
24576 # resultBuilder.push(hexString);
24577 # return resultBuilder.join('');
24578 # };
24579 #
24580 # // ...
24581 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
24582 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
24583 # the final pixel color is defined by the equation:
24584 #
24585 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
24586 #
24587 # This means that a value of 1.0 corresponds to a solid color, whereas
24588 # a value of 0.0 corresponds to a completely transparent color. This
24589 # uses a wrapper message rather than a simple float scalar so that it is
24590 # possible to distinguish between a default value and the value being unset.
24591 # If omitted, this color object is to be rendered as a solid color
24592 # (as if the alpha value had been explicitly given with a value of 1.0).
24593 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
24594 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
24595 },
24596 "width": 42, # The width of the border, in pixels.
24597 # Border widths must be between 0 and 3 pixels.
24598 "style": "A String", # The style of the border.
24599 },
24600 },
24601 "wrapStrategy": "A String", # The wrap strategy for the value in the cell.
24602 },
24603 "title": "A String", # The title of the spreadsheet.
24604 },
24605 "sheets": [ # The sheets that are part of a spreadsheet.
24606 { # A sheet in a spreadsheet.
24607 "conditionalFormats": [ # The conditional format rules in this sheet.
24608 { # A rule describing a conditional format.
24609 "ranges": [ # The ranges that will be formatted if the condition is true.
24610 # All the ranges must be on the same grid.
24611 { # A range on a sheet.
24612 # All indexes are zero-based.
24613 # Indexes are half open, e.g the start index is inclusive
24614 # and the end index is exclusive -- [start_index, end_index).
24615 # Missing indexes indicate the range is unbounded on that side.
24616 #
24617 # For example, if "Sheet1" is grid ID 0, then:
24618 #
24619 # Sheet1!A1:A1 == sheet_id: 0,
24620 # start_row_index: 0, end_row_index: 1,
24621 # start_column_index: 0, end_column_index: 1
24622 #
24623 # Sheet1!A3:B4 == sheet_id: 0,
24624 # start_row_index: 2, end_row_index: 4,
24625 # start_column_index: 0, end_column_index: 2
24626 #
24627 # Sheet1!A:B == sheet_id: 0,
24628 # start_column_index: 0, end_column_index: 2
24629 #
24630 # Sheet1!A5:B == sheet_id: 0,
24631 # start_row_index: 4,
24632 # start_column_index: 0, end_column_index: 2
24633 #
24634 # Sheet1 == sheet_id:0
24635 #
24636 # The start index must always be less than or equal to the end index.
24637 # If the start index equals the end index, then the range is empty.
24638 # Empty ranges are typically not meaningful and are usually rendered in the
24639 # UI as `#REF!`.
24640 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
24641 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
24642 "sheetId": 42, # The sheet this range is on.
24643 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
24644 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
24645 },
24646 ],
24647 "booleanRule": { # A rule that may or may not match, depending on the condition. # The formatting is either "on" or "off" according to the rule.
24648 "condition": { # A condition that can evaluate to true or false. # The condition of the rule. If the condition evaluates to true,
24649 # the format will be applied.
24650 # BooleanConditions are used by conditional formatting,
24651 # data validation, and the criteria in filters.
24652 "type": "A String", # The type of condition.
24653 "values": [ # The values of the condition. The number of supported values depends
24654 # on the condition type. Some support zero values,
24655 # others one or two values,
24656 # and ConditionType.ONE_OF_LIST supports an arbitrary number of values.
24657 { # The value of the condition.
24658 "relativeDate": "A String", # A relative date (based on the current date).
24659 # Valid only if the type is
24660 # DATE_BEFORE,
24661 # DATE_AFTER,
24662 # DATE_ON_OR_BEFORE or
24663 # DATE_ON_OR_AFTER.
24664 #
24665 # Relative dates are not supported in data validation.
24666 # They are supported only in conditional formatting and
24667 # conditional filters.
24668 "userEnteredValue": "A String", # A value the condition is based on.
24669 # The value will be parsed as if the user typed into a cell.
24670 # Formulas are supported (and must begin with an `=`).
24671 },
24672 ],
24673 },
24674 "format": { # The format of a cell. # The format to apply.
24675 # Conditional formatting can only apply a subset of formatting:
24676 # bold, italic,
24677 # strikethrough,
24678 # foreground color &
24679 # background color.
24680 "numberFormat": { # The number format of a cell. # A format describing how number values should be represented to the user.
24681 # When updating, all fields must be set.
24682 "pattern": "A String", # Pattern string used for formatting.
24683 "type": "A String", # The type of the number format.
24684 },
24685 "textDirection": "A String", # The direction of the text in the cell.
24686 "padding": { # The amount of padding around the cell, in pixels. # The padding of the cell.
24687 # When updating padding, every field must be specified.
24688 "top": 42, # The top padding of the cell.
24689 "right": 42, # The right padding of the cell.
24690 "bottom": 42, # The bottom padding of the cell.
24691 "left": 42, # The left padding of the cell.
24692 },
24693 "horizontalAlignment": "A String", # The horizontal alignment of the value in cell.
24694 "backgroundColor": { # Represents a color in the RGBA color space. This representation is designed # The background color of the cell.
24695 # for simplicity of conversion to/from color representations in various
24696 # languages over compactness; for example, the fields of this representation
24697 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
24698 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
24699 # method in iOS; and, with just a little work, it can be easily formatted into
24700 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
24701 #
24702 # Example (Java):
24703 #
24704 # import com.google.type.Color;
24705 #
24706 # // ...
24707 # public static java.awt.Color fromProto(Color protocolor) {
24708 # float alpha = protocolor.hasAlpha()
24709 # ? protocolor.getAlpha().getValue()
24710 # : 1.0;
24711 #
24712 # return new java.awt.Color(
24713 # protocolor.getRed(),
24714 # protocolor.getGreen(),
24715 # protocolor.getBlue(),
24716 # alpha);
24717 # }
24718 #
24719 # public static Color toProto(java.awt.Color color) {
24720 # float red = (float) color.getRed();
24721 # float green = (float) color.getGreen();
24722 # float blue = (float) color.getBlue();
24723 # float denominator = 255.0;
24724 # Color.Builder resultBuilder =
24725 # Color
24726 # .newBuilder()
24727 # .setRed(red / denominator)
24728 # .setGreen(green / denominator)
24729 # .setBlue(blue / denominator);
24730 # int alpha = color.getAlpha();
24731 # if (alpha != 255) {
24732 # result.setAlpha(
24733 # FloatValue
24734 # .newBuilder()
24735 # .setValue(((float) alpha) / denominator)
24736 # .build());
24737 # }
24738 # return resultBuilder.build();
24739 # }
24740 # // ...
24741 #
24742 # Example (iOS / Obj-C):
24743 #
24744 # // ...
24745 # static UIColor* fromProto(Color* protocolor) {
24746 # float red = [protocolor red];
24747 # float green = [protocolor green];
24748 # float blue = [protocolor blue];
24749 # FloatValue* alpha_wrapper = [protocolor alpha];
24750 # float alpha = 1.0;
24751 # if (alpha_wrapper != nil) {
24752 # alpha = [alpha_wrapper value];
24753 # }
24754 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
24755 # }
24756 #
24757 # static Color* toProto(UIColor* color) {
24758 # CGFloat red, green, blue, alpha;
24759 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
24760 # return nil;
24761 # }
24762 # Color* result = [Color alloc] init];
24763 # [result setRed:red];
24764 # [result setGreen:green];
24765 # [result setBlue:blue];
24766 # if (alpha <= 0.9999) {
24767 # [result setAlpha:floatWrapperWithValue(alpha)];
24768 # }
24769 # [result autorelease];
24770 # return result;
24771 # }
24772 # // ...
24773 #
24774 # Example (JavaScript):
24775 #
24776 # // ...
24777 #
24778 # var protoToCssColor = function(rgb_color) {
24779 # var redFrac = rgb_color.red || 0.0;
24780 # var greenFrac = rgb_color.green || 0.0;
24781 # var blueFrac = rgb_color.blue || 0.0;
24782 # var red = Math.floor(redFrac * 255);
24783 # var green = Math.floor(greenFrac * 255);
24784 # var blue = Math.floor(blueFrac * 255);
24785 #
24786 # if (!('alpha' in rgb_color)) {
24787 # return rgbToCssColor_(red, green, blue);
24788 # }
24789 #
24790 # var alphaFrac = rgb_color.alpha.value || 0.0;
24791 # var rgbParams = [red, green, blue].join(',');
24792 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
24793 # };
24794 #
24795 # var rgbToCssColor_ = function(red, green, blue) {
24796 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
24797 # var hexString = rgbNumber.toString(16);
24798 # var missingZeros = 6 - hexString.length;
24799 # var resultBuilder = ['#'];
24800 # for (var i = 0; i < missingZeros; i++) {
24801 # resultBuilder.push('0');
24802 # }
24803 # resultBuilder.push(hexString);
24804 # return resultBuilder.join('');
24805 # };
24806 #
24807 # // ...
24808 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
24809 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
24810 # the final pixel color is defined by the equation:
24811 #
24812 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
24813 #
24814 # This means that a value of 1.0 corresponds to a solid color, whereas
24815 # a value of 0.0 corresponds to a completely transparent color. This
24816 # uses a wrapper message rather than a simple float scalar so that it is
24817 # possible to distinguish between a default value and the value being unset.
24818 # If omitted, this color object is to be rendered as a solid color
24819 # (as if the alpha value had been explicitly given with a value of 1.0).
24820 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
24821 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
24822 },
24823 "verticalAlignment": "A String", # The vertical alignment of the value in cell.
24824 "textFormat": { # The format of a run of text in a cell. # The format of the text in the cell (unless overridden by a format run).
24825 # Absent values indicate that the field isn't specified.
24826 "foregroundColor": { # Represents a color in the RGBA color space. This representation is designed # The foreground color of the text.
24827 # for simplicity of conversion to/from color representations in various
24828 # languages over compactness; for example, the fields of this representation
24829 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
24830 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
24831 # method in iOS; and, with just a little work, it can be easily formatted into
24832 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
24833 #
24834 # Example (Java):
24835 #
24836 # import com.google.type.Color;
24837 #
24838 # // ...
24839 # public static java.awt.Color fromProto(Color protocolor) {
24840 # float alpha = protocolor.hasAlpha()
24841 # ? protocolor.getAlpha().getValue()
24842 # : 1.0;
24843 #
24844 # return new java.awt.Color(
24845 # protocolor.getRed(),
24846 # protocolor.getGreen(),
24847 # protocolor.getBlue(),
24848 # alpha);
24849 # }
24850 #
24851 # public static Color toProto(java.awt.Color color) {
24852 # float red = (float) color.getRed();
24853 # float green = (float) color.getGreen();
24854 # float blue = (float) color.getBlue();
24855 # float denominator = 255.0;
24856 # Color.Builder resultBuilder =
24857 # Color
24858 # .newBuilder()
24859 # .setRed(red / denominator)
24860 # .setGreen(green / denominator)
24861 # .setBlue(blue / denominator);
24862 # int alpha = color.getAlpha();
24863 # if (alpha != 255) {
24864 # result.setAlpha(
24865 # FloatValue
24866 # .newBuilder()
24867 # .setValue(((float) alpha) / denominator)
24868 # .build());
24869 # }
24870 # return resultBuilder.build();
24871 # }
24872 # // ...
24873 #
24874 # Example (iOS / Obj-C):
24875 #
24876 # // ...
24877 # static UIColor* fromProto(Color* protocolor) {
24878 # float red = [protocolor red];
24879 # float green = [protocolor green];
24880 # float blue = [protocolor blue];
24881 # FloatValue* alpha_wrapper = [protocolor alpha];
24882 # float alpha = 1.0;
24883 # if (alpha_wrapper != nil) {
24884 # alpha = [alpha_wrapper value];
24885 # }
24886 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
24887 # }
24888 #
24889 # static Color* toProto(UIColor* color) {
24890 # CGFloat red, green, blue, alpha;
24891 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
24892 # return nil;
24893 # }
24894 # Color* result = [Color alloc] init];
24895 # [result setRed:red];
24896 # [result setGreen:green];
24897 # [result setBlue:blue];
24898 # if (alpha <= 0.9999) {
24899 # [result setAlpha:floatWrapperWithValue(alpha)];
24900 # }
24901 # [result autorelease];
24902 # return result;
24903 # }
24904 # // ...
24905 #
24906 # Example (JavaScript):
24907 #
24908 # // ...
24909 #
24910 # var protoToCssColor = function(rgb_color) {
24911 # var redFrac = rgb_color.red || 0.0;
24912 # var greenFrac = rgb_color.green || 0.0;
24913 # var blueFrac = rgb_color.blue || 0.0;
24914 # var red = Math.floor(redFrac * 255);
24915 # var green = Math.floor(greenFrac * 255);
24916 # var blue = Math.floor(blueFrac * 255);
24917 #
24918 # if (!('alpha' in rgb_color)) {
24919 # return rgbToCssColor_(red, green, blue);
24920 # }
24921 #
24922 # var alphaFrac = rgb_color.alpha.value || 0.0;
24923 # var rgbParams = [red, green, blue].join(',');
24924 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
24925 # };
24926 #
24927 # var rgbToCssColor_ = function(red, green, blue) {
24928 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
24929 # var hexString = rgbNumber.toString(16);
24930 # var missingZeros = 6 - hexString.length;
24931 # var resultBuilder = ['#'];
24932 # for (var i = 0; i < missingZeros; i++) {
24933 # resultBuilder.push('0');
24934 # }
24935 # resultBuilder.push(hexString);
24936 # return resultBuilder.join('');
24937 # };
24938 #
24939 # // ...
24940 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
24941 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
24942 # the final pixel color is defined by the equation:
24943 #
24944 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
24945 #
24946 # This means that a value of 1.0 corresponds to a solid color, whereas
24947 # a value of 0.0 corresponds to a completely transparent color. This
24948 # uses a wrapper message rather than a simple float scalar so that it is
24949 # possible to distinguish between a default value and the value being unset.
24950 # If omitted, this color object is to be rendered as a solid color
24951 # (as if the alpha value had been explicitly given with a value of 1.0).
24952 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
24953 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
24954 },
24955 "bold": True or False, # True if the text is bold.
24956 "strikethrough": True or False, # True if the text has a strikethrough.
24957 "fontFamily": "A String", # The font family.
24958 "fontSize": 42, # The size of the font.
24959 "italic": True or False, # True if the text is italicized.
24960 "underline": True or False, # True if the text is underlined.
24961 },
24962 "hyperlinkDisplayType": "A String", # How a hyperlink, if it exists, should be displayed in the cell.
24963 "borders": { # The borders of the cell. # The borders of the cell.
24964 "top": { # A border along a cell. # The top border of the cell.
24965 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
24966 # for simplicity of conversion to/from color representations in various
24967 # languages over compactness; for example, the fields of this representation
24968 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
24969 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
24970 # method in iOS; and, with just a little work, it can be easily formatted into
24971 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
24972 #
24973 # Example (Java):
24974 #
24975 # import com.google.type.Color;
24976 #
24977 # // ...
24978 # public static java.awt.Color fromProto(Color protocolor) {
24979 # float alpha = protocolor.hasAlpha()
24980 # ? protocolor.getAlpha().getValue()
24981 # : 1.0;
24982 #
24983 # return new java.awt.Color(
24984 # protocolor.getRed(),
24985 # protocolor.getGreen(),
24986 # protocolor.getBlue(),
24987 # alpha);
24988 # }
24989 #
24990 # public static Color toProto(java.awt.Color color) {
24991 # float red = (float) color.getRed();
24992 # float green = (float) color.getGreen();
24993 # float blue = (float) color.getBlue();
24994 # float denominator = 255.0;
24995 # Color.Builder resultBuilder =
24996 # Color
24997 # .newBuilder()
24998 # .setRed(red / denominator)
24999 # .setGreen(green / denominator)
25000 # .setBlue(blue / denominator);
25001 # int alpha = color.getAlpha();
25002 # if (alpha != 255) {
25003 # result.setAlpha(
25004 # FloatValue
25005 # .newBuilder()
25006 # .setValue(((float) alpha) / denominator)
25007 # .build());
25008 # }
25009 # return resultBuilder.build();
25010 # }
25011 # // ...
25012 #
25013 # Example (iOS / Obj-C):
25014 #
25015 # // ...
25016 # static UIColor* fromProto(Color* protocolor) {
25017 # float red = [protocolor red];
25018 # float green = [protocolor green];
25019 # float blue = [protocolor blue];
25020 # FloatValue* alpha_wrapper = [protocolor alpha];
25021 # float alpha = 1.0;
25022 # if (alpha_wrapper != nil) {
25023 # alpha = [alpha_wrapper value];
25024 # }
25025 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
25026 # }
25027 #
25028 # static Color* toProto(UIColor* color) {
25029 # CGFloat red, green, blue, alpha;
25030 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
25031 # return nil;
25032 # }
25033 # Color* result = [Color alloc] init];
25034 # [result setRed:red];
25035 # [result setGreen:green];
25036 # [result setBlue:blue];
25037 # if (alpha <= 0.9999) {
25038 # [result setAlpha:floatWrapperWithValue(alpha)];
25039 # }
25040 # [result autorelease];
25041 # return result;
25042 # }
25043 # // ...
25044 #
25045 # Example (JavaScript):
25046 #
25047 # // ...
25048 #
25049 # var protoToCssColor = function(rgb_color) {
25050 # var redFrac = rgb_color.red || 0.0;
25051 # var greenFrac = rgb_color.green || 0.0;
25052 # var blueFrac = rgb_color.blue || 0.0;
25053 # var red = Math.floor(redFrac * 255);
25054 # var green = Math.floor(greenFrac * 255);
25055 # var blue = Math.floor(blueFrac * 255);
25056 #
25057 # if (!('alpha' in rgb_color)) {
25058 # return rgbToCssColor_(red, green, blue);
25059 # }
25060 #
25061 # var alphaFrac = rgb_color.alpha.value || 0.0;
25062 # var rgbParams = [red, green, blue].join(',');
25063 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
25064 # };
25065 #
25066 # var rgbToCssColor_ = function(red, green, blue) {
25067 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
25068 # var hexString = rgbNumber.toString(16);
25069 # var missingZeros = 6 - hexString.length;
25070 # var resultBuilder = ['#'];
25071 # for (var i = 0; i < missingZeros; i++) {
25072 # resultBuilder.push('0');
25073 # }
25074 # resultBuilder.push(hexString);
25075 # return resultBuilder.join('');
25076 # };
25077 #
25078 # // ...
25079 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
25080 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
25081 # the final pixel color is defined by the equation:
25082 #
25083 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
25084 #
25085 # This means that a value of 1.0 corresponds to a solid color, whereas
25086 # a value of 0.0 corresponds to a completely transparent color. This
25087 # uses a wrapper message rather than a simple float scalar so that it is
25088 # possible to distinguish between a default value and the value being unset.
25089 # If omitted, this color object is to be rendered as a solid color
25090 # (as if the alpha value had been explicitly given with a value of 1.0).
25091 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
25092 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
25093 },
25094 "width": 42, # The width of the border, in pixels.
25095 # Border widths must be between 0 and 3 pixels.
25096 "style": "A String", # The style of the border.
25097 },
25098 "right": { # A border along a cell. # The right border of the cell.
25099 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
25100 # for simplicity of conversion to/from color representations in various
25101 # languages over compactness; for example, the fields of this representation
25102 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
25103 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
25104 # method in iOS; and, with just a little work, it can be easily formatted into
25105 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
25106 #
25107 # Example (Java):
25108 #
25109 # import com.google.type.Color;
25110 #
25111 # // ...
25112 # public static java.awt.Color fromProto(Color protocolor) {
25113 # float alpha = protocolor.hasAlpha()
25114 # ? protocolor.getAlpha().getValue()
25115 # : 1.0;
25116 #
25117 # return new java.awt.Color(
25118 # protocolor.getRed(),
25119 # protocolor.getGreen(),
25120 # protocolor.getBlue(),
25121 # alpha);
25122 # }
25123 #
25124 # public static Color toProto(java.awt.Color color) {
25125 # float red = (float) color.getRed();
25126 # float green = (float) color.getGreen();
25127 # float blue = (float) color.getBlue();
25128 # float denominator = 255.0;
25129 # Color.Builder resultBuilder =
25130 # Color
25131 # .newBuilder()
25132 # .setRed(red / denominator)
25133 # .setGreen(green / denominator)
25134 # .setBlue(blue / denominator);
25135 # int alpha = color.getAlpha();
25136 # if (alpha != 255) {
25137 # result.setAlpha(
25138 # FloatValue
25139 # .newBuilder()
25140 # .setValue(((float) alpha) / denominator)
25141 # .build());
25142 # }
25143 # return resultBuilder.build();
25144 # }
25145 # // ...
25146 #
25147 # Example (iOS / Obj-C):
25148 #
25149 # // ...
25150 # static UIColor* fromProto(Color* protocolor) {
25151 # float red = [protocolor red];
25152 # float green = [protocolor green];
25153 # float blue = [protocolor blue];
25154 # FloatValue* alpha_wrapper = [protocolor alpha];
25155 # float alpha = 1.0;
25156 # if (alpha_wrapper != nil) {
25157 # alpha = [alpha_wrapper value];
25158 # }
25159 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
25160 # }
25161 #
25162 # static Color* toProto(UIColor* color) {
25163 # CGFloat red, green, blue, alpha;
25164 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
25165 # return nil;
25166 # }
25167 # Color* result = [Color alloc] init];
25168 # [result setRed:red];
25169 # [result setGreen:green];
25170 # [result setBlue:blue];
25171 # if (alpha <= 0.9999) {
25172 # [result setAlpha:floatWrapperWithValue(alpha)];
25173 # }
25174 # [result autorelease];
25175 # return result;
25176 # }
25177 # // ...
25178 #
25179 # Example (JavaScript):
25180 #
25181 # // ...
25182 #
25183 # var protoToCssColor = function(rgb_color) {
25184 # var redFrac = rgb_color.red || 0.0;
25185 # var greenFrac = rgb_color.green || 0.0;
25186 # var blueFrac = rgb_color.blue || 0.0;
25187 # var red = Math.floor(redFrac * 255);
25188 # var green = Math.floor(greenFrac * 255);
25189 # var blue = Math.floor(blueFrac * 255);
25190 #
25191 # if (!('alpha' in rgb_color)) {
25192 # return rgbToCssColor_(red, green, blue);
25193 # }
25194 #
25195 # var alphaFrac = rgb_color.alpha.value || 0.0;
25196 # var rgbParams = [red, green, blue].join(',');
25197 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
25198 # };
25199 #
25200 # var rgbToCssColor_ = function(red, green, blue) {
25201 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
25202 # var hexString = rgbNumber.toString(16);
25203 # var missingZeros = 6 - hexString.length;
25204 # var resultBuilder = ['#'];
25205 # for (var i = 0; i < missingZeros; i++) {
25206 # resultBuilder.push('0');
25207 # }
25208 # resultBuilder.push(hexString);
25209 # return resultBuilder.join('');
25210 # };
25211 #
25212 # // ...
25213 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
25214 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
25215 # the final pixel color is defined by the equation:
25216 #
25217 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
25218 #
25219 # This means that a value of 1.0 corresponds to a solid color, whereas
25220 # a value of 0.0 corresponds to a completely transparent color. This
25221 # uses a wrapper message rather than a simple float scalar so that it is
25222 # possible to distinguish between a default value and the value being unset.
25223 # If omitted, this color object is to be rendered as a solid color
25224 # (as if the alpha value had been explicitly given with a value of 1.0).
25225 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
25226 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
25227 },
25228 "width": 42, # The width of the border, in pixels.
25229 # Border widths must be between 0 and 3 pixels.
25230 "style": "A String", # The style of the border.
25231 },
25232 "bottom": { # A border along a cell. # The bottom border of the cell.
25233 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
25234 # for simplicity of conversion to/from color representations in various
25235 # languages over compactness; for example, the fields of this representation
25236 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
25237 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
25238 # method in iOS; and, with just a little work, it can be easily formatted into
25239 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
25240 #
25241 # Example (Java):
25242 #
25243 # import com.google.type.Color;
25244 #
25245 # // ...
25246 # public static java.awt.Color fromProto(Color protocolor) {
25247 # float alpha = protocolor.hasAlpha()
25248 # ? protocolor.getAlpha().getValue()
25249 # : 1.0;
25250 #
25251 # return new java.awt.Color(
25252 # protocolor.getRed(),
25253 # protocolor.getGreen(),
25254 # protocolor.getBlue(),
25255 # alpha);
25256 # }
25257 #
25258 # public static Color toProto(java.awt.Color color) {
25259 # float red = (float) color.getRed();
25260 # float green = (float) color.getGreen();
25261 # float blue = (float) color.getBlue();
25262 # float denominator = 255.0;
25263 # Color.Builder resultBuilder =
25264 # Color
25265 # .newBuilder()
25266 # .setRed(red / denominator)
25267 # .setGreen(green / denominator)
25268 # .setBlue(blue / denominator);
25269 # int alpha = color.getAlpha();
25270 # if (alpha != 255) {
25271 # result.setAlpha(
25272 # FloatValue
25273 # .newBuilder()
25274 # .setValue(((float) alpha) / denominator)
25275 # .build());
25276 # }
25277 # return resultBuilder.build();
25278 # }
25279 # // ...
25280 #
25281 # Example (iOS / Obj-C):
25282 #
25283 # // ...
25284 # static UIColor* fromProto(Color* protocolor) {
25285 # float red = [protocolor red];
25286 # float green = [protocolor green];
25287 # float blue = [protocolor blue];
25288 # FloatValue* alpha_wrapper = [protocolor alpha];
25289 # float alpha = 1.0;
25290 # if (alpha_wrapper != nil) {
25291 # alpha = [alpha_wrapper value];
25292 # }
25293 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
25294 # }
25295 #
25296 # static Color* toProto(UIColor* color) {
25297 # CGFloat red, green, blue, alpha;
25298 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
25299 # return nil;
25300 # }
25301 # Color* result = [Color alloc] init];
25302 # [result setRed:red];
25303 # [result setGreen:green];
25304 # [result setBlue:blue];
25305 # if (alpha <= 0.9999) {
25306 # [result setAlpha:floatWrapperWithValue(alpha)];
25307 # }
25308 # [result autorelease];
25309 # return result;
25310 # }
25311 # // ...
25312 #
25313 # Example (JavaScript):
25314 #
25315 # // ...
25316 #
25317 # var protoToCssColor = function(rgb_color) {
25318 # var redFrac = rgb_color.red || 0.0;
25319 # var greenFrac = rgb_color.green || 0.0;
25320 # var blueFrac = rgb_color.blue || 0.0;
25321 # var red = Math.floor(redFrac * 255);
25322 # var green = Math.floor(greenFrac * 255);
25323 # var blue = Math.floor(blueFrac * 255);
25324 #
25325 # if (!('alpha' in rgb_color)) {
25326 # return rgbToCssColor_(red, green, blue);
25327 # }
25328 #
25329 # var alphaFrac = rgb_color.alpha.value || 0.0;
25330 # var rgbParams = [red, green, blue].join(',');
25331 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
25332 # };
25333 #
25334 # var rgbToCssColor_ = function(red, green, blue) {
25335 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
25336 # var hexString = rgbNumber.toString(16);
25337 # var missingZeros = 6 - hexString.length;
25338 # var resultBuilder = ['#'];
25339 # for (var i = 0; i < missingZeros; i++) {
25340 # resultBuilder.push('0');
25341 # }
25342 # resultBuilder.push(hexString);
25343 # return resultBuilder.join('');
25344 # };
25345 #
25346 # // ...
25347 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
25348 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
25349 # the final pixel color is defined by the equation:
25350 #
25351 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
25352 #
25353 # This means that a value of 1.0 corresponds to a solid color, whereas
25354 # a value of 0.0 corresponds to a completely transparent color. This
25355 # uses a wrapper message rather than a simple float scalar so that it is
25356 # possible to distinguish between a default value and the value being unset.
25357 # If omitted, this color object is to be rendered as a solid color
25358 # (as if the alpha value had been explicitly given with a value of 1.0).
25359 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
25360 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
25361 },
25362 "width": 42, # The width of the border, in pixels.
25363 # Border widths must be between 0 and 3 pixels.
25364 "style": "A String", # The style of the border.
25365 },
25366 "left": { # A border along a cell. # The left border of the cell.
25367 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
25368 # for simplicity of conversion to/from color representations in various
25369 # languages over compactness; for example, the fields of this representation
25370 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
25371 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
25372 # method in iOS; and, with just a little work, it can be easily formatted into
25373 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
25374 #
25375 # Example (Java):
25376 #
25377 # import com.google.type.Color;
25378 #
25379 # // ...
25380 # public static java.awt.Color fromProto(Color protocolor) {
25381 # float alpha = protocolor.hasAlpha()
25382 # ? protocolor.getAlpha().getValue()
25383 # : 1.0;
25384 #
25385 # return new java.awt.Color(
25386 # protocolor.getRed(),
25387 # protocolor.getGreen(),
25388 # protocolor.getBlue(),
25389 # alpha);
25390 # }
25391 #
25392 # public static Color toProto(java.awt.Color color) {
25393 # float red = (float) color.getRed();
25394 # float green = (float) color.getGreen();
25395 # float blue = (float) color.getBlue();
25396 # float denominator = 255.0;
25397 # Color.Builder resultBuilder =
25398 # Color
25399 # .newBuilder()
25400 # .setRed(red / denominator)
25401 # .setGreen(green / denominator)
25402 # .setBlue(blue / denominator);
25403 # int alpha = color.getAlpha();
25404 # if (alpha != 255) {
25405 # result.setAlpha(
25406 # FloatValue
25407 # .newBuilder()
25408 # .setValue(((float) alpha) / denominator)
25409 # .build());
25410 # }
25411 # return resultBuilder.build();
25412 # }
25413 # // ...
25414 #
25415 # Example (iOS / Obj-C):
25416 #
25417 # // ...
25418 # static UIColor* fromProto(Color* protocolor) {
25419 # float red = [protocolor red];
25420 # float green = [protocolor green];
25421 # float blue = [protocolor blue];
25422 # FloatValue* alpha_wrapper = [protocolor alpha];
25423 # float alpha = 1.0;
25424 # if (alpha_wrapper != nil) {
25425 # alpha = [alpha_wrapper value];
25426 # }
25427 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
25428 # }
25429 #
25430 # static Color* toProto(UIColor* color) {
25431 # CGFloat red, green, blue, alpha;
25432 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
25433 # return nil;
25434 # }
25435 # Color* result = [Color alloc] init];
25436 # [result setRed:red];
25437 # [result setGreen:green];
25438 # [result setBlue:blue];
25439 # if (alpha <= 0.9999) {
25440 # [result setAlpha:floatWrapperWithValue(alpha)];
25441 # }
25442 # [result autorelease];
25443 # return result;
25444 # }
25445 # // ...
25446 #
25447 # Example (JavaScript):
25448 #
25449 # // ...
25450 #
25451 # var protoToCssColor = function(rgb_color) {
25452 # var redFrac = rgb_color.red || 0.0;
25453 # var greenFrac = rgb_color.green || 0.0;
25454 # var blueFrac = rgb_color.blue || 0.0;
25455 # var red = Math.floor(redFrac * 255);
25456 # var green = Math.floor(greenFrac * 255);
25457 # var blue = Math.floor(blueFrac * 255);
25458 #
25459 # if (!('alpha' in rgb_color)) {
25460 # return rgbToCssColor_(red, green, blue);
25461 # }
25462 #
25463 # var alphaFrac = rgb_color.alpha.value || 0.0;
25464 # var rgbParams = [red, green, blue].join(',');
25465 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
25466 # };
25467 #
25468 # var rgbToCssColor_ = function(red, green, blue) {
25469 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
25470 # var hexString = rgbNumber.toString(16);
25471 # var missingZeros = 6 - hexString.length;
25472 # var resultBuilder = ['#'];
25473 # for (var i = 0; i < missingZeros; i++) {
25474 # resultBuilder.push('0');
25475 # }
25476 # resultBuilder.push(hexString);
25477 # return resultBuilder.join('');
25478 # };
25479 #
25480 # // ...
25481 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
25482 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
25483 # the final pixel color is defined by the equation:
25484 #
25485 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
25486 #
25487 # This means that a value of 1.0 corresponds to a solid color, whereas
25488 # a value of 0.0 corresponds to a completely transparent color. This
25489 # uses a wrapper message rather than a simple float scalar so that it is
25490 # possible to distinguish between a default value and the value being unset.
25491 # If omitted, this color object is to be rendered as a solid color
25492 # (as if the alpha value had been explicitly given with a value of 1.0).
25493 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
25494 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
25495 },
25496 "width": 42, # The width of the border, in pixels.
25497 # Border widths must be between 0 and 3 pixels.
25498 "style": "A String", # The style of the border.
25499 },
25500 },
25501 "wrapStrategy": "A String", # The wrap strategy for the value in the cell.
25502 },
25503 },
25504 "gradientRule": { # A rule that applies a gradient color scale format, based on # The formatting will vary based on the gradients in the rule.
25505 # the interpolation points listed. The format of a cell will vary
25506 # based on its contents as compared to the values of the interpolation
25507 # points.
25508 "maxpoint": { # A single interpolation point a gradient conditional format. # The final interpolation point.
25509 # These pin the gradient color scale according to the color,
25510 # type and value chosen.
25511 "color": { # Represents a color in the RGBA color space. This representation is designed # The color this interpolation point should use.
25512 # for simplicity of conversion to/from color representations in various
25513 # languages over compactness; for example, the fields of this representation
25514 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
25515 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
25516 # method in iOS; and, with just a little work, it can be easily formatted into
25517 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
25518 #
25519 # Example (Java):
25520 #
25521 # import com.google.type.Color;
25522 #
25523 # // ...
25524 # public static java.awt.Color fromProto(Color protocolor) {
25525 # float alpha = protocolor.hasAlpha()
25526 # ? protocolor.getAlpha().getValue()
25527 # : 1.0;
25528 #
25529 # return new java.awt.Color(
25530 # protocolor.getRed(),
25531 # protocolor.getGreen(),
25532 # protocolor.getBlue(),
25533 # alpha);
25534 # }
25535 #
25536 # public static Color toProto(java.awt.Color color) {
25537 # float red = (float) color.getRed();
25538 # float green = (float) color.getGreen();
25539 # float blue = (float) color.getBlue();
25540 # float denominator = 255.0;
25541 # Color.Builder resultBuilder =
25542 # Color
25543 # .newBuilder()
25544 # .setRed(red / denominator)
25545 # .setGreen(green / denominator)
25546 # .setBlue(blue / denominator);
25547 # int alpha = color.getAlpha();
25548 # if (alpha != 255) {
25549 # result.setAlpha(
25550 # FloatValue
25551 # .newBuilder()
25552 # .setValue(((float) alpha) / denominator)
25553 # .build());
25554 # }
25555 # return resultBuilder.build();
25556 # }
25557 # // ...
25558 #
25559 # Example (iOS / Obj-C):
25560 #
25561 # // ...
25562 # static UIColor* fromProto(Color* protocolor) {
25563 # float red = [protocolor red];
25564 # float green = [protocolor green];
25565 # float blue = [protocolor blue];
25566 # FloatValue* alpha_wrapper = [protocolor alpha];
25567 # float alpha = 1.0;
25568 # if (alpha_wrapper != nil) {
25569 # alpha = [alpha_wrapper value];
25570 # }
25571 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
25572 # }
25573 #
25574 # static Color* toProto(UIColor* color) {
25575 # CGFloat red, green, blue, alpha;
25576 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
25577 # return nil;
25578 # }
25579 # Color* result = [Color alloc] init];
25580 # [result setRed:red];
25581 # [result setGreen:green];
25582 # [result setBlue:blue];
25583 # if (alpha <= 0.9999) {
25584 # [result setAlpha:floatWrapperWithValue(alpha)];
25585 # }
25586 # [result autorelease];
25587 # return result;
25588 # }
25589 # // ...
25590 #
25591 # Example (JavaScript):
25592 #
25593 # // ...
25594 #
25595 # var protoToCssColor = function(rgb_color) {
25596 # var redFrac = rgb_color.red || 0.0;
25597 # var greenFrac = rgb_color.green || 0.0;
25598 # var blueFrac = rgb_color.blue || 0.0;
25599 # var red = Math.floor(redFrac * 255);
25600 # var green = Math.floor(greenFrac * 255);
25601 # var blue = Math.floor(blueFrac * 255);
25602 #
25603 # if (!('alpha' in rgb_color)) {
25604 # return rgbToCssColor_(red, green, blue);
25605 # }
25606 #
25607 # var alphaFrac = rgb_color.alpha.value || 0.0;
25608 # var rgbParams = [red, green, blue].join(',');
25609 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
25610 # };
25611 #
25612 # var rgbToCssColor_ = function(red, green, blue) {
25613 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
25614 # var hexString = rgbNumber.toString(16);
25615 # var missingZeros = 6 - hexString.length;
25616 # var resultBuilder = ['#'];
25617 # for (var i = 0; i < missingZeros; i++) {
25618 # resultBuilder.push('0');
25619 # }
25620 # resultBuilder.push(hexString);
25621 # return resultBuilder.join('');
25622 # };
25623 #
25624 # // ...
25625 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
25626 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
25627 # the final pixel color is defined by the equation:
25628 #
25629 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
25630 #
25631 # This means that a value of 1.0 corresponds to a solid color, whereas
25632 # a value of 0.0 corresponds to a completely transparent color. This
25633 # uses a wrapper message rather than a simple float scalar so that it is
25634 # possible to distinguish between a default value and the value being unset.
25635 # If omitted, this color object is to be rendered as a solid color
25636 # (as if the alpha value had been explicitly given with a value of 1.0).
25637 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
25638 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
25639 },
25640 "type": "A String", # How the value should be interpreted.
25641 "value": "A String", # The value this interpolation point uses. May be a formula.
25642 # Unused if type is MIN or
25643 # MAX.
25644 },
25645 "midpoint": { # A single interpolation point a gradient conditional format. # An optional midway interpolation point.
25646 # These pin the gradient color scale according to the color,
25647 # type and value chosen.
25648 "color": { # Represents a color in the RGBA color space. This representation is designed # The color this interpolation point should use.
25649 # for simplicity of conversion to/from color representations in various
25650 # languages over compactness; for example, the fields of this representation
25651 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
25652 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
25653 # method in iOS; and, with just a little work, it can be easily formatted into
25654 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
25655 #
25656 # Example (Java):
25657 #
25658 # import com.google.type.Color;
25659 #
25660 # // ...
25661 # public static java.awt.Color fromProto(Color protocolor) {
25662 # float alpha = protocolor.hasAlpha()
25663 # ? protocolor.getAlpha().getValue()
25664 # : 1.0;
25665 #
25666 # return new java.awt.Color(
25667 # protocolor.getRed(),
25668 # protocolor.getGreen(),
25669 # protocolor.getBlue(),
25670 # alpha);
25671 # }
25672 #
25673 # public static Color toProto(java.awt.Color color) {
25674 # float red = (float) color.getRed();
25675 # float green = (float) color.getGreen();
25676 # float blue = (float) color.getBlue();
25677 # float denominator = 255.0;
25678 # Color.Builder resultBuilder =
25679 # Color
25680 # .newBuilder()
25681 # .setRed(red / denominator)
25682 # .setGreen(green / denominator)
25683 # .setBlue(blue / denominator);
25684 # int alpha = color.getAlpha();
25685 # if (alpha != 255) {
25686 # result.setAlpha(
25687 # FloatValue
25688 # .newBuilder()
25689 # .setValue(((float) alpha) / denominator)
25690 # .build());
25691 # }
25692 # return resultBuilder.build();
25693 # }
25694 # // ...
25695 #
25696 # Example (iOS / Obj-C):
25697 #
25698 # // ...
25699 # static UIColor* fromProto(Color* protocolor) {
25700 # float red = [protocolor red];
25701 # float green = [protocolor green];
25702 # float blue = [protocolor blue];
25703 # FloatValue* alpha_wrapper = [protocolor alpha];
25704 # float alpha = 1.0;
25705 # if (alpha_wrapper != nil) {
25706 # alpha = [alpha_wrapper value];
25707 # }
25708 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
25709 # }
25710 #
25711 # static Color* toProto(UIColor* color) {
25712 # CGFloat red, green, blue, alpha;
25713 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
25714 # return nil;
25715 # }
25716 # Color* result = [Color alloc] init];
25717 # [result setRed:red];
25718 # [result setGreen:green];
25719 # [result setBlue:blue];
25720 # if (alpha <= 0.9999) {
25721 # [result setAlpha:floatWrapperWithValue(alpha)];
25722 # }
25723 # [result autorelease];
25724 # return result;
25725 # }
25726 # // ...
25727 #
25728 # Example (JavaScript):
25729 #
25730 # // ...
25731 #
25732 # var protoToCssColor = function(rgb_color) {
25733 # var redFrac = rgb_color.red || 0.0;
25734 # var greenFrac = rgb_color.green || 0.0;
25735 # var blueFrac = rgb_color.blue || 0.0;
25736 # var red = Math.floor(redFrac * 255);
25737 # var green = Math.floor(greenFrac * 255);
25738 # var blue = Math.floor(blueFrac * 255);
25739 #
25740 # if (!('alpha' in rgb_color)) {
25741 # return rgbToCssColor_(red, green, blue);
25742 # }
25743 #
25744 # var alphaFrac = rgb_color.alpha.value || 0.0;
25745 # var rgbParams = [red, green, blue].join(',');
25746 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
25747 # };
25748 #
25749 # var rgbToCssColor_ = function(red, green, blue) {
25750 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
25751 # var hexString = rgbNumber.toString(16);
25752 # var missingZeros = 6 - hexString.length;
25753 # var resultBuilder = ['#'];
25754 # for (var i = 0; i < missingZeros; i++) {
25755 # resultBuilder.push('0');
25756 # }
25757 # resultBuilder.push(hexString);
25758 # return resultBuilder.join('');
25759 # };
25760 #
25761 # // ...
25762 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
25763 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
25764 # the final pixel color is defined by the equation:
25765 #
25766 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
25767 #
25768 # This means that a value of 1.0 corresponds to a solid color, whereas
25769 # a value of 0.0 corresponds to a completely transparent color. This
25770 # uses a wrapper message rather than a simple float scalar so that it is
25771 # possible to distinguish between a default value and the value being unset.
25772 # If omitted, this color object is to be rendered as a solid color
25773 # (as if the alpha value had been explicitly given with a value of 1.0).
25774 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
25775 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
25776 },
25777 "type": "A String", # How the value should be interpreted.
25778 "value": "A String", # The value this interpolation point uses. May be a formula.
25779 # Unused if type is MIN or
25780 # MAX.
25781 },
25782 "minpoint": { # A single interpolation point a gradient conditional format. # The starting interpolation point.
25783 # These pin the gradient color scale according to the color,
25784 # type and value chosen.
25785 "color": { # Represents a color in the RGBA color space. This representation is designed # The color this interpolation point should use.
25786 # for simplicity of conversion to/from color representations in various
25787 # languages over compactness; for example, the fields of this representation
25788 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
25789 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
25790 # method in iOS; and, with just a little work, it can be easily formatted into
25791 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
25792 #
25793 # Example (Java):
25794 #
25795 # import com.google.type.Color;
25796 #
25797 # // ...
25798 # public static java.awt.Color fromProto(Color protocolor) {
25799 # float alpha = protocolor.hasAlpha()
25800 # ? protocolor.getAlpha().getValue()
25801 # : 1.0;
25802 #
25803 # return new java.awt.Color(
25804 # protocolor.getRed(),
25805 # protocolor.getGreen(),
25806 # protocolor.getBlue(),
25807 # alpha);
25808 # }
25809 #
25810 # public static Color toProto(java.awt.Color color) {
25811 # float red = (float) color.getRed();
25812 # float green = (float) color.getGreen();
25813 # float blue = (float) color.getBlue();
25814 # float denominator = 255.0;
25815 # Color.Builder resultBuilder =
25816 # Color
25817 # .newBuilder()
25818 # .setRed(red / denominator)
25819 # .setGreen(green / denominator)
25820 # .setBlue(blue / denominator);
25821 # int alpha = color.getAlpha();
25822 # if (alpha != 255) {
25823 # result.setAlpha(
25824 # FloatValue
25825 # .newBuilder()
25826 # .setValue(((float) alpha) / denominator)
25827 # .build());
25828 # }
25829 # return resultBuilder.build();
25830 # }
25831 # // ...
25832 #
25833 # Example (iOS / Obj-C):
25834 #
25835 # // ...
25836 # static UIColor* fromProto(Color* protocolor) {
25837 # float red = [protocolor red];
25838 # float green = [protocolor green];
25839 # float blue = [protocolor blue];
25840 # FloatValue* alpha_wrapper = [protocolor alpha];
25841 # float alpha = 1.0;
25842 # if (alpha_wrapper != nil) {
25843 # alpha = [alpha_wrapper value];
25844 # }
25845 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
25846 # }
25847 #
25848 # static Color* toProto(UIColor* color) {
25849 # CGFloat red, green, blue, alpha;
25850 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
25851 # return nil;
25852 # }
25853 # Color* result = [Color alloc] init];
25854 # [result setRed:red];
25855 # [result setGreen:green];
25856 # [result setBlue:blue];
25857 # if (alpha <= 0.9999) {
25858 # [result setAlpha:floatWrapperWithValue(alpha)];
25859 # }
25860 # [result autorelease];
25861 # return result;
25862 # }
25863 # // ...
25864 #
25865 # Example (JavaScript):
25866 #
25867 # // ...
25868 #
25869 # var protoToCssColor = function(rgb_color) {
25870 # var redFrac = rgb_color.red || 0.0;
25871 # var greenFrac = rgb_color.green || 0.0;
25872 # var blueFrac = rgb_color.blue || 0.0;
25873 # var red = Math.floor(redFrac * 255);
25874 # var green = Math.floor(greenFrac * 255);
25875 # var blue = Math.floor(blueFrac * 255);
25876 #
25877 # if (!('alpha' in rgb_color)) {
25878 # return rgbToCssColor_(red, green, blue);
25879 # }
25880 #
25881 # var alphaFrac = rgb_color.alpha.value || 0.0;
25882 # var rgbParams = [red, green, blue].join(',');
25883 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
25884 # };
25885 #
25886 # var rgbToCssColor_ = function(red, green, blue) {
25887 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
25888 # var hexString = rgbNumber.toString(16);
25889 # var missingZeros = 6 - hexString.length;
25890 # var resultBuilder = ['#'];
25891 # for (var i = 0; i < missingZeros; i++) {
25892 # resultBuilder.push('0');
25893 # }
25894 # resultBuilder.push(hexString);
25895 # return resultBuilder.join('');
25896 # };
25897 #
25898 # // ...
25899 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
25900 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
25901 # the final pixel color is defined by the equation:
25902 #
25903 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
25904 #
25905 # This means that a value of 1.0 corresponds to a solid color, whereas
25906 # a value of 0.0 corresponds to a completely transparent color. This
25907 # uses a wrapper message rather than a simple float scalar so that it is
25908 # possible to distinguish between a default value and the value being unset.
25909 # If omitted, this color object is to be rendered as a solid color
25910 # (as if the alpha value had been explicitly given with a value of 1.0).
25911 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
25912 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
25913 },
25914 "type": "A String", # How the value should be interpreted.
25915 "value": "A String", # The value this interpolation point uses. May be a formula.
25916 # Unused if type is MIN or
25917 # MAX.
25918 },
25919 },
25920 },
25921 ],
25922 "merges": [ # The ranges that are merged together.
25923 { # A range on a sheet.
25924 # All indexes are zero-based.
25925 # Indexes are half open, e.g the start index is inclusive
25926 # and the end index is exclusive -- [start_index, end_index).
25927 # Missing indexes indicate the range is unbounded on that side.
25928 #
25929 # For example, if "Sheet1" is grid ID 0, then:
25930 #
25931 # Sheet1!A1:A1 == sheet_id: 0,
25932 # start_row_index: 0, end_row_index: 1,
25933 # start_column_index: 0, end_column_index: 1
25934 #
25935 # Sheet1!A3:B4 == sheet_id: 0,
25936 # start_row_index: 2, end_row_index: 4,
25937 # start_column_index: 0, end_column_index: 2
25938 #
25939 # Sheet1!A:B == sheet_id: 0,
25940 # start_column_index: 0, end_column_index: 2
25941 #
25942 # Sheet1!A5:B == sheet_id: 0,
25943 # start_row_index: 4,
25944 # start_column_index: 0, end_column_index: 2
25945 #
25946 # Sheet1 == sheet_id:0
25947 #
25948 # The start index must always be less than or equal to the end index.
25949 # If the start index equals the end index, then the range is empty.
25950 # Empty ranges are typically not meaningful and are usually rendered in the
25951 # UI as `#REF!`.
25952 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
25953 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
25954 "sheetId": 42, # The sheet this range is on.
25955 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
25956 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
25957 },
25958 ],
25959 "basicFilter": { # The default filter associated with a sheet. # The filter on this sheet, if any.
25960 "range": { # A range on a sheet. # The range the filter covers.
25961 # All indexes are zero-based.
25962 # Indexes are half open, e.g the start index is inclusive
25963 # and the end index is exclusive -- [start_index, end_index).
25964 # Missing indexes indicate the range is unbounded on that side.
25965 #
25966 # For example, if "Sheet1" is grid ID 0, then:
25967 #
25968 # Sheet1!A1:A1 == sheet_id: 0,
25969 # start_row_index: 0, end_row_index: 1,
25970 # start_column_index: 0, end_column_index: 1
25971 #
25972 # Sheet1!A3:B4 == sheet_id: 0,
25973 # start_row_index: 2, end_row_index: 4,
25974 # start_column_index: 0, end_column_index: 2
25975 #
25976 # Sheet1!A:B == sheet_id: 0,
25977 # start_column_index: 0, end_column_index: 2
25978 #
25979 # Sheet1!A5:B == sheet_id: 0,
25980 # start_row_index: 4,
25981 # start_column_index: 0, end_column_index: 2
25982 #
25983 # Sheet1 == sheet_id:0
25984 #
25985 # The start index must always be less than or equal to the end index.
25986 # If the start index equals the end index, then the range is empty.
25987 # Empty ranges are typically not meaningful and are usually rendered in the
25988 # UI as `#REF!`.
25989 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
25990 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
25991 "sheetId": 42, # The sheet this range is on.
25992 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
25993 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
25994 },
25995 "sortSpecs": [ # The sort order per column. Later specifications are used when values
25996 # are equal in the earlier specifications.
25997 { # A sort order associated with a specific column or row.
25998 "sortOrder": "A String", # The order data should be sorted.
25999 "dimensionIndex": 42, # The dimension the sort should be applied to.
26000 },
26001 ],
26002 "criteria": { # The criteria for showing/hiding values per column.
26003 # The map's key is the column index, and the value is the criteria for
26004 # that column.
26005 "a_key": { # Criteria for showing/hiding rows in a filter, filter view.
26006 "hiddenValues": [ # Values that should be hidden.
26007 "A String",
26008 ],
26009 "condition": { # A condition that can evaluate to true or false. # A condition that must be true for values to be shown.
26010 # (This does not override hiddenValues -- if a value is listed there,
26011 # it will still be hidden.)
26012 # BooleanConditions are used by conditional formatting,
26013 # data validation, and the criteria in filters.
26014 "type": "A String", # The type of condition.
26015 "values": [ # The values of the condition. The number of supported values depends
26016 # on the condition type. Some support zero values,
26017 # others one or two values,
26018 # and ConditionType.ONE_OF_LIST supports an arbitrary number of values.
26019 { # The value of the condition.
26020 "relativeDate": "A String", # A relative date (based on the current date).
26021 # Valid only if the type is
26022 # DATE_BEFORE,
26023 # DATE_AFTER,
26024 # DATE_ON_OR_BEFORE or
26025 # DATE_ON_OR_AFTER.
26026 #
26027 # Relative dates are not supported in data validation.
26028 # They are supported only in conditional formatting and
26029 # conditional filters.
26030 "userEnteredValue": "A String", # A value the condition is based on.
26031 # The value will be parsed as if the user typed into a cell.
26032 # Formulas are supported (and must begin with an `=`).
26033 },
26034 ],
26035 },
26036 },
26037 },
26038 },
26039 "charts": [ # The specifications of every chart on this sheet.
26040 { # A chart embedded in a sheet.
26041 "chartId": 42, # The ID of the chart.
26042 "position": { # The position of an embedded object such as a chart. # The position of the chart.
26043 "newSheet": True or False, # If true, the embedded object will be put on a new sheet whose ID
26044 # is chosen for you. Used only when writing.
26045 "sheetId": 42, # The sheet this is on. Set only if the embedded object
26046 # is on its own sheet. Must be non-negative.
26047 "overlayPosition": { # The location an object is overlaid on top of a grid. # The position the object is overlaid on top of a grid.
26048 "anchorCell": { # A coordinate in a sheet. # The cell the object is anchored to.
26049 # All indexes are zero-based.
26050 "rowIndex": 42, # The row index of the coordinate.
26051 "columnIndex": 42, # The column index of the coordinate.
26052 "sheetId": 42, # The sheet this coordinate is on.
26053 },
26054 "offsetYPixels": 42, # The vertical offset, in pixels, that the object is offset
26055 # from the anchor cell.
26056 "widthPixels": 42, # The width of the object, in pixels. Defaults to 600.
26057 "offsetXPixels": 42, # The horizontal offset, in pixels, that the object is offset
26058 # from the anchor cell.
26059 "heightPixels": 42, # The height of the object, in pixels. Defaults to 371.
26060 },
26061 },
26062 "spec": { # The specifications of a chart. # The specification of the chart.
26063 "hiddenDimensionStrategy": "A String", # Determines how the charts will use hidden rows or columns.
26064 # This value is only meaningful if the
26065 # ChartData.sourceRange
26066 # is used for a domain or series.
26067 "pieChart": { # A <a href="/chart/interactive/docs/gallery/piechart">pie chart</a>. # A pie chart specification.
26068 "series": { # The data included in a domain or series. # The data that covers the one and only series of the pie chart.
26069 "sourceRange": { # Source ranges for a chart. # The source ranges of the data.
26070 "sources": [ # The ranges of data for a series or domain.
26071 # Exactly one dimension must have a length of 1,
26072 # and all sources in the list must have the same dimension
26073 # with length 1.
26074 # The domain (if it exists) & all series must have the same number
26075 # of source ranges. If using more than one source range, then the source
26076 # range at a given offset must be contiguous across the domain and series.
26077 #
26078 # For example, these are valid configurations:
26079 #
26080 # domain sources: A1:A5
26081 # series1 sources: B1:B5
26082 # series2 sources: D6:D10
26083 #
26084 # domain sources: A1:A5, C10:C12
26085 # series1 sources: B1:B5, D10:D12
26086 # series2 sources: C1:C5, E10:E12
26087 { # A range on a sheet.
26088 # All indexes are zero-based.
26089 # Indexes are half open, e.g the start index is inclusive
26090 # and the end index is exclusive -- [start_index, end_index).
26091 # Missing indexes indicate the range is unbounded on that side.
26092 #
26093 # For example, if "Sheet1" is grid ID 0, then:
26094 #
26095 # Sheet1!A1:A1 == sheet_id: 0,
26096 # start_row_index: 0, end_row_index: 1,
26097 # start_column_index: 0, end_column_index: 1
26098 #
26099 # Sheet1!A3:B4 == sheet_id: 0,
26100 # start_row_index: 2, end_row_index: 4,
26101 # start_column_index: 0, end_column_index: 2
26102 #
26103 # Sheet1!A:B == sheet_id: 0,
26104 # start_column_index: 0, end_column_index: 2
26105 #
26106 # Sheet1!A5:B == sheet_id: 0,
26107 # start_row_index: 4,
26108 # start_column_index: 0, end_column_index: 2
26109 #
26110 # Sheet1 == sheet_id:0
26111 #
26112 # The start index must always be less than or equal to the end index.
26113 # If the start index equals the end index, then the range is empty.
26114 # Empty ranges are typically not meaningful and are usually rendered in the
26115 # UI as `#REF!`.
26116 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
26117 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
26118 "sheetId": 42, # The sheet this range is on.
26119 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
26120 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
26121 },
26122 ],
26123 },
26124 },
26125 "domain": { # The data included in a domain or series. # The data that covers the domain of the pie chart.
26126 "sourceRange": { # Source ranges for a chart. # The source ranges of the data.
26127 "sources": [ # The ranges of data for a series or domain.
26128 # Exactly one dimension must have a length of 1,
26129 # and all sources in the list must have the same dimension
26130 # with length 1.
26131 # The domain (if it exists) & all series must have the same number
26132 # of source ranges. If using more than one source range, then the source
26133 # range at a given offset must be contiguous across the domain and series.
26134 #
26135 # For example, these are valid configurations:
26136 #
26137 # domain sources: A1:A5
26138 # series1 sources: B1:B5
26139 # series2 sources: D6:D10
26140 #
26141 # domain sources: A1:A5, C10:C12
26142 # series1 sources: B1:B5, D10:D12
26143 # series2 sources: C1:C5, E10:E12
26144 { # A range on a sheet.
26145 # All indexes are zero-based.
26146 # Indexes are half open, e.g the start index is inclusive
26147 # and the end index is exclusive -- [start_index, end_index).
26148 # Missing indexes indicate the range is unbounded on that side.
26149 #
26150 # For example, if "Sheet1" is grid ID 0, then:
26151 #
26152 # Sheet1!A1:A1 == sheet_id: 0,
26153 # start_row_index: 0, end_row_index: 1,
26154 # start_column_index: 0, end_column_index: 1
26155 #
26156 # Sheet1!A3:B4 == sheet_id: 0,
26157 # start_row_index: 2, end_row_index: 4,
26158 # start_column_index: 0, end_column_index: 2
26159 #
26160 # Sheet1!A:B == sheet_id: 0,
26161 # start_column_index: 0, end_column_index: 2
26162 #
26163 # Sheet1!A5:B == sheet_id: 0,
26164 # start_row_index: 4,
26165 # start_column_index: 0, end_column_index: 2
26166 #
26167 # Sheet1 == sheet_id:0
26168 #
26169 # The start index must always be less than or equal to the end index.
26170 # If the start index equals the end index, then the range is empty.
26171 # Empty ranges are typically not meaningful and are usually rendered in the
26172 # UI as `#REF!`.
26173 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
26174 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
26175 "sheetId": 42, # The sheet this range is on.
26176 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
26177 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
26178 },
26179 ],
26180 },
26181 },
26182 "threeDimensional": True or False, # True if the pie is three dimensional.
26183 "legendPosition": "A String", # Where the legend of the pie chart should be drawn.
26184 "pieHole": 3.14, # The size of the hole in the pie chart.
26185 },
26186 "basicChart": { # The specification for a basic chart. See BasicChartType for the list # A basic chart specification, can be one of many kinds of charts.
26187 # See BasicChartType for the list of all charts this supports.
26188 # of charts this supports.
26189 "headerCount": 42, # The number of rows or columns in the data that are "headers".
26190 # If not set, Google Sheets will guess how many rows are headers based
26191 # on the data.
26192 #
26193 # (Note that BasicChartAxis.title may override the axis title
26194 # inferred from the header values.)
26195 "series": [ # The data this chart is visualizing.
26196 { # A single series of data in a chart.
26197 # For example, if charting stock prices over time, multiple series may exist,
26198 # one for the "Open Price", "High Price", "Low Price" and "Close Price".
26199 "series": { # The data included in a domain or series. # The data being visualized in this chart series.
26200 "sourceRange": { # Source ranges for a chart. # The source ranges of the data.
26201 "sources": [ # The ranges of data for a series or domain.
26202 # Exactly one dimension must have a length of 1,
26203 # and all sources in the list must have the same dimension
26204 # with length 1.
26205 # The domain (if it exists) & all series must have the same number
26206 # of source ranges. If using more than one source range, then the source
26207 # range at a given offset must be contiguous across the domain and series.
26208 #
26209 # For example, these are valid configurations:
26210 #
26211 # domain sources: A1:A5
26212 # series1 sources: B1:B5
26213 # series2 sources: D6:D10
26214 #
26215 # domain sources: A1:A5, C10:C12
26216 # series1 sources: B1:B5, D10:D12
26217 # series2 sources: C1:C5, E10:E12
26218 { # A range on a sheet.
26219 # All indexes are zero-based.
26220 # Indexes are half open, e.g the start index is inclusive
26221 # and the end index is exclusive -- [start_index, end_index).
26222 # Missing indexes indicate the range is unbounded on that side.
26223 #
26224 # For example, if "Sheet1" is grid ID 0, then:
26225 #
26226 # Sheet1!A1:A1 == sheet_id: 0,
26227 # start_row_index: 0, end_row_index: 1,
26228 # start_column_index: 0, end_column_index: 1
26229 #
26230 # Sheet1!A3:B4 == sheet_id: 0,
26231 # start_row_index: 2, end_row_index: 4,
26232 # start_column_index: 0, end_column_index: 2
26233 #
26234 # Sheet1!A:B == sheet_id: 0,
26235 # start_column_index: 0, end_column_index: 2
26236 #
26237 # Sheet1!A5:B == sheet_id: 0,
26238 # start_row_index: 4,
26239 # start_column_index: 0, end_column_index: 2
26240 #
26241 # Sheet1 == sheet_id:0
26242 #
26243 # The start index must always be less than or equal to the end index.
26244 # If the start index equals the end index, then the range is empty.
26245 # Empty ranges are typically not meaningful and are usually rendered in the
26246 # UI as `#REF!`.
26247 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
26248 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
26249 "sheetId": 42, # The sheet this range is on.
26250 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
26251 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
26252 },
26253 ],
26254 },
26255 },
26256 "targetAxis": "A String", # The minor axis that will specify the range of values for this series.
26257 # For example, if charting stocks over time, the "Volume" series
26258 # may want to be pinned to the right with the prices pinned to the left,
26259 # because the scale of trading volume is different than the scale of
26260 # prices.
26261 # It is an error to specify an axis that isn't a valid minor axis
26262 # for the chart's type.
26263 "type": "A String", # The type of this series. Valid only if the
26264 # chartType is
26265 # COMBO.
26266 # Different types will change the way the series is visualized.
26267 # Only LINE, AREA,
26268 # and COLUMN are supported.
26269 },
26270 ],
26271 "legendPosition": "A String", # The position of the chart legend.
26272 "domains": [ # The domain of data this is charting.
26273 # Only a single domain is currently supported.
26274 { # The domain of a chart.
26275 # For example, if charting stock prices over time, this would be the date.
26276 "domain": { # The data included in a domain or series. # The data of the domain. For example, if charting stock prices over time,
26277 # this be the data representing the dates.
26278 "sourceRange": { # Source ranges for a chart. # The source ranges of the data.
26279 "sources": [ # The ranges of data for a series or domain.
26280 # Exactly one dimension must have a length of 1,
26281 # and all sources in the list must have the same dimension
26282 # with length 1.
26283 # The domain (if it exists) & all series must have the same number
26284 # of source ranges. If using more than one source range, then the source
26285 # range at a given offset must be contiguous across the domain and series.
26286 #
26287 # For example, these are valid configurations:
26288 #
26289 # domain sources: A1:A5
26290 # series1 sources: B1:B5
26291 # series2 sources: D6:D10
26292 #
26293 # domain sources: A1:A5, C10:C12
26294 # series1 sources: B1:B5, D10:D12
26295 # series2 sources: C1:C5, E10:E12
26296 { # A range on a sheet.
26297 # All indexes are zero-based.
26298 # Indexes are half open, e.g the start index is inclusive
26299 # and the end index is exclusive -- [start_index, end_index).
26300 # Missing indexes indicate the range is unbounded on that side.
26301 #
26302 # For example, if "Sheet1" is grid ID 0, then:
26303 #
26304 # Sheet1!A1:A1 == sheet_id: 0,
26305 # start_row_index: 0, end_row_index: 1,
26306 # start_column_index: 0, end_column_index: 1
26307 #
26308 # Sheet1!A3:B4 == sheet_id: 0,
26309 # start_row_index: 2, end_row_index: 4,
26310 # start_column_index: 0, end_column_index: 2
26311 #
26312 # Sheet1!A:B == sheet_id: 0,
26313 # start_column_index: 0, end_column_index: 2
26314 #
26315 # Sheet1!A5:B == sheet_id: 0,
26316 # start_row_index: 4,
26317 # start_column_index: 0, end_column_index: 2
26318 #
26319 # Sheet1 == sheet_id:0
26320 #
26321 # The start index must always be less than or equal to the end index.
26322 # If the start index equals the end index, then the range is empty.
26323 # Empty ranges are typically not meaningful and are usually rendered in the
26324 # UI as `#REF!`.
26325 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
26326 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
26327 "sheetId": 42, # The sheet this range is on.
26328 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
26329 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
26330 },
26331 ],
26332 },
26333 },
26334 },
26335 ],
26336 "chartType": "A String", # The type of the chart.
26337 "axis": [ # The axis on the chart.
26338 { # An axis of the chart.
26339 # A chart may not have more than one axis per
26340 # axis position.
26341 "position": "A String", # The position of this axis.
26342 "format": { # The format of a run of text in a cell. # The format of the title.
26343 # Only valid if the axis is not associated with the domain.
26344 # Absent values indicate that the field isn't specified.
26345 "foregroundColor": { # Represents a color in the RGBA color space. This representation is designed # The foreground color of the text.
26346 # for simplicity of conversion to/from color representations in various
26347 # languages over compactness; for example, the fields of this representation
26348 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
26349 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
26350 # method in iOS; and, with just a little work, it can be easily formatted into
26351 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
26352 #
26353 # Example (Java):
26354 #
26355 # import com.google.type.Color;
26356 #
26357 # // ...
26358 # public static java.awt.Color fromProto(Color protocolor) {
26359 # float alpha = protocolor.hasAlpha()
26360 # ? protocolor.getAlpha().getValue()
26361 # : 1.0;
26362 #
26363 # return new java.awt.Color(
26364 # protocolor.getRed(),
26365 # protocolor.getGreen(),
26366 # protocolor.getBlue(),
26367 # alpha);
26368 # }
26369 #
26370 # public static Color toProto(java.awt.Color color) {
26371 # float red = (float) color.getRed();
26372 # float green = (float) color.getGreen();
26373 # float blue = (float) color.getBlue();
26374 # float denominator = 255.0;
26375 # Color.Builder resultBuilder =
26376 # Color
26377 # .newBuilder()
26378 # .setRed(red / denominator)
26379 # .setGreen(green / denominator)
26380 # .setBlue(blue / denominator);
26381 # int alpha = color.getAlpha();
26382 # if (alpha != 255) {
26383 # result.setAlpha(
26384 # FloatValue
26385 # .newBuilder()
26386 # .setValue(((float) alpha) / denominator)
26387 # .build());
26388 # }
26389 # return resultBuilder.build();
26390 # }
26391 # // ...
26392 #
26393 # Example (iOS / Obj-C):
26394 #
26395 # // ...
26396 # static UIColor* fromProto(Color* protocolor) {
26397 # float red = [protocolor red];
26398 # float green = [protocolor green];
26399 # float blue = [protocolor blue];
26400 # FloatValue* alpha_wrapper = [protocolor alpha];
26401 # float alpha = 1.0;
26402 # if (alpha_wrapper != nil) {
26403 # alpha = [alpha_wrapper value];
26404 # }
26405 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
26406 # }
26407 #
26408 # static Color* toProto(UIColor* color) {
26409 # CGFloat red, green, blue, alpha;
26410 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
26411 # return nil;
26412 # }
26413 # Color* result = [Color alloc] init];
26414 # [result setRed:red];
26415 # [result setGreen:green];
26416 # [result setBlue:blue];
26417 # if (alpha <= 0.9999) {
26418 # [result setAlpha:floatWrapperWithValue(alpha)];
26419 # }
26420 # [result autorelease];
26421 # return result;
26422 # }
26423 # // ...
26424 #
26425 # Example (JavaScript):
26426 #
26427 # // ...
26428 #
26429 # var protoToCssColor = function(rgb_color) {
26430 # var redFrac = rgb_color.red || 0.0;
26431 # var greenFrac = rgb_color.green || 0.0;
26432 # var blueFrac = rgb_color.blue || 0.0;
26433 # var red = Math.floor(redFrac * 255);
26434 # var green = Math.floor(greenFrac * 255);
26435 # var blue = Math.floor(blueFrac * 255);
26436 #
26437 # if (!('alpha' in rgb_color)) {
26438 # return rgbToCssColor_(red, green, blue);
26439 # }
26440 #
26441 # var alphaFrac = rgb_color.alpha.value || 0.0;
26442 # var rgbParams = [red, green, blue].join(',');
26443 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
26444 # };
26445 #
26446 # var rgbToCssColor_ = function(red, green, blue) {
26447 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
26448 # var hexString = rgbNumber.toString(16);
26449 # var missingZeros = 6 - hexString.length;
26450 # var resultBuilder = ['#'];
26451 # for (var i = 0; i < missingZeros; i++) {
26452 # resultBuilder.push('0');
26453 # }
26454 # resultBuilder.push(hexString);
26455 # return resultBuilder.join('');
26456 # };
26457 #
26458 # // ...
26459 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
26460 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
26461 # the final pixel color is defined by the equation:
26462 #
26463 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
26464 #
26465 # This means that a value of 1.0 corresponds to a solid color, whereas
26466 # a value of 0.0 corresponds to a completely transparent color. This
26467 # uses a wrapper message rather than a simple float scalar so that it is
26468 # possible to distinguish between a default value and the value being unset.
26469 # If omitted, this color object is to be rendered as a solid color
26470 # (as if the alpha value had been explicitly given with a value of 1.0).
26471 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
26472 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
26473 },
26474 "bold": True or False, # True if the text is bold.
26475 "strikethrough": True or False, # True if the text has a strikethrough.
26476 "fontFamily": "A String", # The font family.
26477 "fontSize": 42, # The size of the font.
26478 "italic": True or False, # True if the text is italicized.
26479 "underline": True or False, # True if the text is underlined.
26480 },
26481 "title": "A String", # The title of this axis. If set, this overrides any title inferred
26482 # from headers of the data.
26483 },
26484 ],
26485 },
26486 "title": "A String", # The title of the chart.
26487 },
26488 },
26489 ],
26490 "filterViews": [ # The filter views in this sheet.
26491 { # A filter view.
26492 "title": "A String", # The name of the filter view.
26493 "namedRangeId": "A String", # The named range this filter view is backed by, if any.
26494 #
26495 # When writing, only one of range or namedRangeId
26496 # may be set.
26497 "filterViewId": 42, # The ID of the filter view.
26498 "range": { # A range on a sheet. # The range this filter view covers.
26499 #
26500 # When writing, only one of range or namedRangeId
26501 # may be set.
26502 # All indexes are zero-based.
26503 # Indexes are half open, e.g the start index is inclusive
26504 # and the end index is exclusive -- [start_index, end_index).
26505 # Missing indexes indicate the range is unbounded on that side.
26506 #
26507 # For example, if "Sheet1" is grid ID 0, then:
26508 #
26509 # Sheet1!A1:A1 == sheet_id: 0,
26510 # start_row_index: 0, end_row_index: 1,
26511 # start_column_index: 0, end_column_index: 1
26512 #
26513 # Sheet1!A3:B4 == sheet_id: 0,
26514 # start_row_index: 2, end_row_index: 4,
26515 # start_column_index: 0, end_column_index: 2
26516 #
26517 # Sheet1!A:B == sheet_id: 0,
26518 # start_column_index: 0, end_column_index: 2
26519 #
26520 # Sheet1!A5:B == sheet_id: 0,
26521 # start_row_index: 4,
26522 # start_column_index: 0, end_column_index: 2
26523 #
26524 # Sheet1 == sheet_id:0
26525 #
26526 # The start index must always be less than or equal to the end index.
26527 # If the start index equals the end index, then the range is empty.
26528 # Empty ranges are typically not meaningful and are usually rendered in the
26529 # UI as `#REF!`.
26530 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
26531 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
26532 "sheetId": 42, # The sheet this range is on.
26533 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
26534 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
26535 },
26536 "sortSpecs": [ # The sort order per column. Later specifications are used when values
26537 # are equal in the earlier specifications.
26538 { # A sort order associated with a specific column or row.
26539 "sortOrder": "A String", # The order data should be sorted.
26540 "dimensionIndex": 42, # The dimension the sort should be applied to.
26541 },
26542 ],
26543 "criteria": { # The criteria for showing/hiding values per column.
26544 # The map's key is the column index, and the value is the criteria for
26545 # that column.
26546 "a_key": { # Criteria for showing/hiding rows in a filter, filter view.
26547 "hiddenValues": [ # Values that should be hidden.
26548 "A String",
26549 ],
26550 "condition": { # A condition that can evaluate to true or false. # A condition that must be true for values to be shown.
26551 # (This does not override hiddenValues -- if a value is listed there,
26552 # it will still be hidden.)
26553 # BooleanConditions are used by conditional formatting,
26554 # data validation, and the criteria in filters.
26555 "type": "A String", # The type of condition.
26556 "values": [ # The values of the condition. The number of supported values depends
26557 # on the condition type. Some support zero values,
26558 # others one or two values,
26559 # and ConditionType.ONE_OF_LIST supports an arbitrary number of values.
26560 { # The value of the condition.
26561 "relativeDate": "A String", # A relative date (based on the current date).
26562 # Valid only if the type is
26563 # DATE_BEFORE,
26564 # DATE_AFTER,
26565 # DATE_ON_OR_BEFORE or
26566 # DATE_ON_OR_AFTER.
26567 #
26568 # Relative dates are not supported in data validation.
26569 # They are supported only in conditional formatting and
26570 # conditional filters.
26571 "userEnteredValue": "A String", # A value the condition is based on.
26572 # The value will be parsed as if the user typed into a cell.
26573 # Formulas are supported (and must begin with an `=`).
26574 },
26575 ],
26576 },
26577 },
26578 },
26579 },
26580 ],
26581 "protectedRanges": [ # The protected ranges in this sheet.
26582 { # A protected range.
26583 "unprotectedRanges": [ # The list of unprotected ranges within a protected sheet.
26584 # Unprotected ranges are only supported on protected sheets.
26585 { # A range on a sheet.
26586 # All indexes are zero-based.
26587 # Indexes are half open, e.g the start index is inclusive
26588 # and the end index is exclusive -- [start_index, end_index).
26589 # Missing indexes indicate the range is unbounded on that side.
26590 #
26591 # For example, if "Sheet1" is grid ID 0, then:
26592 #
26593 # Sheet1!A1:A1 == sheet_id: 0,
26594 # start_row_index: 0, end_row_index: 1,
26595 # start_column_index: 0, end_column_index: 1
26596 #
26597 # Sheet1!A3:B4 == sheet_id: 0,
26598 # start_row_index: 2, end_row_index: 4,
26599 # start_column_index: 0, end_column_index: 2
26600 #
26601 # Sheet1!A:B == sheet_id: 0,
26602 # start_column_index: 0, end_column_index: 2
26603 #
26604 # Sheet1!A5:B == sheet_id: 0,
26605 # start_row_index: 4,
26606 # start_column_index: 0, end_column_index: 2
26607 #
26608 # Sheet1 == sheet_id:0
26609 #
26610 # The start index must always be less than or equal to the end index.
26611 # If the start index equals the end index, then the range is empty.
26612 # Empty ranges are typically not meaningful and are usually rendered in the
26613 # UI as `#REF!`.
26614 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
26615 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
26616 "sheetId": 42, # The sheet this range is on.
26617 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
26618 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
26619 },
26620 ],
26621 "requestingUserCanEdit": True or False, # True if the user who requested this protected range can edit the
26622 # protected area.
26623 # This field is read-only.
26624 "description": "A String", # The description of this protected range.
26625 "namedRangeId": "A String", # The named range this protected range is backed by, if any.
26626 #
26627 # When writing, only one of range or namedRangeId
26628 # may be set.
26629 "editors": { # The editors of a protected range. # The users and groups with edit access to the protected range.
26630 # This field is only visible to users with edit access to the protected
26631 # range and the document.
26632 # Editors are not supported with warningOnly protection.
26633 "domainUsersCanEdit": True or False, # True if anyone in the document's domain has edit access to the protected
26634 # range. Domain protection is only supported on documents within a domain.
26635 "users": [ # The email addresses of users with edit access to the protected range.
26636 "A String",
26637 ],
26638 "groups": [ # The email addresses of groups with edit access to the protected range.
26639 "A String",
26640 ],
26641 },
26642 "protectedRangeId": 42, # The ID of the protected range.
26643 # This field is read-only.
26644 "warningOnly": True or False, # True if this this protected range will show a warning when editing.
26645 # Warning-based protection means that every user can edit data in the
26646 # protected range, except editing will prompt a warning asking the user
26647 # to confirm the edit.
26648 #
26649 # When warning: if this field is true, then editors is ignored.
26650 # Additionally, if this field is changed from true to false and the
26651 # `editors` field is not set (nor included in the field mask), then
26652 # the editors will be set to all the editors in the document.
26653 "range": { # A range on a sheet. # The range that is being protected.
26654 # The range may be fully unbounded, in which case this is considered
26655 # a protected sheet.
26656 #
26657 # When writing, only one of range or namedRangeId
26658 # may be set.
26659 # All indexes are zero-based.
26660 # Indexes are half open, e.g the start index is inclusive
26661 # and the end index is exclusive -- [start_index, end_index).
26662 # Missing indexes indicate the range is unbounded on that side.
26663 #
26664 # For example, if "Sheet1" is grid ID 0, then:
26665 #
26666 # Sheet1!A1:A1 == sheet_id: 0,
26667 # start_row_index: 0, end_row_index: 1,
26668 # start_column_index: 0, end_column_index: 1
26669 #
26670 # Sheet1!A3:B4 == sheet_id: 0,
26671 # start_row_index: 2, end_row_index: 4,
26672 # start_column_index: 0, end_column_index: 2
26673 #
26674 # Sheet1!A:B == sheet_id: 0,
26675 # start_column_index: 0, end_column_index: 2
26676 #
26677 # Sheet1!A5:B == sheet_id: 0,
26678 # start_row_index: 4,
26679 # start_column_index: 0, end_column_index: 2
26680 #
26681 # Sheet1 == sheet_id:0
26682 #
26683 # The start index must always be less than or equal to the end index.
26684 # If the start index equals the end index, then the range is empty.
26685 # Empty ranges are typically not meaningful and are usually rendered in the
26686 # UI as `#REF!`.
26687 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
26688 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
26689 "sheetId": 42, # The sheet this range is on.
26690 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
26691 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
26692 },
26693 },
26694 ],
26695 "data": [ # Data in the grid, if this is a grid sheet.
26696 # The number of GridData objects returned is dependent on the number of
26697 # ranges requested on this sheet. For example, if this is representing
26698 # `Sheet1`, and the spreadsheet was requested with ranges
26699 # `Sheet1!A1:C10` and `Sheet1!D15:E20`, then the first GridData will have a
26700 # startRow/startColumn of `0`,
26701 # while the second one will have `startRow 14` (zero-based row 15),
26702 # and `startColumn 3` (zero-based column D).
26703 { # Data in the grid, as well as metadata about the dimensions.
26704 "startRow": 42, # The first row this GridData refers to, zero-based.
26705 "rowMetadata": [ # Metadata about the requested rows in the grid, starting with the row
26706 # in startRow.
26707 { # Properties about a dimension.
26708 "pixelSize": 42, # The height (if a row) or width (if a column) of the dimension in pixels.
26709 "hiddenByUser": True or False, # True if this dimension is explicitly hidden.
26710 "hiddenByFilter": True or False, # True if this dimension is being filtered.
26711 # This field is read-only.
26712 },
26713 ],
26714 "startColumn": 42, # The first column this GridData refers to, zero-based.
26715 "columnMetadata": [ # Metadata about the requested columns in the grid, starting with the column
26716 # in startColumn.
26717 { # Properties about a dimension.
26718 "pixelSize": 42, # The height (if a row) or width (if a column) of the dimension in pixels.
26719 "hiddenByUser": True or False, # True if this dimension is explicitly hidden.
26720 "hiddenByFilter": True or False, # True if this dimension is being filtered.
26721 # This field is read-only.
26722 },
26723 ],
26724 "rowData": [ # The data in the grid, one entry per row,
26725 # starting with the row in startRow.
26726 # The values in RowData will correspond to columns starting
26727 # at startColumn.
26728 { # Data about each cell in a row.
26729 "values": [ # The values in the row, one per column.
26730 { # Data about a specific cell.
26731 "pivotTable": { # A pivot table. # A pivot table anchored at this cell. The size of pivot table itself
26732 # is computed dynamically based on its data, grouping, filters, values,
26733 # etc... Only the top-left cell of the pivot table contains the pivot table
26734 # definition. The other cells will contain the calculated values of the
26735 # results of the pivot in their effectiveValue fields.
26736 "valueLayout": "A String", # Whether values should be listed horizontally (as columns)
26737 # or vertically (as rows).
26738 "rows": [ # Each row grouping in the pivot table.
26739 { # A single grouping (either row or column) in a pivot table.
26740 "showTotals": True or False, # True if the pivot table should include the totals for this grouping.
26741 "valueMetadata": [ # Metadata about values in the grouping.
26742 { # Metadata about a value in a pivot grouping.
26743 "collapsed": True or False, # True if the data corresponding to the value is collapsed.
26744 "value": { # The kinds of value that a cell in a spreadsheet can have. # The calculated value the metadata corresponds to.
26745 # (Note that formulaValue is not valid,
26746 # because the values will be calculated.)
26747 "numberValue": 3.14, # Represents a double value.
26748 # Note: Dates, Times and DateTimes are represented as doubles in
26749 # "serial number" format.
26750 "boolValue": True or False, # Represents a boolean value.
26751 "formulaValue": "A String", # Represents a formula.
26752 "stringValue": "A String", # Represents a string value.
26753 # Leading single quotes are not included. For example, if the user typed
26754 # `'123` into the UI, this would be represented as a `stringValue` of
26755 # `"123"`.
26756 "errorValue": { # An error in a cell. # Represents an error.
26757 # This field is read-only.
26758 "message": "A String", # A message with more information about the error
26759 # (in the spreadsheet's locale).
26760 "type": "A String", # The type of error.
26761 },
26762 },
26763 },
26764 ],
26765 "valueBucket": { # Information about which values in a pivot group should be used for sorting. # The bucket of the opposite pivot group to sort by.
26766 # If not specified, sorting is alphabetical by this group's values.
26767 "buckets": [ # Determines the bucket from which values are chosen to sort.
26768 #
26769 # For example, in a pivot table with one row group & two column groups,
26770 # the row group can list up to two values. The first value corresponds
26771 # to a value within the first column group, and the second value
26772 # corresponds to a value in the second column group. If no values
26773 # are listed, this would indicate that the row should be sorted according
26774 # to the "Grand Total" over the column groups. If a single value is listed,
26775 # this would correspond to using the "Total" of that bucket.
26776 { # The kinds of value that a cell in a spreadsheet can have.
26777 "numberValue": 3.14, # Represents a double value.
26778 # Note: Dates, Times and DateTimes are represented as doubles in
26779 # "serial number" format.
26780 "boolValue": True or False, # Represents a boolean value.
26781 "formulaValue": "A String", # Represents a formula.
26782 "stringValue": "A String", # Represents a string value.
26783 # Leading single quotes are not included. For example, if the user typed
26784 # `'123` into the UI, this would be represented as a `stringValue` of
26785 # `"123"`.
26786 "errorValue": { # An error in a cell. # Represents an error.
26787 # This field is read-only.
26788 "message": "A String", # A message with more information about the error
26789 # (in the spreadsheet's locale).
26790 "type": "A String", # The type of error.
26791 },
26792 },
26793 ],
26794 "valuesIndex": 42, # The offset in the [PivotTable.values] list which the values in this
26795 # grouping should be sorted by.
26796 },
26797 "sortOrder": "A String", # The order the values in this group should be sorted.
26798 "sourceColumnOffset": 42, # The column offset of the source range that this grouping is based on.
26799 #
26800 # For example, if the source was `C10:E15', a `sourceColumnOffset` of `0`
26801 # means this group refers to column `C`, whereas the offset `1` would refer
26802 # to column `D`.
26803 },
26804 ],
26805 "source": { # A range on a sheet. # The range the pivot table is reading data from.
26806 # All indexes are zero-based.
26807 # Indexes are half open, e.g the start index is inclusive
26808 # and the end index is exclusive -- [start_index, end_index).
26809 # Missing indexes indicate the range is unbounded on that side.
26810 #
26811 # For example, if "Sheet1" is grid ID 0, then:
26812 #
26813 # Sheet1!A1:A1 == sheet_id: 0,
26814 # start_row_index: 0, end_row_index: 1,
26815 # start_column_index: 0, end_column_index: 1
26816 #
26817 # Sheet1!A3:B4 == sheet_id: 0,
26818 # start_row_index: 2, end_row_index: 4,
26819 # start_column_index: 0, end_column_index: 2
26820 #
26821 # Sheet1!A:B == sheet_id: 0,
26822 # start_column_index: 0, end_column_index: 2
26823 #
26824 # Sheet1!A5:B == sheet_id: 0,
26825 # start_row_index: 4,
26826 # start_column_index: 0, end_column_index: 2
26827 #
26828 # Sheet1 == sheet_id:0
26829 #
26830 # The start index must always be less than or equal to the end index.
26831 # If the start index equals the end index, then the range is empty.
26832 # Empty ranges are typically not meaningful and are usually rendered in the
26833 # UI as `#REF!`.
26834 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
26835 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
26836 "sheetId": 42, # The sheet this range is on.
26837 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
26838 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
26839 },
26840 "values": [ # A list of values to include in the pivot table.
26841 { # The definition of how a value in a pivot table should be calculated.
26842 "formula": "A String", # A custom formula to calculate the value. The formula must start
26843 # with an `=` character.
26844 "summarizeFunction": "A String", # A function to summarize the value.
26845 # If formula is set, the only supported values are
26846 # SUM and
26847 # CUSTOM.
26848 # If sourceColumnOffset is set, then `CUSTOM`
26849 # is not supported.
26850 "sourceColumnOffset": 42, # The column offset of the source range that this value reads from.
26851 #
26852 # For example, if the source was `C10:E15', a `sourceColumnOffset` of `0`
26853 # means this value refers to column `C`, whereas the offset `1` would
26854 # refer to column `D`.
26855 "name": "A String", # A name to use for the value. This is only used if formula was set.
26856 # Otherwise, the column name is used.
26857 },
26858 ],
26859 "criteria": { # An optional mapping of filters per source column offset.
26860 #
26861 # The filters will be applied before aggregating data into the pivot table.
26862 # The map's key is the column offset of the source range that you want to
26863 # filter, and the value is the criteria for that column.
26864 #
26865 # For example, if the source was `C10:E15', a key of `0` will have the filter
26866 # for column `C`, whereas the key `1` is for column `D`.
26867 "a_key": { # Criteria for showing/hiding rows in a pivot table.
26868 "visibleValues": [ # Values that should be included. Values not listed here are excluded.
26869 "A String",
26870 ],
26871 },
26872 },
26873 "columns": [ # Each column grouping in the pivot table.
26874 { # A single grouping (either row or column) in a pivot table.
26875 "showTotals": True or False, # True if the pivot table should include the totals for this grouping.
26876 "valueMetadata": [ # Metadata about values in the grouping.
26877 { # Metadata about a value in a pivot grouping.
26878 "collapsed": True or False, # True if the data corresponding to the value is collapsed.
26879 "value": { # The kinds of value that a cell in a spreadsheet can have. # The calculated value the metadata corresponds to.
26880 # (Note that formulaValue is not valid,
26881 # because the values will be calculated.)
26882 "numberValue": 3.14, # Represents a double value.
26883 # Note: Dates, Times and DateTimes are represented as doubles in
26884 # "serial number" format.
26885 "boolValue": True or False, # Represents a boolean value.
26886 "formulaValue": "A String", # Represents a formula.
26887 "stringValue": "A String", # Represents a string value.
26888 # Leading single quotes are not included. For example, if the user typed
26889 # `'123` into the UI, this would be represented as a `stringValue` of
26890 # `"123"`.
26891 "errorValue": { # An error in a cell. # Represents an error.
26892 # This field is read-only.
26893 "message": "A String", # A message with more information about the error
26894 # (in the spreadsheet's locale).
26895 "type": "A String", # The type of error.
26896 },
26897 },
26898 },
26899 ],
26900 "valueBucket": { # Information about which values in a pivot group should be used for sorting. # The bucket of the opposite pivot group to sort by.
26901 # If not specified, sorting is alphabetical by this group's values.
26902 "buckets": [ # Determines the bucket from which values are chosen to sort.
26903 #
26904 # For example, in a pivot table with one row group & two column groups,
26905 # the row group can list up to two values. The first value corresponds
26906 # to a value within the first column group, and the second value
26907 # corresponds to a value in the second column group. If no values
26908 # are listed, this would indicate that the row should be sorted according
26909 # to the "Grand Total" over the column groups. If a single value is listed,
26910 # this would correspond to using the "Total" of that bucket.
26911 { # The kinds of value that a cell in a spreadsheet can have.
26912 "numberValue": 3.14, # Represents a double value.
26913 # Note: Dates, Times and DateTimes are represented as doubles in
26914 # "serial number" format.
26915 "boolValue": True or False, # Represents a boolean value.
26916 "formulaValue": "A String", # Represents a formula.
26917 "stringValue": "A String", # Represents a string value.
26918 # Leading single quotes are not included. For example, if the user typed
26919 # `'123` into the UI, this would be represented as a `stringValue` of
26920 # `"123"`.
26921 "errorValue": { # An error in a cell. # Represents an error.
26922 # This field is read-only.
26923 "message": "A String", # A message with more information about the error
26924 # (in the spreadsheet's locale).
26925 "type": "A String", # The type of error.
26926 },
26927 },
26928 ],
26929 "valuesIndex": 42, # The offset in the [PivotTable.values] list which the values in this
26930 # grouping should be sorted by.
26931 },
26932 "sortOrder": "A String", # The order the values in this group should be sorted.
26933 "sourceColumnOffset": 42, # The column offset of the source range that this grouping is based on.
26934 #
26935 # For example, if the source was `C10:E15', a `sourceColumnOffset` of `0`
26936 # means this group refers to column `C`, whereas the offset `1` would refer
26937 # to column `D`.
26938 },
26939 ],
26940 },
26941 "hyperlink": "A String", # A hyperlink this cell points to, if any.
26942 # This field is read-only. (To set it, use a `=HYPERLINK` formula.)
26943 "effectiveValue": { # The kinds of value that a cell in a spreadsheet can have. # The effective value of the cell. For cells with formulas, this will be
26944 # the calculated value. For cells with literals, this will be
26945 # the same as the user_entered_value.
26946 # This field is read-only.
26947 "numberValue": 3.14, # Represents a double value.
26948 # Note: Dates, Times and DateTimes are represented as doubles in
26949 # "serial number" format.
26950 "boolValue": True or False, # Represents a boolean value.
26951 "formulaValue": "A String", # Represents a formula.
26952 "stringValue": "A String", # Represents a string value.
26953 # Leading single quotes are not included. For example, if the user typed
26954 # `'123` into the UI, this would be represented as a `stringValue` of
26955 # `"123"`.
26956 "errorValue": { # An error in a cell. # Represents an error.
26957 # This field is read-only.
26958 "message": "A String", # A message with more information about the error
26959 # (in the spreadsheet's locale).
26960 "type": "A String", # The type of error.
26961 },
26962 },
26963 "formattedValue": "A String", # The formatted value of the cell.
26964 # This is the value as it's shown to the user.
26965 # This field is read-only.
26966 "userEnteredValue": { # The kinds of value that a cell in a spreadsheet can have. # The value the user entered in the cell. e.g, `1234`, `'Hello'`, or `=NOW()`
26967 # Note: Dates, Times and DateTimes are represented as doubles in
26968 # serial number format.
26969 "numberValue": 3.14, # Represents a double value.
26970 # Note: Dates, Times and DateTimes are represented as doubles in
26971 # "serial number" format.
26972 "boolValue": True or False, # Represents a boolean value.
26973 "formulaValue": "A String", # Represents a formula.
26974 "stringValue": "A String", # Represents a string value.
26975 # Leading single quotes are not included. For example, if the user typed
26976 # `'123` into the UI, this would be represented as a `stringValue` of
26977 # `"123"`.
26978 "errorValue": { # An error in a cell. # Represents an error.
26979 # This field is read-only.
26980 "message": "A String", # A message with more information about the error
26981 # (in the spreadsheet's locale).
26982 "type": "A String", # The type of error.
26983 },
26984 },
26985 "note": "A String", # Any note on the cell.
26986 "effectiveFormat": { # The format of a cell. # The effective format being used by the cell.
26987 # This includes the results of applying any conditional formatting and,
26988 # if the cell contains a formula, the computed number format.
26989 # If the effective format is the default format, effective format will
26990 # not be written.
26991 # This field is read-only.
26992 "numberFormat": { # The number format of a cell. # A format describing how number values should be represented to the user.
26993 # When updating, all fields must be set.
26994 "pattern": "A String", # Pattern string used for formatting.
26995 "type": "A String", # The type of the number format.
26996 },
26997 "textDirection": "A String", # The direction of the text in the cell.
26998 "padding": { # The amount of padding around the cell, in pixels. # The padding of the cell.
26999 # When updating padding, every field must be specified.
27000 "top": 42, # The top padding of the cell.
27001 "right": 42, # The right padding of the cell.
27002 "bottom": 42, # The bottom padding of the cell.
27003 "left": 42, # The left padding of the cell.
27004 },
27005 "horizontalAlignment": "A String", # The horizontal alignment of the value in cell.
27006 "backgroundColor": { # Represents a color in the RGBA color space. This representation is designed # The background color of the cell.
27007 # for simplicity of conversion to/from color representations in various
27008 # languages over compactness; for example, the fields of this representation
27009 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
27010 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
27011 # method in iOS; and, with just a little work, it can be easily formatted into
27012 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
27013 #
27014 # Example (Java):
27015 #
27016 # import com.google.type.Color;
27017 #
27018 # // ...
27019 # public static java.awt.Color fromProto(Color protocolor) {
27020 # float alpha = protocolor.hasAlpha()
27021 # ? protocolor.getAlpha().getValue()
27022 # : 1.0;
27023 #
27024 # return new java.awt.Color(
27025 # protocolor.getRed(),
27026 # protocolor.getGreen(),
27027 # protocolor.getBlue(),
27028 # alpha);
27029 # }
27030 #
27031 # public static Color toProto(java.awt.Color color) {
27032 # float red = (float) color.getRed();
27033 # float green = (float) color.getGreen();
27034 # float blue = (float) color.getBlue();
27035 # float denominator = 255.0;
27036 # Color.Builder resultBuilder =
27037 # Color
27038 # .newBuilder()
27039 # .setRed(red / denominator)
27040 # .setGreen(green / denominator)
27041 # .setBlue(blue / denominator);
27042 # int alpha = color.getAlpha();
27043 # if (alpha != 255) {
27044 # result.setAlpha(
27045 # FloatValue
27046 # .newBuilder()
27047 # .setValue(((float) alpha) / denominator)
27048 # .build());
27049 # }
27050 # return resultBuilder.build();
27051 # }
27052 # // ...
27053 #
27054 # Example (iOS / Obj-C):
27055 #
27056 # // ...
27057 # static UIColor* fromProto(Color* protocolor) {
27058 # float red = [protocolor red];
27059 # float green = [protocolor green];
27060 # float blue = [protocolor blue];
27061 # FloatValue* alpha_wrapper = [protocolor alpha];
27062 # float alpha = 1.0;
27063 # if (alpha_wrapper != nil) {
27064 # alpha = [alpha_wrapper value];
27065 # }
27066 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
27067 # }
27068 #
27069 # static Color* toProto(UIColor* color) {
27070 # CGFloat red, green, blue, alpha;
27071 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
27072 # return nil;
27073 # }
27074 # Color* result = [Color alloc] init];
27075 # [result setRed:red];
27076 # [result setGreen:green];
27077 # [result setBlue:blue];
27078 # if (alpha <= 0.9999) {
27079 # [result setAlpha:floatWrapperWithValue(alpha)];
27080 # }
27081 # [result autorelease];
27082 # return result;
27083 # }
27084 # // ...
27085 #
27086 # Example (JavaScript):
27087 #
27088 # // ...
27089 #
27090 # var protoToCssColor = function(rgb_color) {
27091 # var redFrac = rgb_color.red || 0.0;
27092 # var greenFrac = rgb_color.green || 0.0;
27093 # var blueFrac = rgb_color.blue || 0.0;
27094 # var red = Math.floor(redFrac * 255);
27095 # var green = Math.floor(greenFrac * 255);
27096 # var blue = Math.floor(blueFrac * 255);
27097 #
27098 # if (!('alpha' in rgb_color)) {
27099 # return rgbToCssColor_(red, green, blue);
27100 # }
27101 #
27102 # var alphaFrac = rgb_color.alpha.value || 0.0;
27103 # var rgbParams = [red, green, blue].join(',');
27104 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
27105 # };
27106 #
27107 # var rgbToCssColor_ = function(red, green, blue) {
27108 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
27109 # var hexString = rgbNumber.toString(16);
27110 # var missingZeros = 6 - hexString.length;
27111 # var resultBuilder = ['#'];
27112 # for (var i = 0; i < missingZeros; i++) {
27113 # resultBuilder.push('0');
27114 # }
27115 # resultBuilder.push(hexString);
27116 # return resultBuilder.join('');
27117 # };
27118 #
27119 # // ...
27120 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
27121 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
27122 # the final pixel color is defined by the equation:
27123 #
27124 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
27125 #
27126 # This means that a value of 1.0 corresponds to a solid color, whereas
27127 # a value of 0.0 corresponds to a completely transparent color. This
27128 # uses a wrapper message rather than a simple float scalar so that it is
27129 # possible to distinguish between a default value and the value being unset.
27130 # If omitted, this color object is to be rendered as a solid color
27131 # (as if the alpha value had been explicitly given with a value of 1.0).
27132 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
27133 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
27134 },
27135 "verticalAlignment": "A String", # The vertical alignment of the value in cell.
27136 "textFormat": { # The format of a run of text in a cell. # The format of the text in the cell (unless overridden by a format run).
27137 # Absent values indicate that the field isn't specified.
27138 "foregroundColor": { # Represents a color in the RGBA color space. This representation is designed # The foreground color of the text.
27139 # for simplicity of conversion to/from color representations in various
27140 # languages over compactness; for example, the fields of this representation
27141 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
27142 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
27143 # method in iOS; and, with just a little work, it can be easily formatted into
27144 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
27145 #
27146 # Example (Java):
27147 #
27148 # import com.google.type.Color;
27149 #
27150 # // ...
27151 # public static java.awt.Color fromProto(Color protocolor) {
27152 # float alpha = protocolor.hasAlpha()
27153 # ? protocolor.getAlpha().getValue()
27154 # : 1.0;
27155 #
27156 # return new java.awt.Color(
27157 # protocolor.getRed(),
27158 # protocolor.getGreen(),
27159 # protocolor.getBlue(),
27160 # alpha);
27161 # }
27162 #
27163 # public static Color toProto(java.awt.Color color) {
27164 # float red = (float) color.getRed();
27165 # float green = (float) color.getGreen();
27166 # float blue = (float) color.getBlue();
27167 # float denominator = 255.0;
27168 # Color.Builder resultBuilder =
27169 # Color
27170 # .newBuilder()
27171 # .setRed(red / denominator)
27172 # .setGreen(green / denominator)
27173 # .setBlue(blue / denominator);
27174 # int alpha = color.getAlpha();
27175 # if (alpha != 255) {
27176 # result.setAlpha(
27177 # FloatValue
27178 # .newBuilder()
27179 # .setValue(((float) alpha) / denominator)
27180 # .build());
27181 # }
27182 # return resultBuilder.build();
27183 # }
27184 # // ...
27185 #
27186 # Example (iOS / Obj-C):
27187 #
27188 # // ...
27189 # static UIColor* fromProto(Color* protocolor) {
27190 # float red = [protocolor red];
27191 # float green = [protocolor green];
27192 # float blue = [protocolor blue];
27193 # FloatValue* alpha_wrapper = [protocolor alpha];
27194 # float alpha = 1.0;
27195 # if (alpha_wrapper != nil) {
27196 # alpha = [alpha_wrapper value];
27197 # }
27198 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
27199 # }
27200 #
27201 # static Color* toProto(UIColor* color) {
27202 # CGFloat red, green, blue, alpha;
27203 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
27204 # return nil;
27205 # }
27206 # Color* result = [Color alloc] init];
27207 # [result setRed:red];
27208 # [result setGreen:green];
27209 # [result setBlue:blue];
27210 # if (alpha <= 0.9999) {
27211 # [result setAlpha:floatWrapperWithValue(alpha)];
27212 # }
27213 # [result autorelease];
27214 # return result;
27215 # }
27216 # // ...
27217 #
27218 # Example (JavaScript):
27219 #
27220 # // ...
27221 #
27222 # var protoToCssColor = function(rgb_color) {
27223 # var redFrac = rgb_color.red || 0.0;
27224 # var greenFrac = rgb_color.green || 0.0;
27225 # var blueFrac = rgb_color.blue || 0.0;
27226 # var red = Math.floor(redFrac * 255);
27227 # var green = Math.floor(greenFrac * 255);
27228 # var blue = Math.floor(blueFrac * 255);
27229 #
27230 # if (!('alpha' in rgb_color)) {
27231 # return rgbToCssColor_(red, green, blue);
27232 # }
27233 #
27234 # var alphaFrac = rgb_color.alpha.value || 0.0;
27235 # var rgbParams = [red, green, blue].join(',');
27236 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
27237 # };
27238 #
27239 # var rgbToCssColor_ = function(red, green, blue) {
27240 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
27241 # var hexString = rgbNumber.toString(16);
27242 # var missingZeros = 6 - hexString.length;
27243 # var resultBuilder = ['#'];
27244 # for (var i = 0; i < missingZeros; i++) {
27245 # resultBuilder.push('0');
27246 # }
27247 # resultBuilder.push(hexString);
27248 # return resultBuilder.join('');
27249 # };
27250 #
27251 # // ...
27252 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
27253 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
27254 # the final pixel color is defined by the equation:
27255 #
27256 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
27257 #
27258 # This means that a value of 1.0 corresponds to a solid color, whereas
27259 # a value of 0.0 corresponds to a completely transparent color. This
27260 # uses a wrapper message rather than a simple float scalar so that it is
27261 # possible to distinguish between a default value and the value being unset.
27262 # If omitted, this color object is to be rendered as a solid color
27263 # (as if the alpha value had been explicitly given with a value of 1.0).
27264 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
27265 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
27266 },
27267 "bold": True or False, # True if the text is bold.
27268 "strikethrough": True or False, # True if the text has a strikethrough.
27269 "fontFamily": "A String", # The font family.
27270 "fontSize": 42, # The size of the font.
27271 "italic": True or False, # True if the text is italicized.
27272 "underline": True or False, # True if the text is underlined.
27273 },
27274 "hyperlinkDisplayType": "A String", # How a hyperlink, if it exists, should be displayed in the cell.
27275 "borders": { # The borders of the cell. # The borders of the cell.
27276 "top": { # A border along a cell. # The top border of the cell.
27277 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
27278 # for simplicity of conversion to/from color representations in various
27279 # languages over compactness; for example, the fields of this representation
27280 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
27281 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
27282 # method in iOS; and, with just a little work, it can be easily formatted into
27283 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
27284 #
27285 # Example (Java):
27286 #
27287 # import com.google.type.Color;
27288 #
27289 # // ...
27290 # public static java.awt.Color fromProto(Color protocolor) {
27291 # float alpha = protocolor.hasAlpha()
27292 # ? protocolor.getAlpha().getValue()
27293 # : 1.0;
27294 #
27295 # return new java.awt.Color(
27296 # protocolor.getRed(),
27297 # protocolor.getGreen(),
27298 # protocolor.getBlue(),
27299 # alpha);
27300 # }
27301 #
27302 # public static Color toProto(java.awt.Color color) {
27303 # float red = (float) color.getRed();
27304 # float green = (float) color.getGreen();
27305 # float blue = (float) color.getBlue();
27306 # float denominator = 255.0;
27307 # Color.Builder resultBuilder =
27308 # Color
27309 # .newBuilder()
27310 # .setRed(red / denominator)
27311 # .setGreen(green / denominator)
27312 # .setBlue(blue / denominator);
27313 # int alpha = color.getAlpha();
27314 # if (alpha != 255) {
27315 # result.setAlpha(
27316 # FloatValue
27317 # .newBuilder()
27318 # .setValue(((float) alpha) / denominator)
27319 # .build());
27320 # }
27321 # return resultBuilder.build();
27322 # }
27323 # // ...
27324 #
27325 # Example (iOS / Obj-C):
27326 #
27327 # // ...
27328 # static UIColor* fromProto(Color* protocolor) {
27329 # float red = [protocolor red];
27330 # float green = [protocolor green];
27331 # float blue = [protocolor blue];
27332 # FloatValue* alpha_wrapper = [protocolor alpha];
27333 # float alpha = 1.0;
27334 # if (alpha_wrapper != nil) {
27335 # alpha = [alpha_wrapper value];
27336 # }
27337 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
27338 # }
27339 #
27340 # static Color* toProto(UIColor* color) {
27341 # CGFloat red, green, blue, alpha;
27342 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
27343 # return nil;
27344 # }
27345 # Color* result = [Color alloc] init];
27346 # [result setRed:red];
27347 # [result setGreen:green];
27348 # [result setBlue:blue];
27349 # if (alpha <= 0.9999) {
27350 # [result setAlpha:floatWrapperWithValue(alpha)];
27351 # }
27352 # [result autorelease];
27353 # return result;
27354 # }
27355 # // ...
27356 #
27357 # Example (JavaScript):
27358 #
27359 # // ...
27360 #
27361 # var protoToCssColor = function(rgb_color) {
27362 # var redFrac = rgb_color.red || 0.0;
27363 # var greenFrac = rgb_color.green || 0.0;
27364 # var blueFrac = rgb_color.blue || 0.0;
27365 # var red = Math.floor(redFrac * 255);
27366 # var green = Math.floor(greenFrac * 255);
27367 # var blue = Math.floor(blueFrac * 255);
27368 #
27369 # if (!('alpha' in rgb_color)) {
27370 # return rgbToCssColor_(red, green, blue);
27371 # }
27372 #
27373 # var alphaFrac = rgb_color.alpha.value || 0.0;
27374 # var rgbParams = [red, green, blue].join(',');
27375 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
27376 # };
27377 #
27378 # var rgbToCssColor_ = function(red, green, blue) {
27379 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
27380 # var hexString = rgbNumber.toString(16);
27381 # var missingZeros = 6 - hexString.length;
27382 # var resultBuilder = ['#'];
27383 # for (var i = 0; i < missingZeros; i++) {
27384 # resultBuilder.push('0');
27385 # }
27386 # resultBuilder.push(hexString);
27387 # return resultBuilder.join('');
27388 # };
27389 #
27390 # // ...
27391 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
27392 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
27393 # the final pixel color is defined by the equation:
27394 #
27395 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
27396 #
27397 # This means that a value of 1.0 corresponds to a solid color, whereas
27398 # a value of 0.0 corresponds to a completely transparent color. This
27399 # uses a wrapper message rather than a simple float scalar so that it is
27400 # possible to distinguish between a default value and the value being unset.
27401 # If omitted, this color object is to be rendered as a solid color
27402 # (as if the alpha value had been explicitly given with a value of 1.0).
27403 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
27404 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
27405 },
27406 "width": 42, # The width of the border, in pixels.
27407 # Border widths must be between 0 and 3 pixels.
27408 "style": "A String", # The style of the border.
27409 },
27410 "right": { # A border along a cell. # The right border of the cell.
27411 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
27412 # for simplicity of conversion to/from color representations in various
27413 # languages over compactness; for example, the fields of this representation
27414 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
27415 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
27416 # method in iOS; and, with just a little work, it can be easily formatted into
27417 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
27418 #
27419 # Example (Java):
27420 #
27421 # import com.google.type.Color;
27422 #
27423 # // ...
27424 # public static java.awt.Color fromProto(Color protocolor) {
27425 # float alpha = protocolor.hasAlpha()
27426 # ? protocolor.getAlpha().getValue()
27427 # : 1.0;
27428 #
27429 # return new java.awt.Color(
27430 # protocolor.getRed(),
27431 # protocolor.getGreen(),
27432 # protocolor.getBlue(),
27433 # alpha);
27434 # }
27435 #
27436 # public static Color toProto(java.awt.Color color) {
27437 # float red = (float) color.getRed();
27438 # float green = (float) color.getGreen();
27439 # float blue = (float) color.getBlue();
27440 # float denominator = 255.0;
27441 # Color.Builder resultBuilder =
27442 # Color
27443 # .newBuilder()
27444 # .setRed(red / denominator)
27445 # .setGreen(green / denominator)
27446 # .setBlue(blue / denominator);
27447 # int alpha = color.getAlpha();
27448 # if (alpha != 255) {
27449 # result.setAlpha(
27450 # FloatValue
27451 # .newBuilder()
27452 # .setValue(((float) alpha) / denominator)
27453 # .build());
27454 # }
27455 # return resultBuilder.build();
27456 # }
27457 # // ...
27458 #
27459 # Example (iOS / Obj-C):
27460 #
27461 # // ...
27462 # static UIColor* fromProto(Color* protocolor) {
27463 # float red = [protocolor red];
27464 # float green = [protocolor green];
27465 # float blue = [protocolor blue];
27466 # FloatValue* alpha_wrapper = [protocolor alpha];
27467 # float alpha = 1.0;
27468 # if (alpha_wrapper != nil) {
27469 # alpha = [alpha_wrapper value];
27470 # }
27471 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
27472 # }
27473 #
27474 # static Color* toProto(UIColor* color) {
27475 # CGFloat red, green, blue, alpha;
27476 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
27477 # return nil;
27478 # }
27479 # Color* result = [Color alloc] init];
27480 # [result setRed:red];
27481 # [result setGreen:green];
27482 # [result setBlue:blue];
27483 # if (alpha <= 0.9999) {
27484 # [result setAlpha:floatWrapperWithValue(alpha)];
27485 # }
27486 # [result autorelease];
27487 # return result;
27488 # }
27489 # // ...
27490 #
27491 # Example (JavaScript):
27492 #
27493 # // ...
27494 #
27495 # var protoToCssColor = function(rgb_color) {
27496 # var redFrac = rgb_color.red || 0.0;
27497 # var greenFrac = rgb_color.green || 0.0;
27498 # var blueFrac = rgb_color.blue || 0.0;
27499 # var red = Math.floor(redFrac * 255);
27500 # var green = Math.floor(greenFrac * 255);
27501 # var blue = Math.floor(blueFrac * 255);
27502 #
27503 # if (!('alpha' in rgb_color)) {
27504 # return rgbToCssColor_(red, green, blue);
27505 # }
27506 #
27507 # var alphaFrac = rgb_color.alpha.value || 0.0;
27508 # var rgbParams = [red, green, blue].join(',');
27509 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
27510 # };
27511 #
27512 # var rgbToCssColor_ = function(red, green, blue) {
27513 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
27514 # var hexString = rgbNumber.toString(16);
27515 # var missingZeros = 6 - hexString.length;
27516 # var resultBuilder = ['#'];
27517 # for (var i = 0; i < missingZeros; i++) {
27518 # resultBuilder.push('0');
27519 # }
27520 # resultBuilder.push(hexString);
27521 # return resultBuilder.join('');
27522 # };
27523 #
27524 # // ...
27525 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
27526 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
27527 # the final pixel color is defined by the equation:
27528 #
27529 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
27530 #
27531 # This means that a value of 1.0 corresponds to a solid color, whereas
27532 # a value of 0.0 corresponds to a completely transparent color. This
27533 # uses a wrapper message rather than a simple float scalar so that it is
27534 # possible to distinguish between a default value and the value being unset.
27535 # If omitted, this color object is to be rendered as a solid color
27536 # (as if the alpha value had been explicitly given with a value of 1.0).
27537 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
27538 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
27539 },
27540 "width": 42, # The width of the border, in pixels.
27541 # Border widths must be between 0 and 3 pixels.
27542 "style": "A String", # The style of the border.
27543 },
27544 "bottom": { # A border along a cell. # The bottom border of the cell.
27545 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
27546 # for simplicity of conversion to/from color representations in various
27547 # languages over compactness; for example, the fields of this representation
27548 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
27549 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
27550 # method in iOS; and, with just a little work, it can be easily formatted into
27551 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
27552 #
27553 # Example (Java):
27554 #
27555 # import com.google.type.Color;
27556 #
27557 # // ...
27558 # public static java.awt.Color fromProto(Color protocolor) {
27559 # float alpha = protocolor.hasAlpha()
27560 # ? protocolor.getAlpha().getValue()
27561 # : 1.0;
27562 #
27563 # return new java.awt.Color(
27564 # protocolor.getRed(),
27565 # protocolor.getGreen(),
27566 # protocolor.getBlue(),
27567 # alpha);
27568 # }
27569 #
27570 # public static Color toProto(java.awt.Color color) {
27571 # float red = (float) color.getRed();
27572 # float green = (float) color.getGreen();
27573 # float blue = (float) color.getBlue();
27574 # float denominator = 255.0;
27575 # Color.Builder resultBuilder =
27576 # Color
27577 # .newBuilder()
27578 # .setRed(red / denominator)
27579 # .setGreen(green / denominator)
27580 # .setBlue(blue / denominator);
27581 # int alpha = color.getAlpha();
27582 # if (alpha != 255) {
27583 # result.setAlpha(
27584 # FloatValue
27585 # .newBuilder()
27586 # .setValue(((float) alpha) / denominator)
27587 # .build());
27588 # }
27589 # return resultBuilder.build();
27590 # }
27591 # // ...
27592 #
27593 # Example (iOS / Obj-C):
27594 #
27595 # // ...
27596 # static UIColor* fromProto(Color* protocolor) {
27597 # float red = [protocolor red];
27598 # float green = [protocolor green];
27599 # float blue = [protocolor blue];
27600 # FloatValue* alpha_wrapper = [protocolor alpha];
27601 # float alpha = 1.0;
27602 # if (alpha_wrapper != nil) {
27603 # alpha = [alpha_wrapper value];
27604 # }
27605 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
27606 # }
27607 #
27608 # static Color* toProto(UIColor* color) {
27609 # CGFloat red, green, blue, alpha;
27610 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
27611 # return nil;
27612 # }
27613 # Color* result = [Color alloc] init];
27614 # [result setRed:red];
27615 # [result setGreen:green];
27616 # [result setBlue:blue];
27617 # if (alpha <= 0.9999) {
27618 # [result setAlpha:floatWrapperWithValue(alpha)];
27619 # }
27620 # [result autorelease];
27621 # return result;
27622 # }
27623 # // ...
27624 #
27625 # Example (JavaScript):
27626 #
27627 # // ...
27628 #
27629 # var protoToCssColor = function(rgb_color) {
27630 # var redFrac = rgb_color.red || 0.0;
27631 # var greenFrac = rgb_color.green || 0.0;
27632 # var blueFrac = rgb_color.blue || 0.0;
27633 # var red = Math.floor(redFrac * 255);
27634 # var green = Math.floor(greenFrac * 255);
27635 # var blue = Math.floor(blueFrac * 255);
27636 #
27637 # if (!('alpha' in rgb_color)) {
27638 # return rgbToCssColor_(red, green, blue);
27639 # }
27640 #
27641 # var alphaFrac = rgb_color.alpha.value || 0.0;
27642 # var rgbParams = [red, green, blue].join(',');
27643 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
27644 # };
27645 #
27646 # var rgbToCssColor_ = function(red, green, blue) {
27647 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
27648 # var hexString = rgbNumber.toString(16);
27649 # var missingZeros = 6 - hexString.length;
27650 # var resultBuilder = ['#'];
27651 # for (var i = 0; i < missingZeros; i++) {
27652 # resultBuilder.push('0');
27653 # }
27654 # resultBuilder.push(hexString);
27655 # return resultBuilder.join('');
27656 # };
27657 #
27658 # // ...
27659 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
27660 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
27661 # the final pixel color is defined by the equation:
27662 #
27663 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
27664 #
27665 # This means that a value of 1.0 corresponds to a solid color, whereas
27666 # a value of 0.0 corresponds to a completely transparent color. This
27667 # uses a wrapper message rather than a simple float scalar so that it is
27668 # possible to distinguish between a default value and the value being unset.
27669 # If omitted, this color object is to be rendered as a solid color
27670 # (as if the alpha value had been explicitly given with a value of 1.0).
27671 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
27672 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
27673 },
27674 "width": 42, # The width of the border, in pixels.
27675 # Border widths must be between 0 and 3 pixels.
27676 "style": "A String", # The style of the border.
27677 },
27678 "left": { # A border along a cell. # The left border of the cell.
27679 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
27680 # for simplicity of conversion to/from color representations in various
27681 # languages over compactness; for example, the fields of this representation
27682 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
27683 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
27684 # method in iOS; and, with just a little work, it can be easily formatted into
27685 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
27686 #
27687 # Example (Java):
27688 #
27689 # import com.google.type.Color;
27690 #
27691 # // ...
27692 # public static java.awt.Color fromProto(Color protocolor) {
27693 # float alpha = protocolor.hasAlpha()
27694 # ? protocolor.getAlpha().getValue()
27695 # : 1.0;
27696 #
27697 # return new java.awt.Color(
27698 # protocolor.getRed(),
27699 # protocolor.getGreen(),
27700 # protocolor.getBlue(),
27701 # alpha);
27702 # }
27703 #
27704 # public static Color toProto(java.awt.Color color) {
27705 # float red = (float) color.getRed();
27706 # float green = (float) color.getGreen();
27707 # float blue = (float) color.getBlue();
27708 # float denominator = 255.0;
27709 # Color.Builder resultBuilder =
27710 # Color
27711 # .newBuilder()
27712 # .setRed(red / denominator)
27713 # .setGreen(green / denominator)
27714 # .setBlue(blue / denominator);
27715 # int alpha = color.getAlpha();
27716 # if (alpha != 255) {
27717 # result.setAlpha(
27718 # FloatValue
27719 # .newBuilder()
27720 # .setValue(((float) alpha) / denominator)
27721 # .build());
27722 # }
27723 # return resultBuilder.build();
27724 # }
27725 # // ...
27726 #
27727 # Example (iOS / Obj-C):
27728 #
27729 # // ...
27730 # static UIColor* fromProto(Color* protocolor) {
27731 # float red = [protocolor red];
27732 # float green = [protocolor green];
27733 # float blue = [protocolor blue];
27734 # FloatValue* alpha_wrapper = [protocolor alpha];
27735 # float alpha = 1.0;
27736 # if (alpha_wrapper != nil) {
27737 # alpha = [alpha_wrapper value];
27738 # }
27739 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
27740 # }
27741 #
27742 # static Color* toProto(UIColor* color) {
27743 # CGFloat red, green, blue, alpha;
27744 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
27745 # return nil;
27746 # }
27747 # Color* result = [Color alloc] init];
27748 # [result setRed:red];
27749 # [result setGreen:green];
27750 # [result setBlue:blue];
27751 # if (alpha <= 0.9999) {
27752 # [result setAlpha:floatWrapperWithValue(alpha)];
27753 # }
27754 # [result autorelease];
27755 # return result;
27756 # }
27757 # // ...
27758 #
27759 # Example (JavaScript):
27760 #
27761 # // ...
27762 #
27763 # var protoToCssColor = function(rgb_color) {
27764 # var redFrac = rgb_color.red || 0.0;
27765 # var greenFrac = rgb_color.green || 0.0;
27766 # var blueFrac = rgb_color.blue || 0.0;
27767 # var red = Math.floor(redFrac * 255);
27768 # var green = Math.floor(greenFrac * 255);
27769 # var blue = Math.floor(blueFrac * 255);
27770 #
27771 # if (!('alpha' in rgb_color)) {
27772 # return rgbToCssColor_(red, green, blue);
27773 # }
27774 #
27775 # var alphaFrac = rgb_color.alpha.value || 0.0;
27776 # var rgbParams = [red, green, blue].join(',');
27777 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
27778 # };
27779 #
27780 # var rgbToCssColor_ = function(red, green, blue) {
27781 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
27782 # var hexString = rgbNumber.toString(16);
27783 # var missingZeros = 6 - hexString.length;
27784 # var resultBuilder = ['#'];
27785 # for (var i = 0; i < missingZeros; i++) {
27786 # resultBuilder.push('0');
27787 # }
27788 # resultBuilder.push(hexString);
27789 # return resultBuilder.join('');
27790 # };
27791 #
27792 # // ...
27793 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
27794 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
27795 # the final pixel color is defined by the equation:
27796 #
27797 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
27798 #
27799 # This means that a value of 1.0 corresponds to a solid color, whereas
27800 # a value of 0.0 corresponds to a completely transparent color. This
27801 # uses a wrapper message rather than a simple float scalar so that it is
27802 # possible to distinguish between a default value and the value being unset.
27803 # If omitted, this color object is to be rendered as a solid color
27804 # (as if the alpha value had been explicitly given with a value of 1.0).
27805 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
27806 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
27807 },
27808 "width": 42, # The width of the border, in pixels.
27809 # Border widths must be between 0 and 3 pixels.
27810 "style": "A String", # The style of the border.
27811 },
27812 },
27813 "wrapStrategy": "A String", # The wrap strategy for the value in the cell.
27814 },
27815 "userEnteredFormat": { # The format of a cell. # The format the user entered for the cell.
27816 #
27817 # When writing, the new format will be merged with the existing format.
27818 "numberFormat": { # The number format of a cell. # A format describing how number values should be represented to the user.
27819 # When updating, all fields must be set.
27820 "pattern": "A String", # Pattern string used for formatting.
27821 "type": "A String", # The type of the number format.
27822 },
27823 "textDirection": "A String", # The direction of the text in the cell.
27824 "padding": { # The amount of padding around the cell, in pixels. # The padding of the cell.
27825 # When updating padding, every field must be specified.
27826 "top": 42, # The top padding of the cell.
27827 "right": 42, # The right padding of the cell.
27828 "bottom": 42, # The bottom padding of the cell.
27829 "left": 42, # The left padding of the cell.
27830 },
27831 "horizontalAlignment": "A String", # The horizontal alignment of the value in cell.
27832 "backgroundColor": { # Represents a color in the RGBA color space. This representation is designed # The background color of the cell.
27833 # for simplicity of conversion to/from color representations in various
27834 # languages over compactness; for example, the fields of this representation
27835 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
27836 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
27837 # method in iOS; and, with just a little work, it can be easily formatted into
27838 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
27839 #
27840 # Example (Java):
27841 #
27842 # import com.google.type.Color;
27843 #
27844 # // ...
27845 # public static java.awt.Color fromProto(Color protocolor) {
27846 # float alpha = protocolor.hasAlpha()
27847 # ? protocolor.getAlpha().getValue()
27848 # : 1.0;
27849 #
27850 # return new java.awt.Color(
27851 # protocolor.getRed(),
27852 # protocolor.getGreen(),
27853 # protocolor.getBlue(),
27854 # alpha);
27855 # }
27856 #
27857 # public static Color toProto(java.awt.Color color) {
27858 # float red = (float) color.getRed();
27859 # float green = (float) color.getGreen();
27860 # float blue = (float) color.getBlue();
27861 # float denominator = 255.0;
27862 # Color.Builder resultBuilder =
27863 # Color
27864 # .newBuilder()
27865 # .setRed(red / denominator)
27866 # .setGreen(green / denominator)
27867 # .setBlue(blue / denominator);
27868 # int alpha = color.getAlpha();
27869 # if (alpha != 255) {
27870 # result.setAlpha(
27871 # FloatValue
27872 # .newBuilder()
27873 # .setValue(((float) alpha) / denominator)
27874 # .build());
27875 # }
27876 # return resultBuilder.build();
27877 # }
27878 # // ...
27879 #
27880 # Example (iOS / Obj-C):
27881 #
27882 # // ...
27883 # static UIColor* fromProto(Color* protocolor) {
27884 # float red = [protocolor red];
27885 # float green = [protocolor green];
27886 # float blue = [protocolor blue];
27887 # FloatValue* alpha_wrapper = [protocolor alpha];
27888 # float alpha = 1.0;
27889 # if (alpha_wrapper != nil) {
27890 # alpha = [alpha_wrapper value];
27891 # }
27892 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
27893 # }
27894 #
27895 # static Color* toProto(UIColor* color) {
27896 # CGFloat red, green, blue, alpha;
27897 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
27898 # return nil;
27899 # }
27900 # Color* result = [Color alloc] init];
27901 # [result setRed:red];
27902 # [result setGreen:green];
27903 # [result setBlue:blue];
27904 # if (alpha <= 0.9999) {
27905 # [result setAlpha:floatWrapperWithValue(alpha)];
27906 # }
27907 # [result autorelease];
27908 # return result;
27909 # }
27910 # // ...
27911 #
27912 # Example (JavaScript):
27913 #
27914 # // ...
27915 #
27916 # var protoToCssColor = function(rgb_color) {
27917 # var redFrac = rgb_color.red || 0.0;
27918 # var greenFrac = rgb_color.green || 0.0;
27919 # var blueFrac = rgb_color.blue || 0.0;
27920 # var red = Math.floor(redFrac * 255);
27921 # var green = Math.floor(greenFrac * 255);
27922 # var blue = Math.floor(blueFrac * 255);
27923 #
27924 # if (!('alpha' in rgb_color)) {
27925 # return rgbToCssColor_(red, green, blue);
27926 # }
27927 #
27928 # var alphaFrac = rgb_color.alpha.value || 0.0;
27929 # var rgbParams = [red, green, blue].join(',');
27930 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
27931 # };
27932 #
27933 # var rgbToCssColor_ = function(red, green, blue) {
27934 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
27935 # var hexString = rgbNumber.toString(16);
27936 # var missingZeros = 6 - hexString.length;
27937 # var resultBuilder = ['#'];
27938 # for (var i = 0; i < missingZeros; i++) {
27939 # resultBuilder.push('0');
27940 # }
27941 # resultBuilder.push(hexString);
27942 # return resultBuilder.join('');
27943 # };
27944 #
27945 # // ...
27946 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
27947 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
27948 # the final pixel color is defined by the equation:
27949 #
27950 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
27951 #
27952 # This means that a value of 1.0 corresponds to a solid color, whereas
27953 # a value of 0.0 corresponds to a completely transparent color. This
27954 # uses a wrapper message rather than a simple float scalar so that it is
27955 # possible to distinguish between a default value and the value being unset.
27956 # If omitted, this color object is to be rendered as a solid color
27957 # (as if the alpha value had been explicitly given with a value of 1.0).
27958 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
27959 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
27960 },
27961 "verticalAlignment": "A String", # The vertical alignment of the value in cell.
27962 "textFormat": { # The format of a run of text in a cell. # The format of the text in the cell (unless overridden by a format run).
27963 # Absent values indicate that the field isn't specified.
27964 "foregroundColor": { # Represents a color in the RGBA color space. This representation is designed # The foreground color of the text.
27965 # for simplicity of conversion to/from color representations in various
27966 # languages over compactness; for example, the fields of this representation
27967 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
27968 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
27969 # method in iOS; and, with just a little work, it can be easily formatted into
27970 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
27971 #
27972 # Example (Java):
27973 #
27974 # import com.google.type.Color;
27975 #
27976 # // ...
27977 # public static java.awt.Color fromProto(Color protocolor) {
27978 # float alpha = protocolor.hasAlpha()
27979 # ? protocolor.getAlpha().getValue()
27980 # : 1.0;
27981 #
27982 # return new java.awt.Color(
27983 # protocolor.getRed(),
27984 # protocolor.getGreen(),
27985 # protocolor.getBlue(),
27986 # alpha);
27987 # }
27988 #
27989 # public static Color toProto(java.awt.Color color) {
27990 # float red = (float) color.getRed();
27991 # float green = (float) color.getGreen();
27992 # float blue = (float) color.getBlue();
27993 # float denominator = 255.0;
27994 # Color.Builder resultBuilder =
27995 # Color
27996 # .newBuilder()
27997 # .setRed(red / denominator)
27998 # .setGreen(green / denominator)
27999 # .setBlue(blue / denominator);
28000 # int alpha = color.getAlpha();
28001 # if (alpha != 255) {
28002 # result.setAlpha(
28003 # FloatValue
28004 # .newBuilder()
28005 # .setValue(((float) alpha) / denominator)
28006 # .build());
28007 # }
28008 # return resultBuilder.build();
28009 # }
28010 # // ...
28011 #
28012 # Example (iOS / Obj-C):
28013 #
28014 # // ...
28015 # static UIColor* fromProto(Color* protocolor) {
28016 # float red = [protocolor red];
28017 # float green = [protocolor green];
28018 # float blue = [protocolor blue];
28019 # FloatValue* alpha_wrapper = [protocolor alpha];
28020 # float alpha = 1.0;
28021 # if (alpha_wrapper != nil) {
28022 # alpha = [alpha_wrapper value];
28023 # }
28024 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
28025 # }
28026 #
28027 # static Color* toProto(UIColor* color) {
28028 # CGFloat red, green, blue, alpha;
28029 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
28030 # return nil;
28031 # }
28032 # Color* result = [Color alloc] init];
28033 # [result setRed:red];
28034 # [result setGreen:green];
28035 # [result setBlue:blue];
28036 # if (alpha <= 0.9999) {
28037 # [result setAlpha:floatWrapperWithValue(alpha)];
28038 # }
28039 # [result autorelease];
28040 # return result;
28041 # }
28042 # // ...
28043 #
28044 # Example (JavaScript):
28045 #
28046 # // ...
28047 #
28048 # var protoToCssColor = function(rgb_color) {
28049 # var redFrac = rgb_color.red || 0.0;
28050 # var greenFrac = rgb_color.green || 0.0;
28051 # var blueFrac = rgb_color.blue || 0.0;
28052 # var red = Math.floor(redFrac * 255);
28053 # var green = Math.floor(greenFrac * 255);
28054 # var blue = Math.floor(blueFrac * 255);
28055 #
28056 # if (!('alpha' in rgb_color)) {
28057 # return rgbToCssColor_(red, green, blue);
28058 # }
28059 #
28060 # var alphaFrac = rgb_color.alpha.value || 0.0;
28061 # var rgbParams = [red, green, blue].join(',');
28062 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
28063 # };
28064 #
28065 # var rgbToCssColor_ = function(red, green, blue) {
28066 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
28067 # var hexString = rgbNumber.toString(16);
28068 # var missingZeros = 6 - hexString.length;
28069 # var resultBuilder = ['#'];
28070 # for (var i = 0; i < missingZeros; i++) {
28071 # resultBuilder.push('0');
28072 # }
28073 # resultBuilder.push(hexString);
28074 # return resultBuilder.join('');
28075 # };
28076 #
28077 # // ...
28078 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
28079 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
28080 # the final pixel color is defined by the equation:
28081 #
28082 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
28083 #
28084 # This means that a value of 1.0 corresponds to a solid color, whereas
28085 # a value of 0.0 corresponds to a completely transparent color. This
28086 # uses a wrapper message rather than a simple float scalar so that it is
28087 # possible to distinguish between a default value and the value being unset.
28088 # If omitted, this color object is to be rendered as a solid color
28089 # (as if the alpha value had been explicitly given with a value of 1.0).
28090 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
28091 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
28092 },
28093 "bold": True or False, # True if the text is bold.
28094 "strikethrough": True or False, # True if the text has a strikethrough.
28095 "fontFamily": "A String", # The font family.
28096 "fontSize": 42, # The size of the font.
28097 "italic": True or False, # True if the text is italicized.
28098 "underline": True or False, # True if the text is underlined.
28099 },
28100 "hyperlinkDisplayType": "A String", # How a hyperlink, if it exists, should be displayed in the cell.
28101 "borders": { # The borders of the cell. # The borders of the cell.
28102 "top": { # A border along a cell. # The top border of the cell.
28103 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
28104 # for simplicity of conversion to/from color representations in various
28105 # languages over compactness; for example, the fields of this representation
28106 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
28107 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
28108 # method in iOS; and, with just a little work, it can be easily formatted into
28109 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
28110 #
28111 # Example (Java):
28112 #
28113 # import com.google.type.Color;
28114 #
28115 # // ...
28116 # public static java.awt.Color fromProto(Color protocolor) {
28117 # float alpha = protocolor.hasAlpha()
28118 # ? protocolor.getAlpha().getValue()
28119 # : 1.0;
28120 #
28121 # return new java.awt.Color(
28122 # protocolor.getRed(),
28123 # protocolor.getGreen(),
28124 # protocolor.getBlue(),
28125 # alpha);
28126 # }
28127 #
28128 # public static Color toProto(java.awt.Color color) {
28129 # float red = (float) color.getRed();
28130 # float green = (float) color.getGreen();
28131 # float blue = (float) color.getBlue();
28132 # float denominator = 255.0;
28133 # Color.Builder resultBuilder =
28134 # Color
28135 # .newBuilder()
28136 # .setRed(red / denominator)
28137 # .setGreen(green / denominator)
28138 # .setBlue(blue / denominator);
28139 # int alpha = color.getAlpha();
28140 # if (alpha != 255) {
28141 # result.setAlpha(
28142 # FloatValue
28143 # .newBuilder()
28144 # .setValue(((float) alpha) / denominator)
28145 # .build());
28146 # }
28147 # return resultBuilder.build();
28148 # }
28149 # // ...
28150 #
28151 # Example (iOS / Obj-C):
28152 #
28153 # // ...
28154 # static UIColor* fromProto(Color* protocolor) {
28155 # float red = [protocolor red];
28156 # float green = [protocolor green];
28157 # float blue = [protocolor blue];
28158 # FloatValue* alpha_wrapper = [protocolor alpha];
28159 # float alpha = 1.0;
28160 # if (alpha_wrapper != nil) {
28161 # alpha = [alpha_wrapper value];
28162 # }
28163 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
28164 # }
28165 #
28166 # static Color* toProto(UIColor* color) {
28167 # CGFloat red, green, blue, alpha;
28168 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
28169 # return nil;
28170 # }
28171 # Color* result = [Color alloc] init];
28172 # [result setRed:red];
28173 # [result setGreen:green];
28174 # [result setBlue:blue];
28175 # if (alpha <= 0.9999) {
28176 # [result setAlpha:floatWrapperWithValue(alpha)];
28177 # }
28178 # [result autorelease];
28179 # return result;
28180 # }
28181 # // ...
28182 #
28183 # Example (JavaScript):
28184 #
28185 # // ...
28186 #
28187 # var protoToCssColor = function(rgb_color) {
28188 # var redFrac = rgb_color.red || 0.0;
28189 # var greenFrac = rgb_color.green || 0.0;
28190 # var blueFrac = rgb_color.blue || 0.0;
28191 # var red = Math.floor(redFrac * 255);
28192 # var green = Math.floor(greenFrac * 255);
28193 # var blue = Math.floor(blueFrac * 255);
28194 #
28195 # if (!('alpha' in rgb_color)) {
28196 # return rgbToCssColor_(red, green, blue);
28197 # }
28198 #
28199 # var alphaFrac = rgb_color.alpha.value || 0.0;
28200 # var rgbParams = [red, green, blue].join(',');
28201 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
28202 # };
28203 #
28204 # var rgbToCssColor_ = function(red, green, blue) {
28205 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
28206 # var hexString = rgbNumber.toString(16);
28207 # var missingZeros = 6 - hexString.length;
28208 # var resultBuilder = ['#'];
28209 # for (var i = 0; i < missingZeros; i++) {
28210 # resultBuilder.push('0');
28211 # }
28212 # resultBuilder.push(hexString);
28213 # return resultBuilder.join('');
28214 # };
28215 #
28216 # // ...
28217 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
28218 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
28219 # the final pixel color is defined by the equation:
28220 #
28221 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
28222 #
28223 # This means that a value of 1.0 corresponds to a solid color, whereas
28224 # a value of 0.0 corresponds to a completely transparent color. This
28225 # uses a wrapper message rather than a simple float scalar so that it is
28226 # possible to distinguish between a default value and the value being unset.
28227 # If omitted, this color object is to be rendered as a solid color
28228 # (as if the alpha value had been explicitly given with a value of 1.0).
28229 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
28230 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
28231 },
28232 "width": 42, # The width of the border, in pixels.
28233 # Border widths must be between 0 and 3 pixels.
28234 "style": "A String", # The style of the border.
28235 },
28236 "right": { # A border along a cell. # The right border of the cell.
28237 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
28238 # for simplicity of conversion to/from color representations in various
28239 # languages over compactness; for example, the fields of this representation
28240 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
28241 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
28242 # method in iOS; and, with just a little work, it can be easily formatted into
28243 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
28244 #
28245 # Example (Java):
28246 #
28247 # import com.google.type.Color;
28248 #
28249 # // ...
28250 # public static java.awt.Color fromProto(Color protocolor) {
28251 # float alpha = protocolor.hasAlpha()
28252 # ? protocolor.getAlpha().getValue()
28253 # : 1.0;
28254 #
28255 # return new java.awt.Color(
28256 # protocolor.getRed(),
28257 # protocolor.getGreen(),
28258 # protocolor.getBlue(),
28259 # alpha);
28260 # }
28261 #
28262 # public static Color toProto(java.awt.Color color) {
28263 # float red = (float) color.getRed();
28264 # float green = (float) color.getGreen();
28265 # float blue = (float) color.getBlue();
28266 # float denominator = 255.0;
28267 # Color.Builder resultBuilder =
28268 # Color
28269 # .newBuilder()
28270 # .setRed(red / denominator)
28271 # .setGreen(green / denominator)
28272 # .setBlue(blue / denominator);
28273 # int alpha = color.getAlpha();
28274 # if (alpha != 255) {
28275 # result.setAlpha(
28276 # FloatValue
28277 # .newBuilder()
28278 # .setValue(((float) alpha) / denominator)
28279 # .build());
28280 # }
28281 # return resultBuilder.build();
28282 # }
28283 # // ...
28284 #
28285 # Example (iOS / Obj-C):
28286 #
28287 # // ...
28288 # static UIColor* fromProto(Color* protocolor) {
28289 # float red = [protocolor red];
28290 # float green = [protocolor green];
28291 # float blue = [protocolor blue];
28292 # FloatValue* alpha_wrapper = [protocolor alpha];
28293 # float alpha = 1.0;
28294 # if (alpha_wrapper != nil) {
28295 # alpha = [alpha_wrapper value];
28296 # }
28297 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
28298 # }
28299 #
28300 # static Color* toProto(UIColor* color) {
28301 # CGFloat red, green, blue, alpha;
28302 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
28303 # return nil;
28304 # }
28305 # Color* result = [Color alloc] init];
28306 # [result setRed:red];
28307 # [result setGreen:green];
28308 # [result setBlue:blue];
28309 # if (alpha <= 0.9999) {
28310 # [result setAlpha:floatWrapperWithValue(alpha)];
28311 # }
28312 # [result autorelease];
28313 # return result;
28314 # }
28315 # // ...
28316 #
28317 # Example (JavaScript):
28318 #
28319 # // ...
28320 #
28321 # var protoToCssColor = function(rgb_color) {
28322 # var redFrac = rgb_color.red || 0.0;
28323 # var greenFrac = rgb_color.green || 0.0;
28324 # var blueFrac = rgb_color.blue || 0.0;
28325 # var red = Math.floor(redFrac * 255);
28326 # var green = Math.floor(greenFrac * 255);
28327 # var blue = Math.floor(blueFrac * 255);
28328 #
28329 # if (!('alpha' in rgb_color)) {
28330 # return rgbToCssColor_(red, green, blue);
28331 # }
28332 #
28333 # var alphaFrac = rgb_color.alpha.value || 0.0;
28334 # var rgbParams = [red, green, blue].join(',');
28335 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
28336 # };
28337 #
28338 # var rgbToCssColor_ = function(red, green, blue) {
28339 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
28340 # var hexString = rgbNumber.toString(16);
28341 # var missingZeros = 6 - hexString.length;
28342 # var resultBuilder = ['#'];
28343 # for (var i = 0; i < missingZeros; i++) {
28344 # resultBuilder.push('0');
28345 # }
28346 # resultBuilder.push(hexString);
28347 # return resultBuilder.join('');
28348 # };
28349 #
28350 # // ...
28351 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
28352 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
28353 # the final pixel color is defined by the equation:
28354 #
28355 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
28356 #
28357 # This means that a value of 1.0 corresponds to a solid color, whereas
28358 # a value of 0.0 corresponds to a completely transparent color. This
28359 # uses a wrapper message rather than a simple float scalar so that it is
28360 # possible to distinguish between a default value and the value being unset.
28361 # If omitted, this color object is to be rendered as a solid color
28362 # (as if the alpha value had been explicitly given with a value of 1.0).
28363 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
28364 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
28365 },
28366 "width": 42, # The width of the border, in pixels.
28367 # Border widths must be between 0 and 3 pixels.
28368 "style": "A String", # The style of the border.
28369 },
28370 "bottom": { # A border along a cell. # The bottom border of the cell.
28371 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
28372 # for simplicity of conversion to/from color representations in various
28373 # languages over compactness; for example, the fields of this representation
28374 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
28375 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
28376 # method in iOS; and, with just a little work, it can be easily formatted into
28377 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
28378 #
28379 # Example (Java):
28380 #
28381 # import com.google.type.Color;
28382 #
28383 # // ...
28384 # public static java.awt.Color fromProto(Color protocolor) {
28385 # float alpha = protocolor.hasAlpha()
28386 # ? protocolor.getAlpha().getValue()
28387 # : 1.0;
28388 #
28389 # return new java.awt.Color(
28390 # protocolor.getRed(),
28391 # protocolor.getGreen(),
28392 # protocolor.getBlue(),
28393 # alpha);
28394 # }
28395 #
28396 # public static Color toProto(java.awt.Color color) {
28397 # float red = (float) color.getRed();
28398 # float green = (float) color.getGreen();
28399 # float blue = (float) color.getBlue();
28400 # float denominator = 255.0;
28401 # Color.Builder resultBuilder =
28402 # Color
28403 # .newBuilder()
28404 # .setRed(red / denominator)
28405 # .setGreen(green / denominator)
28406 # .setBlue(blue / denominator);
28407 # int alpha = color.getAlpha();
28408 # if (alpha != 255) {
28409 # result.setAlpha(
28410 # FloatValue
28411 # .newBuilder()
28412 # .setValue(((float) alpha) / denominator)
28413 # .build());
28414 # }
28415 # return resultBuilder.build();
28416 # }
28417 # // ...
28418 #
28419 # Example (iOS / Obj-C):
28420 #
28421 # // ...
28422 # static UIColor* fromProto(Color* protocolor) {
28423 # float red = [protocolor red];
28424 # float green = [protocolor green];
28425 # float blue = [protocolor blue];
28426 # FloatValue* alpha_wrapper = [protocolor alpha];
28427 # float alpha = 1.0;
28428 # if (alpha_wrapper != nil) {
28429 # alpha = [alpha_wrapper value];
28430 # }
28431 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
28432 # }
28433 #
28434 # static Color* toProto(UIColor* color) {
28435 # CGFloat red, green, blue, alpha;
28436 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
28437 # return nil;
28438 # }
28439 # Color* result = [Color alloc] init];
28440 # [result setRed:red];
28441 # [result setGreen:green];
28442 # [result setBlue:blue];
28443 # if (alpha <= 0.9999) {
28444 # [result setAlpha:floatWrapperWithValue(alpha)];
28445 # }
28446 # [result autorelease];
28447 # return result;
28448 # }
28449 # // ...
28450 #
28451 # Example (JavaScript):
28452 #
28453 # // ...
28454 #
28455 # var protoToCssColor = function(rgb_color) {
28456 # var redFrac = rgb_color.red || 0.0;
28457 # var greenFrac = rgb_color.green || 0.0;
28458 # var blueFrac = rgb_color.blue || 0.0;
28459 # var red = Math.floor(redFrac * 255);
28460 # var green = Math.floor(greenFrac * 255);
28461 # var blue = Math.floor(blueFrac * 255);
28462 #
28463 # if (!('alpha' in rgb_color)) {
28464 # return rgbToCssColor_(red, green, blue);
28465 # }
28466 #
28467 # var alphaFrac = rgb_color.alpha.value || 0.0;
28468 # var rgbParams = [red, green, blue].join(',');
28469 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
28470 # };
28471 #
28472 # var rgbToCssColor_ = function(red, green, blue) {
28473 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
28474 # var hexString = rgbNumber.toString(16);
28475 # var missingZeros = 6 - hexString.length;
28476 # var resultBuilder = ['#'];
28477 # for (var i = 0; i < missingZeros; i++) {
28478 # resultBuilder.push('0');
28479 # }
28480 # resultBuilder.push(hexString);
28481 # return resultBuilder.join('');
28482 # };
28483 #
28484 # // ...
28485 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
28486 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
28487 # the final pixel color is defined by the equation:
28488 #
28489 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
28490 #
28491 # This means that a value of 1.0 corresponds to a solid color, whereas
28492 # a value of 0.0 corresponds to a completely transparent color. This
28493 # uses a wrapper message rather than a simple float scalar so that it is
28494 # possible to distinguish between a default value and the value being unset.
28495 # If omitted, this color object is to be rendered as a solid color
28496 # (as if the alpha value had been explicitly given with a value of 1.0).
28497 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
28498 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
28499 },
28500 "width": 42, # The width of the border, in pixels.
28501 # Border widths must be between 0 and 3 pixels.
28502 "style": "A String", # The style of the border.
28503 },
28504 "left": { # A border along a cell. # The left border of the cell.
28505 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
28506 # for simplicity of conversion to/from color representations in various
28507 # languages over compactness; for example, the fields of this representation
28508 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
28509 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
28510 # method in iOS; and, with just a little work, it can be easily formatted into
28511 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
28512 #
28513 # Example (Java):
28514 #
28515 # import com.google.type.Color;
28516 #
28517 # // ...
28518 # public static java.awt.Color fromProto(Color protocolor) {
28519 # float alpha = protocolor.hasAlpha()
28520 # ? protocolor.getAlpha().getValue()
28521 # : 1.0;
28522 #
28523 # return new java.awt.Color(
28524 # protocolor.getRed(),
28525 # protocolor.getGreen(),
28526 # protocolor.getBlue(),
28527 # alpha);
28528 # }
28529 #
28530 # public static Color toProto(java.awt.Color color) {
28531 # float red = (float) color.getRed();
28532 # float green = (float) color.getGreen();
28533 # float blue = (float) color.getBlue();
28534 # float denominator = 255.0;
28535 # Color.Builder resultBuilder =
28536 # Color
28537 # .newBuilder()
28538 # .setRed(red / denominator)
28539 # .setGreen(green / denominator)
28540 # .setBlue(blue / denominator);
28541 # int alpha = color.getAlpha();
28542 # if (alpha != 255) {
28543 # result.setAlpha(
28544 # FloatValue
28545 # .newBuilder()
28546 # .setValue(((float) alpha) / denominator)
28547 # .build());
28548 # }
28549 # return resultBuilder.build();
28550 # }
28551 # // ...
28552 #
28553 # Example (iOS / Obj-C):
28554 #
28555 # // ...
28556 # static UIColor* fromProto(Color* protocolor) {
28557 # float red = [protocolor red];
28558 # float green = [protocolor green];
28559 # float blue = [protocolor blue];
28560 # FloatValue* alpha_wrapper = [protocolor alpha];
28561 # float alpha = 1.0;
28562 # if (alpha_wrapper != nil) {
28563 # alpha = [alpha_wrapper value];
28564 # }
28565 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
28566 # }
28567 #
28568 # static Color* toProto(UIColor* color) {
28569 # CGFloat red, green, blue, alpha;
28570 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
28571 # return nil;
28572 # }
28573 # Color* result = [Color alloc] init];
28574 # [result setRed:red];
28575 # [result setGreen:green];
28576 # [result setBlue:blue];
28577 # if (alpha <= 0.9999) {
28578 # [result setAlpha:floatWrapperWithValue(alpha)];
28579 # }
28580 # [result autorelease];
28581 # return result;
28582 # }
28583 # // ...
28584 #
28585 # Example (JavaScript):
28586 #
28587 # // ...
28588 #
28589 # var protoToCssColor = function(rgb_color) {
28590 # var redFrac = rgb_color.red || 0.0;
28591 # var greenFrac = rgb_color.green || 0.0;
28592 # var blueFrac = rgb_color.blue || 0.0;
28593 # var red = Math.floor(redFrac * 255);
28594 # var green = Math.floor(greenFrac * 255);
28595 # var blue = Math.floor(blueFrac * 255);
28596 #
28597 # if (!('alpha' in rgb_color)) {
28598 # return rgbToCssColor_(red, green, blue);
28599 # }
28600 #
28601 # var alphaFrac = rgb_color.alpha.value || 0.0;
28602 # var rgbParams = [red, green, blue].join(',');
28603 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
28604 # };
28605 #
28606 # var rgbToCssColor_ = function(red, green, blue) {
28607 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
28608 # var hexString = rgbNumber.toString(16);
28609 # var missingZeros = 6 - hexString.length;
28610 # var resultBuilder = ['#'];
28611 # for (var i = 0; i < missingZeros; i++) {
28612 # resultBuilder.push('0');
28613 # }
28614 # resultBuilder.push(hexString);
28615 # return resultBuilder.join('');
28616 # };
28617 #
28618 # // ...
28619 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
28620 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
28621 # the final pixel color is defined by the equation:
28622 #
28623 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
28624 #
28625 # This means that a value of 1.0 corresponds to a solid color, whereas
28626 # a value of 0.0 corresponds to a completely transparent color. This
28627 # uses a wrapper message rather than a simple float scalar so that it is
28628 # possible to distinguish between a default value and the value being unset.
28629 # If omitted, this color object is to be rendered as a solid color
28630 # (as if the alpha value had been explicitly given with a value of 1.0).
28631 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
28632 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
28633 },
28634 "width": 42, # The width of the border, in pixels.
28635 # Border widths must be between 0 and 3 pixels.
28636 "style": "A String", # The style of the border.
28637 },
28638 },
28639 "wrapStrategy": "A String", # The wrap strategy for the value in the cell.
28640 },
28641 "dataValidation": { # A data validation rule. # A data validation rule on the cell, if any.
28642 #
28643 # When writing, the new data validation rule will overwrite any prior rule.
28644 "showCustomUi": True or False, # True if the UI should be customized based on the kind of condition.
28645 # If true, "List" conditions will show a dropdown.
28646 "strict": True or False, # True if invalid data should be rejected.
28647 "inputMessage": "A String", # A message to show the user when adding data to the cell.
28648 "condition": { # A condition that can evaluate to true or false. # The condition that data in the cell must match.
28649 # BooleanConditions are used by conditional formatting,
28650 # data validation, and the criteria in filters.
28651 "type": "A String", # The type of condition.
28652 "values": [ # The values of the condition. The number of supported values depends
28653 # on the condition type. Some support zero values,
28654 # others one or two values,
28655 # and ConditionType.ONE_OF_LIST supports an arbitrary number of values.
28656 { # The value of the condition.
28657 "relativeDate": "A String", # A relative date (based on the current date).
28658 # Valid only if the type is
28659 # DATE_BEFORE,
28660 # DATE_AFTER,
28661 # DATE_ON_OR_BEFORE or
28662 # DATE_ON_OR_AFTER.
28663 #
28664 # Relative dates are not supported in data validation.
28665 # They are supported only in conditional formatting and
28666 # conditional filters.
28667 "userEnteredValue": "A String", # A value the condition is based on.
28668 # The value will be parsed as if the user typed into a cell.
28669 # Formulas are supported (and must begin with an `=`).
28670 },
28671 ],
28672 },
28673 },
28674 "textFormatRuns": [ # Runs of rich text applied to subsections of the cell.
28675 # Runs start at specific indexes in the text and continue until the next
28676 # run. Properties of a run will continue unless explicitly changed
28677 # in a subsequent run (and properties of the first run will continue
28678 # the properties of the cell unless explicitly changed).
28679 #
28680 # When writing, the new runs will overwrite any prior runs.
28681 { # A run of a text format. The format of this run continues until explicitly
28682 # overridden in the next run.
28683 # When updating, all fields must be set.
28684 "startIndex": 42, # The character index where this run starts.
28685 "format": { # The format of a run of text in a cell. # The format of this run. Absent values inherit the cell's format.
28686 # Absent values indicate that the field isn't specified.
28687 "foregroundColor": { # Represents a color in the RGBA color space. This representation is designed # The foreground color of the text.
28688 # for simplicity of conversion to/from color representations in various
28689 # languages over compactness; for example, the fields of this representation
28690 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
28691 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
28692 # method in iOS; and, with just a little work, it can be easily formatted into
28693 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
28694 #
28695 # Example (Java):
28696 #
28697 # import com.google.type.Color;
28698 #
28699 # // ...
28700 # public static java.awt.Color fromProto(Color protocolor) {
28701 # float alpha = protocolor.hasAlpha()
28702 # ? protocolor.getAlpha().getValue()
28703 # : 1.0;
28704 #
28705 # return new java.awt.Color(
28706 # protocolor.getRed(),
28707 # protocolor.getGreen(),
28708 # protocolor.getBlue(),
28709 # alpha);
28710 # }
28711 #
28712 # public static Color toProto(java.awt.Color color) {
28713 # float red = (float) color.getRed();
28714 # float green = (float) color.getGreen();
28715 # float blue = (float) color.getBlue();
28716 # float denominator = 255.0;
28717 # Color.Builder resultBuilder =
28718 # Color
28719 # .newBuilder()
28720 # .setRed(red / denominator)
28721 # .setGreen(green / denominator)
28722 # .setBlue(blue / denominator);
28723 # int alpha = color.getAlpha();
28724 # if (alpha != 255) {
28725 # result.setAlpha(
28726 # FloatValue
28727 # .newBuilder()
28728 # .setValue(((float) alpha) / denominator)
28729 # .build());
28730 # }
28731 # return resultBuilder.build();
28732 # }
28733 # // ...
28734 #
28735 # Example (iOS / Obj-C):
28736 #
28737 # // ...
28738 # static UIColor* fromProto(Color* protocolor) {
28739 # float red = [protocolor red];
28740 # float green = [protocolor green];
28741 # float blue = [protocolor blue];
28742 # FloatValue* alpha_wrapper = [protocolor alpha];
28743 # float alpha = 1.0;
28744 # if (alpha_wrapper != nil) {
28745 # alpha = [alpha_wrapper value];
28746 # }
28747 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
28748 # }
28749 #
28750 # static Color* toProto(UIColor* color) {
28751 # CGFloat red, green, blue, alpha;
28752 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
28753 # return nil;
28754 # }
28755 # Color* result = [Color alloc] init];
28756 # [result setRed:red];
28757 # [result setGreen:green];
28758 # [result setBlue:blue];
28759 # if (alpha <= 0.9999) {
28760 # [result setAlpha:floatWrapperWithValue(alpha)];
28761 # }
28762 # [result autorelease];
28763 # return result;
28764 # }
28765 # // ...
28766 #
28767 # Example (JavaScript):
28768 #
28769 # // ...
28770 #
28771 # var protoToCssColor = function(rgb_color) {
28772 # var redFrac = rgb_color.red || 0.0;
28773 # var greenFrac = rgb_color.green || 0.0;
28774 # var blueFrac = rgb_color.blue || 0.0;
28775 # var red = Math.floor(redFrac * 255);
28776 # var green = Math.floor(greenFrac * 255);
28777 # var blue = Math.floor(blueFrac * 255);
28778 #
28779 # if (!('alpha' in rgb_color)) {
28780 # return rgbToCssColor_(red, green, blue);
28781 # }
28782 #
28783 # var alphaFrac = rgb_color.alpha.value || 0.0;
28784 # var rgbParams = [red, green, blue].join(',');
28785 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
28786 # };
28787 #
28788 # var rgbToCssColor_ = function(red, green, blue) {
28789 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
28790 # var hexString = rgbNumber.toString(16);
28791 # var missingZeros = 6 - hexString.length;
28792 # var resultBuilder = ['#'];
28793 # for (var i = 0; i < missingZeros; i++) {
28794 # resultBuilder.push('0');
28795 # }
28796 # resultBuilder.push(hexString);
28797 # return resultBuilder.join('');
28798 # };
28799 #
28800 # // ...
28801 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
28802 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
28803 # the final pixel color is defined by the equation:
28804 #
28805 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
28806 #
28807 # This means that a value of 1.0 corresponds to a solid color, whereas
28808 # a value of 0.0 corresponds to a completely transparent color. This
28809 # uses a wrapper message rather than a simple float scalar so that it is
28810 # possible to distinguish between a default value and the value being unset.
28811 # If omitted, this color object is to be rendered as a solid color
28812 # (as if the alpha value had been explicitly given with a value of 1.0).
28813 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
28814 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
28815 },
28816 "bold": True or False, # True if the text is bold.
28817 "strikethrough": True or False, # True if the text has a strikethrough.
28818 "fontFamily": "A String", # The font family.
28819 "fontSize": 42, # The size of the font.
28820 "italic": True or False, # True if the text is italicized.
28821 "underline": True or False, # True if the text is underlined.
28822 },
28823 },
28824 ],
28825 },
28826 ],
28827 },
28828 ],
28829 },
28830 ],
28831 "properties": { # Properties of a sheet. # The properties of the sheet.
28832 "sheetType": "A String", # The type of sheet. Defaults to GRID.
28833 # This field cannot be changed once set.
28834 "index": 42, # The index of the sheet within the spreadsheet.
28835 # When adding or updating sheet properties, if this field
28836 # is excluded then the sheet will be added or moved to the end
28837 # of the sheet list.
28838 "title": "A String", # The name of the sheet.
28839 "gridProperties": { # Properties of a grid. # Additional properties of the sheet if this sheet is a grid.
28840 # (If the sheet is an object sheet, containing a chart or image, then
28841 # this field will be absent.)
28842 # When writing it is an error to set any grid properties on non-grid sheets.
28843 "columnCount": 42, # The number of columns in the grid.
28844 "rowCount": 42, # The number of rows in the grid.
28845 "frozenColumnCount": 42, # The number of columns that are frozen in the grid.
28846 "hideGridlines": True or False, # True if the grid isn't showing gridlines in the UI.
28847 "frozenRowCount": 42, # The number of rows that are frozen in the grid.
28848 },
28849 "rightToLeft": True or False, # True if the sheet is an RTL sheet instead of an LTR sheet.
28850 "tabColor": { # Represents a color in the RGBA color space. This representation is designed # The color of the tab in the UI.
28851 # for simplicity of conversion to/from color representations in various
28852 # languages over compactness; for example, the fields of this representation
28853 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
28854 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
28855 # method in iOS; and, with just a little work, it can be easily formatted into
28856 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
28857 #
28858 # Example (Java):
28859 #
28860 # import com.google.type.Color;
28861 #
28862 # // ...
28863 # public static java.awt.Color fromProto(Color protocolor) {
28864 # float alpha = protocolor.hasAlpha()
28865 # ? protocolor.getAlpha().getValue()
28866 # : 1.0;
28867 #
28868 # return new java.awt.Color(
28869 # protocolor.getRed(),
28870 # protocolor.getGreen(),
28871 # protocolor.getBlue(),
28872 # alpha);
28873 # }
28874 #
28875 # public static Color toProto(java.awt.Color color) {
28876 # float red = (float) color.getRed();
28877 # float green = (float) color.getGreen();
28878 # float blue = (float) color.getBlue();
28879 # float denominator = 255.0;
28880 # Color.Builder resultBuilder =
28881 # Color
28882 # .newBuilder()
28883 # .setRed(red / denominator)
28884 # .setGreen(green / denominator)
28885 # .setBlue(blue / denominator);
28886 # int alpha = color.getAlpha();
28887 # if (alpha != 255) {
28888 # result.setAlpha(
28889 # FloatValue
28890 # .newBuilder()
28891 # .setValue(((float) alpha) / denominator)
28892 # .build());
28893 # }
28894 # return resultBuilder.build();
28895 # }
28896 # // ...
28897 #
28898 # Example (iOS / Obj-C):
28899 #
28900 # // ...
28901 # static UIColor* fromProto(Color* protocolor) {
28902 # float red = [protocolor red];
28903 # float green = [protocolor green];
28904 # float blue = [protocolor blue];
28905 # FloatValue* alpha_wrapper = [protocolor alpha];
28906 # float alpha = 1.0;
28907 # if (alpha_wrapper != nil) {
28908 # alpha = [alpha_wrapper value];
28909 # }
28910 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
28911 # }
28912 #
28913 # static Color* toProto(UIColor* color) {
28914 # CGFloat red, green, blue, alpha;
28915 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
28916 # return nil;
28917 # }
28918 # Color* result = [Color alloc] init];
28919 # [result setRed:red];
28920 # [result setGreen:green];
28921 # [result setBlue:blue];
28922 # if (alpha <= 0.9999) {
28923 # [result setAlpha:floatWrapperWithValue(alpha)];
28924 # }
28925 # [result autorelease];
28926 # return result;
28927 # }
28928 # // ...
28929 #
28930 # Example (JavaScript):
28931 #
28932 # // ...
28933 #
28934 # var protoToCssColor = function(rgb_color) {
28935 # var redFrac = rgb_color.red || 0.0;
28936 # var greenFrac = rgb_color.green || 0.0;
28937 # var blueFrac = rgb_color.blue || 0.0;
28938 # var red = Math.floor(redFrac * 255);
28939 # var green = Math.floor(greenFrac * 255);
28940 # var blue = Math.floor(blueFrac * 255);
28941 #
28942 # if (!('alpha' in rgb_color)) {
28943 # return rgbToCssColor_(red, green, blue);
28944 # }
28945 #
28946 # var alphaFrac = rgb_color.alpha.value || 0.0;
28947 # var rgbParams = [red, green, blue].join(',');
28948 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
28949 # };
28950 #
28951 # var rgbToCssColor_ = function(red, green, blue) {
28952 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
28953 # var hexString = rgbNumber.toString(16);
28954 # var missingZeros = 6 - hexString.length;
28955 # var resultBuilder = ['#'];
28956 # for (var i = 0; i < missingZeros; i++) {
28957 # resultBuilder.push('0');
28958 # }
28959 # resultBuilder.push(hexString);
28960 # return resultBuilder.join('');
28961 # };
28962 #
28963 # // ...
28964 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
28965 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
28966 # the final pixel color is defined by the equation:
28967 #
28968 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
28969 #
28970 # This means that a value of 1.0 corresponds to a solid color, whereas
28971 # a value of 0.0 corresponds to a completely transparent color. This
28972 # uses a wrapper message rather than a simple float scalar so that it is
28973 # possible to distinguish between a default value and the value being unset.
28974 # If omitted, this color object is to be rendered as a solid color
28975 # (as if the alpha value had been explicitly given with a value of 1.0).
28976 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
28977 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
28978 },
28979 "hidden": True or False, # True if the sheet is hidden in the UI, false if it's visible.
28980 "sheetId": 42, # The ID of the sheet. Must be non-negative.
28981 # This field cannot be changed once set.
28982 },
28983 },
28984 ],
28985 }</pre>
28986</div>
28987
28988<div class="method">
28989 <code class="details" id="get">get(spreadsheetId, ranges=None, x__xgafv=None, includeGridData=None)</code>
28990 <pre>Returns the spreadsheet at the given id.
28991The caller must specify the spreadsheet ID.
28992
28993By default, data within grids will not be returned.
28994You can include grid data one of two ways: specify a field mask listing
28995your desired fields (using the `fields` URL parameter in HTTP,
28996or `FieldMaskContext.response_mask` in the request extensions in an RPC),
28997or by setting the
28998includeGridData URL parameter
28999to true. If a field mask is set, the `includeGridData` parameter is
29000ignored.
29001
29002For large spreadsheets, it is recommended to retrieve only the specific
29003fields of the spreadsheet that you want.
29004
29005To retrieve only subsets of the spreadsheet, use the
29006ranges URL parameter.
29007Multiple ranges can be specified. Limiting the range will
29008return only the portions of the spreadsheet that intersect the requested
29009ranges. Ranges are specified using A1 notation.
29010
29011Args:
29012 spreadsheetId: string, The spreadsheet to request. (required)
29013 ranges: string, The ranges to retrieve from the spreadsheet. (repeated)
29014 x__xgafv: string, V1 error format.
29015 Allowed values
29016 1 - v1 error format
29017 2 - v2 error format
29018 includeGridData: boolean, True if grid data should be returned.
29019This parameter is ignored if a field mask was set in the request.
29020
29021Returns:
29022 An object of the form:
29023
29024 { # Resource that represents a spreadsheet.
29025 "spreadsheetId": "A String", # The ID of the spreadsheet.
29026 # This field is read-only.
29027 "namedRanges": [ # The named ranges defined in a spreadsheet.
29028 { # A named range.
29029 "namedRangeId": "A String", # The ID of the named range.
29030 "range": { # A range on a sheet. # The range this represents.
29031 # All indexes are zero-based.
29032 # Indexes are half open, e.g the start index is inclusive
29033 # and the end index is exclusive -- [start_index, end_index).
29034 # Missing indexes indicate the range is unbounded on that side.
29035 #
29036 # For example, if "Sheet1" is grid ID 0, then:
29037 #
29038 # Sheet1!A1:A1 == sheet_id: 0,
29039 # start_row_index: 0, end_row_index: 1,
29040 # start_column_index: 0, end_column_index: 1
29041 #
29042 # Sheet1!A3:B4 == sheet_id: 0,
29043 # start_row_index: 2, end_row_index: 4,
29044 # start_column_index: 0, end_column_index: 2
29045 #
29046 # Sheet1!A:B == sheet_id: 0,
29047 # start_column_index: 0, end_column_index: 2
29048 #
29049 # Sheet1!A5:B == sheet_id: 0,
29050 # start_row_index: 4,
29051 # start_column_index: 0, end_column_index: 2
29052 #
29053 # Sheet1 == sheet_id:0
29054 #
29055 # The start index must always be less than or equal to the end index.
29056 # If the start index equals the end index, then the range is empty.
29057 # Empty ranges are typically not meaningful and are usually rendered in the
29058 # UI as `#REF!`.
29059 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
29060 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
29061 "sheetId": 42, # The sheet this range is on.
29062 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
29063 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
29064 },
29065 "name": "A String", # The name of the named range.
29066 },
29067 ],
29068 "properties": { # Properties of a spreadsheet. # Overall properties of a spreadsheet.
29069 "locale": "A String", # The locale of the spreadsheet in one of the following formats:
29070 # * an ISO 639-1 language code such as `en`
29071 # * an ISO 639-2 language code such as `fil`, if no 639-1 code exists
29072 # * a combination of the ISO language code and country code, such as `en_US`
29073 # Note: when updating this field, not all locales/languages are supported.
29074 "timeZone": "A String", # The time zone of the spreadsheet, in CLDR format such as
29075 # `America/New_York`. If the time zone isn't recognized, this may
29076 # be a custom time zone such as `GMT-07:00`.
29077 "autoRecalc": "A String", # The amount of time to wait before volatile functions are recalculated.
29078 "defaultFormat": { # The format of a cell. # The default format of all cells in the spreadsheet.
29079 # CellData.effectiveFormat will not be set if the cell's format is equal
29080 # to this default format.
29081 # This field is read-only.
29082 "numberFormat": { # The number format of a cell. # A format describing how number values should be represented to the user.
29083 # When updating, all fields must be set.
29084 "pattern": "A String", # Pattern string used for formatting.
29085 "type": "A String", # The type of the number format.
29086 },
29087 "textDirection": "A String", # The direction of the text in the cell.
29088 "padding": { # The amount of padding around the cell, in pixels. # The padding of the cell.
29089 # When updating padding, every field must be specified.
29090 "top": 42, # The top padding of the cell.
29091 "right": 42, # The right padding of the cell.
29092 "bottom": 42, # The bottom padding of the cell.
29093 "left": 42, # The left padding of the cell.
29094 },
29095 "horizontalAlignment": "A String", # The horizontal alignment of the value in cell.
29096 "backgroundColor": { # Represents a color in the RGBA color space. This representation is designed # The background color of the cell.
29097 # for simplicity of conversion to/from color representations in various
29098 # languages over compactness; for example, the fields of this representation
29099 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
29100 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
29101 # method in iOS; and, with just a little work, it can be easily formatted into
29102 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
29103 #
29104 # Example (Java):
29105 #
29106 # import com.google.type.Color;
29107 #
29108 # // ...
29109 # public static java.awt.Color fromProto(Color protocolor) {
29110 # float alpha = protocolor.hasAlpha()
29111 # ? protocolor.getAlpha().getValue()
29112 # : 1.0;
29113 #
29114 # return new java.awt.Color(
29115 # protocolor.getRed(),
29116 # protocolor.getGreen(),
29117 # protocolor.getBlue(),
29118 # alpha);
29119 # }
29120 #
29121 # public static Color toProto(java.awt.Color color) {
29122 # float red = (float) color.getRed();
29123 # float green = (float) color.getGreen();
29124 # float blue = (float) color.getBlue();
29125 # float denominator = 255.0;
29126 # Color.Builder resultBuilder =
29127 # Color
29128 # .newBuilder()
29129 # .setRed(red / denominator)
29130 # .setGreen(green / denominator)
29131 # .setBlue(blue / denominator);
29132 # int alpha = color.getAlpha();
29133 # if (alpha != 255) {
29134 # result.setAlpha(
29135 # FloatValue
29136 # .newBuilder()
29137 # .setValue(((float) alpha) / denominator)
29138 # .build());
29139 # }
29140 # return resultBuilder.build();
29141 # }
29142 # // ...
29143 #
29144 # Example (iOS / Obj-C):
29145 #
29146 # // ...
29147 # static UIColor* fromProto(Color* protocolor) {
29148 # float red = [protocolor red];
29149 # float green = [protocolor green];
29150 # float blue = [protocolor blue];
29151 # FloatValue* alpha_wrapper = [protocolor alpha];
29152 # float alpha = 1.0;
29153 # if (alpha_wrapper != nil) {
29154 # alpha = [alpha_wrapper value];
29155 # }
29156 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
29157 # }
29158 #
29159 # static Color* toProto(UIColor* color) {
29160 # CGFloat red, green, blue, alpha;
29161 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
29162 # return nil;
29163 # }
29164 # Color* result = [Color alloc] init];
29165 # [result setRed:red];
29166 # [result setGreen:green];
29167 # [result setBlue:blue];
29168 # if (alpha <= 0.9999) {
29169 # [result setAlpha:floatWrapperWithValue(alpha)];
29170 # }
29171 # [result autorelease];
29172 # return result;
29173 # }
29174 # // ...
29175 #
29176 # Example (JavaScript):
29177 #
29178 # // ...
29179 #
29180 # var protoToCssColor = function(rgb_color) {
29181 # var redFrac = rgb_color.red || 0.0;
29182 # var greenFrac = rgb_color.green || 0.0;
29183 # var blueFrac = rgb_color.blue || 0.0;
29184 # var red = Math.floor(redFrac * 255);
29185 # var green = Math.floor(greenFrac * 255);
29186 # var blue = Math.floor(blueFrac * 255);
29187 #
29188 # if (!('alpha' in rgb_color)) {
29189 # return rgbToCssColor_(red, green, blue);
29190 # }
29191 #
29192 # var alphaFrac = rgb_color.alpha.value || 0.0;
29193 # var rgbParams = [red, green, blue].join(',');
29194 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
29195 # };
29196 #
29197 # var rgbToCssColor_ = function(red, green, blue) {
29198 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
29199 # var hexString = rgbNumber.toString(16);
29200 # var missingZeros = 6 - hexString.length;
29201 # var resultBuilder = ['#'];
29202 # for (var i = 0; i < missingZeros; i++) {
29203 # resultBuilder.push('0');
29204 # }
29205 # resultBuilder.push(hexString);
29206 # return resultBuilder.join('');
29207 # };
29208 #
29209 # // ...
29210 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
29211 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
29212 # the final pixel color is defined by the equation:
29213 #
29214 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
29215 #
29216 # This means that a value of 1.0 corresponds to a solid color, whereas
29217 # a value of 0.0 corresponds to a completely transparent color. This
29218 # uses a wrapper message rather than a simple float scalar so that it is
29219 # possible to distinguish between a default value and the value being unset.
29220 # If omitted, this color object is to be rendered as a solid color
29221 # (as if the alpha value had been explicitly given with a value of 1.0).
29222 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
29223 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
29224 },
29225 "verticalAlignment": "A String", # The vertical alignment of the value in cell.
29226 "textFormat": { # The format of a run of text in a cell. # The format of the text in the cell (unless overridden by a format run).
29227 # Absent values indicate that the field isn't specified.
29228 "foregroundColor": { # Represents a color in the RGBA color space. This representation is designed # The foreground color of the text.
29229 # for simplicity of conversion to/from color representations in various
29230 # languages over compactness; for example, the fields of this representation
29231 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
29232 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
29233 # method in iOS; and, with just a little work, it can be easily formatted into
29234 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
29235 #
29236 # Example (Java):
29237 #
29238 # import com.google.type.Color;
29239 #
29240 # // ...
29241 # public static java.awt.Color fromProto(Color protocolor) {
29242 # float alpha = protocolor.hasAlpha()
29243 # ? protocolor.getAlpha().getValue()
29244 # : 1.0;
29245 #
29246 # return new java.awt.Color(
29247 # protocolor.getRed(),
29248 # protocolor.getGreen(),
29249 # protocolor.getBlue(),
29250 # alpha);
29251 # }
29252 #
29253 # public static Color toProto(java.awt.Color color) {
29254 # float red = (float) color.getRed();
29255 # float green = (float) color.getGreen();
29256 # float blue = (float) color.getBlue();
29257 # float denominator = 255.0;
29258 # Color.Builder resultBuilder =
29259 # Color
29260 # .newBuilder()
29261 # .setRed(red / denominator)
29262 # .setGreen(green / denominator)
29263 # .setBlue(blue / denominator);
29264 # int alpha = color.getAlpha();
29265 # if (alpha != 255) {
29266 # result.setAlpha(
29267 # FloatValue
29268 # .newBuilder()
29269 # .setValue(((float) alpha) / denominator)
29270 # .build());
29271 # }
29272 # return resultBuilder.build();
29273 # }
29274 # // ...
29275 #
29276 # Example (iOS / Obj-C):
29277 #
29278 # // ...
29279 # static UIColor* fromProto(Color* protocolor) {
29280 # float red = [protocolor red];
29281 # float green = [protocolor green];
29282 # float blue = [protocolor blue];
29283 # FloatValue* alpha_wrapper = [protocolor alpha];
29284 # float alpha = 1.0;
29285 # if (alpha_wrapper != nil) {
29286 # alpha = [alpha_wrapper value];
29287 # }
29288 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
29289 # }
29290 #
29291 # static Color* toProto(UIColor* color) {
29292 # CGFloat red, green, blue, alpha;
29293 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
29294 # return nil;
29295 # }
29296 # Color* result = [Color alloc] init];
29297 # [result setRed:red];
29298 # [result setGreen:green];
29299 # [result setBlue:blue];
29300 # if (alpha <= 0.9999) {
29301 # [result setAlpha:floatWrapperWithValue(alpha)];
29302 # }
29303 # [result autorelease];
29304 # return result;
29305 # }
29306 # // ...
29307 #
29308 # Example (JavaScript):
29309 #
29310 # // ...
29311 #
29312 # var protoToCssColor = function(rgb_color) {
29313 # var redFrac = rgb_color.red || 0.0;
29314 # var greenFrac = rgb_color.green || 0.0;
29315 # var blueFrac = rgb_color.blue || 0.0;
29316 # var red = Math.floor(redFrac * 255);
29317 # var green = Math.floor(greenFrac * 255);
29318 # var blue = Math.floor(blueFrac * 255);
29319 #
29320 # if (!('alpha' in rgb_color)) {
29321 # return rgbToCssColor_(red, green, blue);
29322 # }
29323 #
29324 # var alphaFrac = rgb_color.alpha.value || 0.0;
29325 # var rgbParams = [red, green, blue].join(',');
29326 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
29327 # };
29328 #
29329 # var rgbToCssColor_ = function(red, green, blue) {
29330 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
29331 # var hexString = rgbNumber.toString(16);
29332 # var missingZeros = 6 - hexString.length;
29333 # var resultBuilder = ['#'];
29334 # for (var i = 0; i < missingZeros; i++) {
29335 # resultBuilder.push('0');
29336 # }
29337 # resultBuilder.push(hexString);
29338 # return resultBuilder.join('');
29339 # };
29340 #
29341 # // ...
29342 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
29343 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
29344 # the final pixel color is defined by the equation:
29345 #
29346 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
29347 #
29348 # This means that a value of 1.0 corresponds to a solid color, whereas
29349 # a value of 0.0 corresponds to a completely transparent color. This
29350 # uses a wrapper message rather than a simple float scalar so that it is
29351 # possible to distinguish between a default value and the value being unset.
29352 # If omitted, this color object is to be rendered as a solid color
29353 # (as if the alpha value had been explicitly given with a value of 1.0).
29354 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
29355 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
29356 },
29357 "bold": True or False, # True if the text is bold.
29358 "strikethrough": True or False, # True if the text has a strikethrough.
29359 "fontFamily": "A String", # The font family.
29360 "fontSize": 42, # The size of the font.
29361 "italic": True or False, # True if the text is italicized.
29362 "underline": True or False, # True if the text is underlined.
29363 },
29364 "hyperlinkDisplayType": "A String", # How a hyperlink, if it exists, should be displayed in the cell.
29365 "borders": { # The borders of the cell. # The borders of the cell.
29366 "top": { # A border along a cell. # The top border of the cell.
29367 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
29368 # for simplicity of conversion to/from color representations in various
29369 # languages over compactness; for example, the fields of this representation
29370 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
29371 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
29372 # method in iOS; and, with just a little work, it can be easily formatted into
29373 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
29374 #
29375 # Example (Java):
29376 #
29377 # import com.google.type.Color;
29378 #
29379 # // ...
29380 # public static java.awt.Color fromProto(Color protocolor) {
29381 # float alpha = protocolor.hasAlpha()
29382 # ? protocolor.getAlpha().getValue()
29383 # : 1.0;
29384 #
29385 # return new java.awt.Color(
29386 # protocolor.getRed(),
29387 # protocolor.getGreen(),
29388 # protocolor.getBlue(),
29389 # alpha);
29390 # }
29391 #
29392 # public static Color toProto(java.awt.Color color) {
29393 # float red = (float) color.getRed();
29394 # float green = (float) color.getGreen();
29395 # float blue = (float) color.getBlue();
29396 # float denominator = 255.0;
29397 # Color.Builder resultBuilder =
29398 # Color
29399 # .newBuilder()
29400 # .setRed(red / denominator)
29401 # .setGreen(green / denominator)
29402 # .setBlue(blue / denominator);
29403 # int alpha = color.getAlpha();
29404 # if (alpha != 255) {
29405 # result.setAlpha(
29406 # FloatValue
29407 # .newBuilder()
29408 # .setValue(((float) alpha) / denominator)
29409 # .build());
29410 # }
29411 # return resultBuilder.build();
29412 # }
29413 # // ...
29414 #
29415 # Example (iOS / Obj-C):
29416 #
29417 # // ...
29418 # static UIColor* fromProto(Color* protocolor) {
29419 # float red = [protocolor red];
29420 # float green = [protocolor green];
29421 # float blue = [protocolor blue];
29422 # FloatValue* alpha_wrapper = [protocolor alpha];
29423 # float alpha = 1.0;
29424 # if (alpha_wrapper != nil) {
29425 # alpha = [alpha_wrapper value];
29426 # }
29427 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
29428 # }
29429 #
29430 # static Color* toProto(UIColor* color) {
29431 # CGFloat red, green, blue, alpha;
29432 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
29433 # return nil;
29434 # }
29435 # Color* result = [Color alloc] init];
29436 # [result setRed:red];
29437 # [result setGreen:green];
29438 # [result setBlue:blue];
29439 # if (alpha <= 0.9999) {
29440 # [result setAlpha:floatWrapperWithValue(alpha)];
29441 # }
29442 # [result autorelease];
29443 # return result;
29444 # }
29445 # // ...
29446 #
29447 # Example (JavaScript):
29448 #
29449 # // ...
29450 #
29451 # var protoToCssColor = function(rgb_color) {
29452 # var redFrac = rgb_color.red || 0.0;
29453 # var greenFrac = rgb_color.green || 0.0;
29454 # var blueFrac = rgb_color.blue || 0.0;
29455 # var red = Math.floor(redFrac * 255);
29456 # var green = Math.floor(greenFrac * 255);
29457 # var blue = Math.floor(blueFrac * 255);
29458 #
29459 # if (!('alpha' in rgb_color)) {
29460 # return rgbToCssColor_(red, green, blue);
29461 # }
29462 #
29463 # var alphaFrac = rgb_color.alpha.value || 0.0;
29464 # var rgbParams = [red, green, blue].join(',');
29465 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
29466 # };
29467 #
29468 # var rgbToCssColor_ = function(red, green, blue) {
29469 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
29470 # var hexString = rgbNumber.toString(16);
29471 # var missingZeros = 6 - hexString.length;
29472 # var resultBuilder = ['#'];
29473 # for (var i = 0; i < missingZeros; i++) {
29474 # resultBuilder.push('0');
29475 # }
29476 # resultBuilder.push(hexString);
29477 # return resultBuilder.join('');
29478 # };
29479 #
29480 # // ...
29481 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
29482 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
29483 # the final pixel color is defined by the equation:
29484 #
29485 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
29486 #
29487 # This means that a value of 1.0 corresponds to a solid color, whereas
29488 # a value of 0.0 corresponds to a completely transparent color. This
29489 # uses a wrapper message rather than a simple float scalar so that it is
29490 # possible to distinguish between a default value and the value being unset.
29491 # If omitted, this color object is to be rendered as a solid color
29492 # (as if the alpha value had been explicitly given with a value of 1.0).
29493 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
29494 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
29495 },
29496 "width": 42, # The width of the border, in pixels.
29497 # Border widths must be between 0 and 3 pixels.
29498 "style": "A String", # The style of the border.
29499 },
29500 "right": { # A border along a cell. # The right border of the cell.
29501 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
29502 # for simplicity of conversion to/from color representations in various
29503 # languages over compactness; for example, the fields of this representation
29504 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
29505 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
29506 # method in iOS; and, with just a little work, it can be easily formatted into
29507 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
29508 #
29509 # Example (Java):
29510 #
29511 # import com.google.type.Color;
29512 #
29513 # // ...
29514 # public static java.awt.Color fromProto(Color protocolor) {
29515 # float alpha = protocolor.hasAlpha()
29516 # ? protocolor.getAlpha().getValue()
29517 # : 1.0;
29518 #
29519 # return new java.awt.Color(
29520 # protocolor.getRed(),
29521 # protocolor.getGreen(),
29522 # protocolor.getBlue(),
29523 # alpha);
29524 # }
29525 #
29526 # public static Color toProto(java.awt.Color color) {
29527 # float red = (float) color.getRed();
29528 # float green = (float) color.getGreen();
29529 # float blue = (float) color.getBlue();
29530 # float denominator = 255.0;
29531 # Color.Builder resultBuilder =
29532 # Color
29533 # .newBuilder()
29534 # .setRed(red / denominator)
29535 # .setGreen(green / denominator)
29536 # .setBlue(blue / denominator);
29537 # int alpha = color.getAlpha();
29538 # if (alpha != 255) {
29539 # result.setAlpha(
29540 # FloatValue
29541 # .newBuilder()
29542 # .setValue(((float) alpha) / denominator)
29543 # .build());
29544 # }
29545 # return resultBuilder.build();
29546 # }
29547 # // ...
29548 #
29549 # Example (iOS / Obj-C):
29550 #
29551 # // ...
29552 # static UIColor* fromProto(Color* protocolor) {
29553 # float red = [protocolor red];
29554 # float green = [protocolor green];
29555 # float blue = [protocolor blue];
29556 # FloatValue* alpha_wrapper = [protocolor alpha];
29557 # float alpha = 1.0;
29558 # if (alpha_wrapper != nil) {
29559 # alpha = [alpha_wrapper value];
29560 # }
29561 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
29562 # }
29563 #
29564 # static Color* toProto(UIColor* color) {
29565 # CGFloat red, green, blue, alpha;
29566 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
29567 # return nil;
29568 # }
29569 # Color* result = [Color alloc] init];
29570 # [result setRed:red];
29571 # [result setGreen:green];
29572 # [result setBlue:blue];
29573 # if (alpha <= 0.9999) {
29574 # [result setAlpha:floatWrapperWithValue(alpha)];
29575 # }
29576 # [result autorelease];
29577 # return result;
29578 # }
29579 # // ...
29580 #
29581 # Example (JavaScript):
29582 #
29583 # // ...
29584 #
29585 # var protoToCssColor = function(rgb_color) {
29586 # var redFrac = rgb_color.red || 0.0;
29587 # var greenFrac = rgb_color.green || 0.0;
29588 # var blueFrac = rgb_color.blue || 0.0;
29589 # var red = Math.floor(redFrac * 255);
29590 # var green = Math.floor(greenFrac * 255);
29591 # var blue = Math.floor(blueFrac * 255);
29592 #
29593 # if (!('alpha' in rgb_color)) {
29594 # return rgbToCssColor_(red, green, blue);
29595 # }
29596 #
29597 # var alphaFrac = rgb_color.alpha.value || 0.0;
29598 # var rgbParams = [red, green, blue].join(',');
29599 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
29600 # };
29601 #
29602 # var rgbToCssColor_ = function(red, green, blue) {
29603 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
29604 # var hexString = rgbNumber.toString(16);
29605 # var missingZeros = 6 - hexString.length;
29606 # var resultBuilder = ['#'];
29607 # for (var i = 0; i < missingZeros; i++) {
29608 # resultBuilder.push('0');
29609 # }
29610 # resultBuilder.push(hexString);
29611 # return resultBuilder.join('');
29612 # };
29613 #
29614 # // ...
29615 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
29616 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
29617 # the final pixel color is defined by the equation:
29618 #
29619 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
29620 #
29621 # This means that a value of 1.0 corresponds to a solid color, whereas
29622 # a value of 0.0 corresponds to a completely transparent color. This
29623 # uses a wrapper message rather than a simple float scalar so that it is
29624 # possible to distinguish between a default value and the value being unset.
29625 # If omitted, this color object is to be rendered as a solid color
29626 # (as if the alpha value had been explicitly given with a value of 1.0).
29627 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
29628 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
29629 },
29630 "width": 42, # The width of the border, in pixels.
29631 # Border widths must be between 0 and 3 pixels.
29632 "style": "A String", # The style of the border.
29633 },
29634 "bottom": { # A border along a cell. # The bottom border of the cell.
29635 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
29636 # for simplicity of conversion to/from color representations in various
29637 # languages over compactness; for example, the fields of this representation
29638 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
29639 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
29640 # method in iOS; and, with just a little work, it can be easily formatted into
29641 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
29642 #
29643 # Example (Java):
29644 #
29645 # import com.google.type.Color;
29646 #
29647 # // ...
29648 # public static java.awt.Color fromProto(Color protocolor) {
29649 # float alpha = protocolor.hasAlpha()
29650 # ? protocolor.getAlpha().getValue()
29651 # : 1.0;
29652 #
29653 # return new java.awt.Color(
29654 # protocolor.getRed(),
29655 # protocolor.getGreen(),
29656 # protocolor.getBlue(),
29657 # alpha);
29658 # }
29659 #
29660 # public static Color toProto(java.awt.Color color) {
29661 # float red = (float) color.getRed();
29662 # float green = (float) color.getGreen();
29663 # float blue = (float) color.getBlue();
29664 # float denominator = 255.0;
29665 # Color.Builder resultBuilder =
29666 # Color
29667 # .newBuilder()
29668 # .setRed(red / denominator)
29669 # .setGreen(green / denominator)
29670 # .setBlue(blue / denominator);
29671 # int alpha = color.getAlpha();
29672 # if (alpha != 255) {
29673 # result.setAlpha(
29674 # FloatValue
29675 # .newBuilder()
29676 # .setValue(((float) alpha) / denominator)
29677 # .build());
29678 # }
29679 # return resultBuilder.build();
29680 # }
29681 # // ...
29682 #
29683 # Example (iOS / Obj-C):
29684 #
29685 # // ...
29686 # static UIColor* fromProto(Color* protocolor) {
29687 # float red = [protocolor red];
29688 # float green = [protocolor green];
29689 # float blue = [protocolor blue];
29690 # FloatValue* alpha_wrapper = [protocolor alpha];
29691 # float alpha = 1.0;
29692 # if (alpha_wrapper != nil) {
29693 # alpha = [alpha_wrapper value];
29694 # }
29695 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
29696 # }
29697 #
29698 # static Color* toProto(UIColor* color) {
29699 # CGFloat red, green, blue, alpha;
29700 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
29701 # return nil;
29702 # }
29703 # Color* result = [Color alloc] init];
29704 # [result setRed:red];
29705 # [result setGreen:green];
29706 # [result setBlue:blue];
29707 # if (alpha <= 0.9999) {
29708 # [result setAlpha:floatWrapperWithValue(alpha)];
29709 # }
29710 # [result autorelease];
29711 # return result;
29712 # }
29713 # // ...
29714 #
29715 # Example (JavaScript):
29716 #
29717 # // ...
29718 #
29719 # var protoToCssColor = function(rgb_color) {
29720 # var redFrac = rgb_color.red || 0.0;
29721 # var greenFrac = rgb_color.green || 0.0;
29722 # var blueFrac = rgb_color.blue || 0.0;
29723 # var red = Math.floor(redFrac * 255);
29724 # var green = Math.floor(greenFrac * 255);
29725 # var blue = Math.floor(blueFrac * 255);
29726 #
29727 # if (!('alpha' in rgb_color)) {
29728 # return rgbToCssColor_(red, green, blue);
29729 # }
29730 #
29731 # var alphaFrac = rgb_color.alpha.value || 0.0;
29732 # var rgbParams = [red, green, blue].join(',');
29733 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
29734 # };
29735 #
29736 # var rgbToCssColor_ = function(red, green, blue) {
29737 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
29738 # var hexString = rgbNumber.toString(16);
29739 # var missingZeros = 6 - hexString.length;
29740 # var resultBuilder = ['#'];
29741 # for (var i = 0; i < missingZeros; i++) {
29742 # resultBuilder.push('0');
29743 # }
29744 # resultBuilder.push(hexString);
29745 # return resultBuilder.join('');
29746 # };
29747 #
29748 # // ...
29749 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
29750 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
29751 # the final pixel color is defined by the equation:
29752 #
29753 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
29754 #
29755 # This means that a value of 1.0 corresponds to a solid color, whereas
29756 # a value of 0.0 corresponds to a completely transparent color. This
29757 # uses a wrapper message rather than a simple float scalar so that it is
29758 # possible to distinguish between a default value and the value being unset.
29759 # If omitted, this color object is to be rendered as a solid color
29760 # (as if the alpha value had been explicitly given with a value of 1.0).
29761 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
29762 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
29763 },
29764 "width": 42, # The width of the border, in pixels.
29765 # Border widths must be between 0 and 3 pixels.
29766 "style": "A String", # The style of the border.
29767 },
29768 "left": { # A border along a cell. # The left border of the cell.
29769 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
29770 # for simplicity of conversion to/from color representations in various
29771 # languages over compactness; for example, the fields of this representation
29772 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
29773 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
29774 # method in iOS; and, with just a little work, it can be easily formatted into
29775 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
29776 #
29777 # Example (Java):
29778 #
29779 # import com.google.type.Color;
29780 #
29781 # // ...
29782 # public static java.awt.Color fromProto(Color protocolor) {
29783 # float alpha = protocolor.hasAlpha()
29784 # ? protocolor.getAlpha().getValue()
29785 # : 1.0;
29786 #
29787 # return new java.awt.Color(
29788 # protocolor.getRed(),
29789 # protocolor.getGreen(),
29790 # protocolor.getBlue(),
29791 # alpha);
29792 # }
29793 #
29794 # public static Color toProto(java.awt.Color color) {
29795 # float red = (float) color.getRed();
29796 # float green = (float) color.getGreen();
29797 # float blue = (float) color.getBlue();
29798 # float denominator = 255.0;
29799 # Color.Builder resultBuilder =
29800 # Color
29801 # .newBuilder()
29802 # .setRed(red / denominator)
29803 # .setGreen(green / denominator)
29804 # .setBlue(blue / denominator);
29805 # int alpha = color.getAlpha();
29806 # if (alpha != 255) {
29807 # result.setAlpha(
29808 # FloatValue
29809 # .newBuilder()
29810 # .setValue(((float) alpha) / denominator)
29811 # .build());
29812 # }
29813 # return resultBuilder.build();
29814 # }
29815 # // ...
29816 #
29817 # Example (iOS / Obj-C):
29818 #
29819 # // ...
29820 # static UIColor* fromProto(Color* protocolor) {
29821 # float red = [protocolor red];
29822 # float green = [protocolor green];
29823 # float blue = [protocolor blue];
29824 # FloatValue* alpha_wrapper = [protocolor alpha];
29825 # float alpha = 1.0;
29826 # if (alpha_wrapper != nil) {
29827 # alpha = [alpha_wrapper value];
29828 # }
29829 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
29830 # }
29831 #
29832 # static Color* toProto(UIColor* color) {
29833 # CGFloat red, green, blue, alpha;
29834 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
29835 # return nil;
29836 # }
29837 # Color* result = [Color alloc] init];
29838 # [result setRed:red];
29839 # [result setGreen:green];
29840 # [result setBlue:blue];
29841 # if (alpha <= 0.9999) {
29842 # [result setAlpha:floatWrapperWithValue(alpha)];
29843 # }
29844 # [result autorelease];
29845 # return result;
29846 # }
29847 # // ...
29848 #
29849 # Example (JavaScript):
29850 #
29851 # // ...
29852 #
29853 # var protoToCssColor = function(rgb_color) {
29854 # var redFrac = rgb_color.red || 0.0;
29855 # var greenFrac = rgb_color.green || 0.0;
29856 # var blueFrac = rgb_color.blue || 0.0;
29857 # var red = Math.floor(redFrac * 255);
29858 # var green = Math.floor(greenFrac * 255);
29859 # var blue = Math.floor(blueFrac * 255);
29860 #
29861 # if (!('alpha' in rgb_color)) {
29862 # return rgbToCssColor_(red, green, blue);
29863 # }
29864 #
29865 # var alphaFrac = rgb_color.alpha.value || 0.0;
29866 # var rgbParams = [red, green, blue].join(',');
29867 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
29868 # };
29869 #
29870 # var rgbToCssColor_ = function(red, green, blue) {
29871 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
29872 # var hexString = rgbNumber.toString(16);
29873 # var missingZeros = 6 - hexString.length;
29874 # var resultBuilder = ['#'];
29875 # for (var i = 0; i < missingZeros; i++) {
29876 # resultBuilder.push('0');
29877 # }
29878 # resultBuilder.push(hexString);
29879 # return resultBuilder.join('');
29880 # };
29881 #
29882 # // ...
29883 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
29884 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
29885 # the final pixel color is defined by the equation:
29886 #
29887 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
29888 #
29889 # This means that a value of 1.0 corresponds to a solid color, whereas
29890 # a value of 0.0 corresponds to a completely transparent color. This
29891 # uses a wrapper message rather than a simple float scalar so that it is
29892 # possible to distinguish between a default value and the value being unset.
29893 # If omitted, this color object is to be rendered as a solid color
29894 # (as if the alpha value had been explicitly given with a value of 1.0).
29895 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
29896 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
29897 },
29898 "width": 42, # The width of the border, in pixels.
29899 # Border widths must be between 0 and 3 pixels.
29900 "style": "A String", # The style of the border.
29901 },
29902 },
29903 "wrapStrategy": "A String", # The wrap strategy for the value in the cell.
29904 },
29905 "title": "A String", # The title of the spreadsheet.
29906 },
29907 "sheets": [ # The sheets that are part of a spreadsheet.
29908 { # A sheet in a spreadsheet.
29909 "conditionalFormats": [ # The conditional format rules in this sheet.
29910 { # A rule describing a conditional format.
29911 "ranges": [ # The ranges that will be formatted if the condition is true.
29912 # All the ranges must be on the same grid.
29913 { # A range on a sheet.
29914 # All indexes are zero-based.
29915 # Indexes are half open, e.g the start index is inclusive
29916 # and the end index is exclusive -- [start_index, end_index).
29917 # Missing indexes indicate the range is unbounded on that side.
29918 #
29919 # For example, if "Sheet1" is grid ID 0, then:
29920 #
29921 # Sheet1!A1:A1 == sheet_id: 0,
29922 # start_row_index: 0, end_row_index: 1,
29923 # start_column_index: 0, end_column_index: 1
29924 #
29925 # Sheet1!A3:B4 == sheet_id: 0,
29926 # start_row_index: 2, end_row_index: 4,
29927 # start_column_index: 0, end_column_index: 2
29928 #
29929 # Sheet1!A:B == sheet_id: 0,
29930 # start_column_index: 0, end_column_index: 2
29931 #
29932 # Sheet1!A5:B == sheet_id: 0,
29933 # start_row_index: 4,
29934 # start_column_index: 0, end_column_index: 2
29935 #
29936 # Sheet1 == sheet_id:0
29937 #
29938 # The start index must always be less than or equal to the end index.
29939 # If the start index equals the end index, then the range is empty.
29940 # Empty ranges are typically not meaningful and are usually rendered in the
29941 # UI as `#REF!`.
29942 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
29943 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
29944 "sheetId": 42, # The sheet this range is on.
29945 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
29946 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
29947 },
29948 ],
29949 "booleanRule": { # A rule that may or may not match, depending on the condition. # The formatting is either "on" or "off" according to the rule.
29950 "condition": { # A condition that can evaluate to true or false. # The condition of the rule. If the condition evaluates to true,
29951 # the format will be applied.
29952 # BooleanConditions are used by conditional formatting,
29953 # data validation, and the criteria in filters.
29954 "type": "A String", # The type of condition.
29955 "values": [ # The values of the condition. The number of supported values depends
29956 # on the condition type. Some support zero values,
29957 # others one or two values,
29958 # and ConditionType.ONE_OF_LIST supports an arbitrary number of values.
29959 { # The value of the condition.
29960 "relativeDate": "A String", # A relative date (based on the current date).
29961 # Valid only if the type is
29962 # DATE_BEFORE,
29963 # DATE_AFTER,
29964 # DATE_ON_OR_BEFORE or
29965 # DATE_ON_OR_AFTER.
29966 #
29967 # Relative dates are not supported in data validation.
29968 # They are supported only in conditional formatting and
29969 # conditional filters.
29970 "userEnteredValue": "A String", # A value the condition is based on.
29971 # The value will be parsed as if the user typed into a cell.
29972 # Formulas are supported (and must begin with an `=`).
29973 },
29974 ],
29975 },
29976 "format": { # The format of a cell. # The format to apply.
29977 # Conditional formatting can only apply a subset of formatting:
29978 # bold, italic,
29979 # strikethrough,
29980 # foreground color &
29981 # background color.
29982 "numberFormat": { # The number format of a cell. # A format describing how number values should be represented to the user.
29983 # When updating, all fields must be set.
29984 "pattern": "A String", # Pattern string used for formatting.
29985 "type": "A String", # The type of the number format.
29986 },
29987 "textDirection": "A String", # The direction of the text in the cell.
29988 "padding": { # The amount of padding around the cell, in pixels. # The padding of the cell.
29989 # When updating padding, every field must be specified.
29990 "top": 42, # The top padding of the cell.
29991 "right": 42, # The right padding of the cell.
29992 "bottom": 42, # The bottom padding of the cell.
29993 "left": 42, # The left padding of the cell.
29994 },
29995 "horizontalAlignment": "A String", # The horizontal alignment of the value in cell.
29996 "backgroundColor": { # Represents a color in the RGBA color space. This representation is designed # The background color of the cell.
29997 # for simplicity of conversion to/from color representations in various
29998 # languages over compactness; for example, the fields of this representation
29999 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
30000 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
30001 # method in iOS; and, with just a little work, it can be easily formatted into
30002 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
30003 #
30004 # Example (Java):
30005 #
30006 # import com.google.type.Color;
30007 #
30008 # // ...
30009 # public static java.awt.Color fromProto(Color protocolor) {
30010 # float alpha = protocolor.hasAlpha()
30011 # ? protocolor.getAlpha().getValue()
30012 # : 1.0;
30013 #
30014 # return new java.awt.Color(
30015 # protocolor.getRed(),
30016 # protocolor.getGreen(),
30017 # protocolor.getBlue(),
30018 # alpha);
30019 # }
30020 #
30021 # public static Color toProto(java.awt.Color color) {
30022 # float red = (float) color.getRed();
30023 # float green = (float) color.getGreen();
30024 # float blue = (float) color.getBlue();
30025 # float denominator = 255.0;
30026 # Color.Builder resultBuilder =
30027 # Color
30028 # .newBuilder()
30029 # .setRed(red / denominator)
30030 # .setGreen(green / denominator)
30031 # .setBlue(blue / denominator);
30032 # int alpha = color.getAlpha();
30033 # if (alpha != 255) {
30034 # result.setAlpha(
30035 # FloatValue
30036 # .newBuilder()
30037 # .setValue(((float) alpha) / denominator)
30038 # .build());
30039 # }
30040 # return resultBuilder.build();
30041 # }
30042 # // ...
30043 #
30044 # Example (iOS / Obj-C):
30045 #
30046 # // ...
30047 # static UIColor* fromProto(Color* protocolor) {
30048 # float red = [protocolor red];
30049 # float green = [protocolor green];
30050 # float blue = [protocolor blue];
30051 # FloatValue* alpha_wrapper = [protocolor alpha];
30052 # float alpha = 1.0;
30053 # if (alpha_wrapper != nil) {
30054 # alpha = [alpha_wrapper value];
30055 # }
30056 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
30057 # }
30058 #
30059 # static Color* toProto(UIColor* color) {
30060 # CGFloat red, green, blue, alpha;
30061 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
30062 # return nil;
30063 # }
30064 # Color* result = [Color alloc] init];
30065 # [result setRed:red];
30066 # [result setGreen:green];
30067 # [result setBlue:blue];
30068 # if (alpha <= 0.9999) {
30069 # [result setAlpha:floatWrapperWithValue(alpha)];
30070 # }
30071 # [result autorelease];
30072 # return result;
30073 # }
30074 # // ...
30075 #
30076 # Example (JavaScript):
30077 #
30078 # // ...
30079 #
30080 # var protoToCssColor = function(rgb_color) {
30081 # var redFrac = rgb_color.red || 0.0;
30082 # var greenFrac = rgb_color.green || 0.0;
30083 # var blueFrac = rgb_color.blue || 0.0;
30084 # var red = Math.floor(redFrac * 255);
30085 # var green = Math.floor(greenFrac * 255);
30086 # var blue = Math.floor(blueFrac * 255);
30087 #
30088 # if (!('alpha' in rgb_color)) {
30089 # return rgbToCssColor_(red, green, blue);
30090 # }
30091 #
30092 # var alphaFrac = rgb_color.alpha.value || 0.0;
30093 # var rgbParams = [red, green, blue].join(',');
30094 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
30095 # };
30096 #
30097 # var rgbToCssColor_ = function(red, green, blue) {
30098 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
30099 # var hexString = rgbNumber.toString(16);
30100 # var missingZeros = 6 - hexString.length;
30101 # var resultBuilder = ['#'];
30102 # for (var i = 0; i < missingZeros; i++) {
30103 # resultBuilder.push('0');
30104 # }
30105 # resultBuilder.push(hexString);
30106 # return resultBuilder.join('');
30107 # };
30108 #
30109 # // ...
30110 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
30111 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
30112 # the final pixel color is defined by the equation:
30113 #
30114 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
30115 #
30116 # This means that a value of 1.0 corresponds to a solid color, whereas
30117 # a value of 0.0 corresponds to a completely transparent color. This
30118 # uses a wrapper message rather than a simple float scalar so that it is
30119 # possible to distinguish between a default value and the value being unset.
30120 # If omitted, this color object is to be rendered as a solid color
30121 # (as if the alpha value had been explicitly given with a value of 1.0).
30122 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
30123 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
30124 },
30125 "verticalAlignment": "A String", # The vertical alignment of the value in cell.
30126 "textFormat": { # The format of a run of text in a cell. # The format of the text in the cell (unless overridden by a format run).
30127 # Absent values indicate that the field isn't specified.
30128 "foregroundColor": { # Represents a color in the RGBA color space. This representation is designed # The foreground color of the text.
30129 # for simplicity of conversion to/from color representations in various
30130 # languages over compactness; for example, the fields of this representation
30131 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
30132 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
30133 # method in iOS; and, with just a little work, it can be easily formatted into
30134 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
30135 #
30136 # Example (Java):
30137 #
30138 # import com.google.type.Color;
30139 #
30140 # // ...
30141 # public static java.awt.Color fromProto(Color protocolor) {
30142 # float alpha = protocolor.hasAlpha()
30143 # ? protocolor.getAlpha().getValue()
30144 # : 1.0;
30145 #
30146 # return new java.awt.Color(
30147 # protocolor.getRed(),
30148 # protocolor.getGreen(),
30149 # protocolor.getBlue(),
30150 # alpha);
30151 # }
30152 #
30153 # public static Color toProto(java.awt.Color color) {
30154 # float red = (float) color.getRed();
30155 # float green = (float) color.getGreen();
30156 # float blue = (float) color.getBlue();
30157 # float denominator = 255.0;
30158 # Color.Builder resultBuilder =
30159 # Color
30160 # .newBuilder()
30161 # .setRed(red / denominator)
30162 # .setGreen(green / denominator)
30163 # .setBlue(blue / denominator);
30164 # int alpha = color.getAlpha();
30165 # if (alpha != 255) {
30166 # result.setAlpha(
30167 # FloatValue
30168 # .newBuilder()
30169 # .setValue(((float) alpha) / denominator)
30170 # .build());
30171 # }
30172 # return resultBuilder.build();
30173 # }
30174 # // ...
30175 #
30176 # Example (iOS / Obj-C):
30177 #
30178 # // ...
30179 # static UIColor* fromProto(Color* protocolor) {
30180 # float red = [protocolor red];
30181 # float green = [protocolor green];
30182 # float blue = [protocolor blue];
30183 # FloatValue* alpha_wrapper = [protocolor alpha];
30184 # float alpha = 1.0;
30185 # if (alpha_wrapper != nil) {
30186 # alpha = [alpha_wrapper value];
30187 # }
30188 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
30189 # }
30190 #
30191 # static Color* toProto(UIColor* color) {
30192 # CGFloat red, green, blue, alpha;
30193 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
30194 # return nil;
30195 # }
30196 # Color* result = [Color alloc] init];
30197 # [result setRed:red];
30198 # [result setGreen:green];
30199 # [result setBlue:blue];
30200 # if (alpha <= 0.9999) {
30201 # [result setAlpha:floatWrapperWithValue(alpha)];
30202 # }
30203 # [result autorelease];
30204 # return result;
30205 # }
30206 # // ...
30207 #
30208 # Example (JavaScript):
30209 #
30210 # // ...
30211 #
30212 # var protoToCssColor = function(rgb_color) {
30213 # var redFrac = rgb_color.red || 0.0;
30214 # var greenFrac = rgb_color.green || 0.0;
30215 # var blueFrac = rgb_color.blue || 0.0;
30216 # var red = Math.floor(redFrac * 255);
30217 # var green = Math.floor(greenFrac * 255);
30218 # var blue = Math.floor(blueFrac * 255);
30219 #
30220 # if (!('alpha' in rgb_color)) {
30221 # return rgbToCssColor_(red, green, blue);
30222 # }
30223 #
30224 # var alphaFrac = rgb_color.alpha.value || 0.0;
30225 # var rgbParams = [red, green, blue].join(',');
30226 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
30227 # };
30228 #
30229 # var rgbToCssColor_ = function(red, green, blue) {
30230 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
30231 # var hexString = rgbNumber.toString(16);
30232 # var missingZeros = 6 - hexString.length;
30233 # var resultBuilder = ['#'];
30234 # for (var i = 0; i < missingZeros; i++) {
30235 # resultBuilder.push('0');
30236 # }
30237 # resultBuilder.push(hexString);
30238 # return resultBuilder.join('');
30239 # };
30240 #
30241 # // ...
30242 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
30243 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
30244 # the final pixel color is defined by the equation:
30245 #
30246 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
30247 #
30248 # This means that a value of 1.0 corresponds to a solid color, whereas
30249 # a value of 0.0 corresponds to a completely transparent color. This
30250 # uses a wrapper message rather than a simple float scalar so that it is
30251 # possible to distinguish between a default value and the value being unset.
30252 # If omitted, this color object is to be rendered as a solid color
30253 # (as if the alpha value had been explicitly given with a value of 1.0).
30254 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
30255 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
30256 },
30257 "bold": True or False, # True if the text is bold.
30258 "strikethrough": True or False, # True if the text has a strikethrough.
30259 "fontFamily": "A String", # The font family.
30260 "fontSize": 42, # The size of the font.
30261 "italic": True or False, # True if the text is italicized.
30262 "underline": True or False, # True if the text is underlined.
30263 },
30264 "hyperlinkDisplayType": "A String", # How a hyperlink, if it exists, should be displayed in the cell.
30265 "borders": { # The borders of the cell. # The borders of the cell.
30266 "top": { # A border along a cell. # The top border of the cell.
30267 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
30268 # for simplicity of conversion to/from color representations in various
30269 # languages over compactness; for example, the fields of this representation
30270 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
30271 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
30272 # method in iOS; and, with just a little work, it can be easily formatted into
30273 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
30274 #
30275 # Example (Java):
30276 #
30277 # import com.google.type.Color;
30278 #
30279 # // ...
30280 # public static java.awt.Color fromProto(Color protocolor) {
30281 # float alpha = protocolor.hasAlpha()
30282 # ? protocolor.getAlpha().getValue()
30283 # : 1.0;
30284 #
30285 # return new java.awt.Color(
30286 # protocolor.getRed(),
30287 # protocolor.getGreen(),
30288 # protocolor.getBlue(),
30289 # alpha);
30290 # }
30291 #
30292 # public static Color toProto(java.awt.Color color) {
30293 # float red = (float) color.getRed();
30294 # float green = (float) color.getGreen();
30295 # float blue = (float) color.getBlue();
30296 # float denominator = 255.0;
30297 # Color.Builder resultBuilder =
30298 # Color
30299 # .newBuilder()
30300 # .setRed(red / denominator)
30301 # .setGreen(green / denominator)
30302 # .setBlue(blue / denominator);
30303 # int alpha = color.getAlpha();
30304 # if (alpha != 255) {
30305 # result.setAlpha(
30306 # FloatValue
30307 # .newBuilder()
30308 # .setValue(((float) alpha) / denominator)
30309 # .build());
30310 # }
30311 # return resultBuilder.build();
30312 # }
30313 # // ...
30314 #
30315 # Example (iOS / Obj-C):
30316 #
30317 # // ...
30318 # static UIColor* fromProto(Color* protocolor) {
30319 # float red = [protocolor red];
30320 # float green = [protocolor green];
30321 # float blue = [protocolor blue];
30322 # FloatValue* alpha_wrapper = [protocolor alpha];
30323 # float alpha = 1.0;
30324 # if (alpha_wrapper != nil) {
30325 # alpha = [alpha_wrapper value];
30326 # }
30327 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
30328 # }
30329 #
30330 # static Color* toProto(UIColor* color) {
30331 # CGFloat red, green, blue, alpha;
30332 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
30333 # return nil;
30334 # }
30335 # Color* result = [Color alloc] init];
30336 # [result setRed:red];
30337 # [result setGreen:green];
30338 # [result setBlue:blue];
30339 # if (alpha <= 0.9999) {
30340 # [result setAlpha:floatWrapperWithValue(alpha)];
30341 # }
30342 # [result autorelease];
30343 # return result;
30344 # }
30345 # // ...
30346 #
30347 # Example (JavaScript):
30348 #
30349 # // ...
30350 #
30351 # var protoToCssColor = function(rgb_color) {
30352 # var redFrac = rgb_color.red || 0.0;
30353 # var greenFrac = rgb_color.green || 0.0;
30354 # var blueFrac = rgb_color.blue || 0.0;
30355 # var red = Math.floor(redFrac * 255);
30356 # var green = Math.floor(greenFrac * 255);
30357 # var blue = Math.floor(blueFrac * 255);
30358 #
30359 # if (!('alpha' in rgb_color)) {
30360 # return rgbToCssColor_(red, green, blue);
30361 # }
30362 #
30363 # var alphaFrac = rgb_color.alpha.value || 0.0;
30364 # var rgbParams = [red, green, blue].join(',');
30365 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
30366 # };
30367 #
30368 # var rgbToCssColor_ = function(red, green, blue) {
30369 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
30370 # var hexString = rgbNumber.toString(16);
30371 # var missingZeros = 6 - hexString.length;
30372 # var resultBuilder = ['#'];
30373 # for (var i = 0; i < missingZeros; i++) {
30374 # resultBuilder.push('0');
30375 # }
30376 # resultBuilder.push(hexString);
30377 # return resultBuilder.join('');
30378 # };
30379 #
30380 # // ...
30381 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
30382 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
30383 # the final pixel color is defined by the equation:
30384 #
30385 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
30386 #
30387 # This means that a value of 1.0 corresponds to a solid color, whereas
30388 # a value of 0.0 corresponds to a completely transparent color. This
30389 # uses a wrapper message rather than a simple float scalar so that it is
30390 # possible to distinguish between a default value and the value being unset.
30391 # If omitted, this color object is to be rendered as a solid color
30392 # (as if the alpha value had been explicitly given with a value of 1.0).
30393 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
30394 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
30395 },
30396 "width": 42, # The width of the border, in pixels.
30397 # Border widths must be between 0 and 3 pixels.
30398 "style": "A String", # The style of the border.
30399 },
30400 "right": { # A border along a cell. # The right border of the cell.
30401 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
30402 # for simplicity of conversion to/from color representations in various
30403 # languages over compactness; for example, the fields of this representation
30404 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
30405 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
30406 # method in iOS; and, with just a little work, it can be easily formatted into
30407 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
30408 #
30409 # Example (Java):
30410 #
30411 # import com.google.type.Color;
30412 #
30413 # // ...
30414 # public static java.awt.Color fromProto(Color protocolor) {
30415 # float alpha = protocolor.hasAlpha()
30416 # ? protocolor.getAlpha().getValue()
30417 # : 1.0;
30418 #
30419 # return new java.awt.Color(
30420 # protocolor.getRed(),
30421 # protocolor.getGreen(),
30422 # protocolor.getBlue(),
30423 # alpha);
30424 # }
30425 #
30426 # public static Color toProto(java.awt.Color color) {
30427 # float red = (float) color.getRed();
30428 # float green = (float) color.getGreen();
30429 # float blue = (float) color.getBlue();
30430 # float denominator = 255.0;
30431 # Color.Builder resultBuilder =
30432 # Color
30433 # .newBuilder()
30434 # .setRed(red / denominator)
30435 # .setGreen(green / denominator)
30436 # .setBlue(blue / denominator);
30437 # int alpha = color.getAlpha();
30438 # if (alpha != 255) {
30439 # result.setAlpha(
30440 # FloatValue
30441 # .newBuilder()
30442 # .setValue(((float) alpha) / denominator)
30443 # .build());
30444 # }
30445 # return resultBuilder.build();
30446 # }
30447 # // ...
30448 #
30449 # Example (iOS / Obj-C):
30450 #
30451 # // ...
30452 # static UIColor* fromProto(Color* protocolor) {
30453 # float red = [protocolor red];
30454 # float green = [protocolor green];
30455 # float blue = [protocolor blue];
30456 # FloatValue* alpha_wrapper = [protocolor alpha];
30457 # float alpha = 1.0;
30458 # if (alpha_wrapper != nil) {
30459 # alpha = [alpha_wrapper value];
30460 # }
30461 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
30462 # }
30463 #
30464 # static Color* toProto(UIColor* color) {
30465 # CGFloat red, green, blue, alpha;
30466 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
30467 # return nil;
30468 # }
30469 # Color* result = [Color alloc] init];
30470 # [result setRed:red];
30471 # [result setGreen:green];
30472 # [result setBlue:blue];
30473 # if (alpha <= 0.9999) {
30474 # [result setAlpha:floatWrapperWithValue(alpha)];
30475 # }
30476 # [result autorelease];
30477 # return result;
30478 # }
30479 # // ...
30480 #
30481 # Example (JavaScript):
30482 #
30483 # // ...
30484 #
30485 # var protoToCssColor = function(rgb_color) {
30486 # var redFrac = rgb_color.red || 0.0;
30487 # var greenFrac = rgb_color.green || 0.0;
30488 # var blueFrac = rgb_color.blue || 0.0;
30489 # var red = Math.floor(redFrac * 255);
30490 # var green = Math.floor(greenFrac * 255);
30491 # var blue = Math.floor(blueFrac * 255);
30492 #
30493 # if (!('alpha' in rgb_color)) {
30494 # return rgbToCssColor_(red, green, blue);
30495 # }
30496 #
30497 # var alphaFrac = rgb_color.alpha.value || 0.0;
30498 # var rgbParams = [red, green, blue].join(',');
30499 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
30500 # };
30501 #
30502 # var rgbToCssColor_ = function(red, green, blue) {
30503 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
30504 # var hexString = rgbNumber.toString(16);
30505 # var missingZeros = 6 - hexString.length;
30506 # var resultBuilder = ['#'];
30507 # for (var i = 0; i < missingZeros; i++) {
30508 # resultBuilder.push('0');
30509 # }
30510 # resultBuilder.push(hexString);
30511 # return resultBuilder.join('');
30512 # };
30513 #
30514 # // ...
30515 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
30516 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
30517 # the final pixel color is defined by the equation:
30518 #
30519 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
30520 #
30521 # This means that a value of 1.0 corresponds to a solid color, whereas
30522 # a value of 0.0 corresponds to a completely transparent color. This
30523 # uses a wrapper message rather than a simple float scalar so that it is
30524 # possible to distinguish between a default value and the value being unset.
30525 # If omitted, this color object is to be rendered as a solid color
30526 # (as if the alpha value had been explicitly given with a value of 1.0).
30527 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
30528 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
30529 },
30530 "width": 42, # The width of the border, in pixels.
30531 # Border widths must be between 0 and 3 pixels.
30532 "style": "A String", # The style of the border.
30533 },
30534 "bottom": { # A border along a cell. # The bottom border of the cell.
30535 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
30536 # for simplicity of conversion to/from color representations in various
30537 # languages over compactness; for example, the fields of this representation
30538 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
30539 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
30540 # method in iOS; and, with just a little work, it can be easily formatted into
30541 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
30542 #
30543 # Example (Java):
30544 #
30545 # import com.google.type.Color;
30546 #
30547 # // ...
30548 # public static java.awt.Color fromProto(Color protocolor) {
30549 # float alpha = protocolor.hasAlpha()
30550 # ? protocolor.getAlpha().getValue()
30551 # : 1.0;
30552 #
30553 # return new java.awt.Color(
30554 # protocolor.getRed(),
30555 # protocolor.getGreen(),
30556 # protocolor.getBlue(),
30557 # alpha);
30558 # }
30559 #
30560 # public static Color toProto(java.awt.Color color) {
30561 # float red = (float) color.getRed();
30562 # float green = (float) color.getGreen();
30563 # float blue = (float) color.getBlue();
30564 # float denominator = 255.0;
30565 # Color.Builder resultBuilder =
30566 # Color
30567 # .newBuilder()
30568 # .setRed(red / denominator)
30569 # .setGreen(green / denominator)
30570 # .setBlue(blue / denominator);
30571 # int alpha = color.getAlpha();
30572 # if (alpha != 255) {
30573 # result.setAlpha(
30574 # FloatValue
30575 # .newBuilder()
30576 # .setValue(((float) alpha) / denominator)
30577 # .build());
30578 # }
30579 # return resultBuilder.build();
30580 # }
30581 # // ...
30582 #
30583 # Example (iOS / Obj-C):
30584 #
30585 # // ...
30586 # static UIColor* fromProto(Color* protocolor) {
30587 # float red = [protocolor red];
30588 # float green = [protocolor green];
30589 # float blue = [protocolor blue];
30590 # FloatValue* alpha_wrapper = [protocolor alpha];
30591 # float alpha = 1.0;
30592 # if (alpha_wrapper != nil) {
30593 # alpha = [alpha_wrapper value];
30594 # }
30595 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
30596 # }
30597 #
30598 # static Color* toProto(UIColor* color) {
30599 # CGFloat red, green, blue, alpha;
30600 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
30601 # return nil;
30602 # }
30603 # Color* result = [Color alloc] init];
30604 # [result setRed:red];
30605 # [result setGreen:green];
30606 # [result setBlue:blue];
30607 # if (alpha <= 0.9999) {
30608 # [result setAlpha:floatWrapperWithValue(alpha)];
30609 # }
30610 # [result autorelease];
30611 # return result;
30612 # }
30613 # // ...
30614 #
30615 # Example (JavaScript):
30616 #
30617 # // ...
30618 #
30619 # var protoToCssColor = function(rgb_color) {
30620 # var redFrac = rgb_color.red || 0.0;
30621 # var greenFrac = rgb_color.green || 0.0;
30622 # var blueFrac = rgb_color.blue || 0.0;
30623 # var red = Math.floor(redFrac * 255);
30624 # var green = Math.floor(greenFrac * 255);
30625 # var blue = Math.floor(blueFrac * 255);
30626 #
30627 # if (!('alpha' in rgb_color)) {
30628 # return rgbToCssColor_(red, green, blue);
30629 # }
30630 #
30631 # var alphaFrac = rgb_color.alpha.value || 0.0;
30632 # var rgbParams = [red, green, blue].join(',');
30633 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
30634 # };
30635 #
30636 # var rgbToCssColor_ = function(red, green, blue) {
30637 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
30638 # var hexString = rgbNumber.toString(16);
30639 # var missingZeros = 6 - hexString.length;
30640 # var resultBuilder = ['#'];
30641 # for (var i = 0; i < missingZeros; i++) {
30642 # resultBuilder.push('0');
30643 # }
30644 # resultBuilder.push(hexString);
30645 # return resultBuilder.join('');
30646 # };
30647 #
30648 # // ...
30649 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
30650 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
30651 # the final pixel color is defined by the equation:
30652 #
30653 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
30654 #
30655 # This means that a value of 1.0 corresponds to a solid color, whereas
30656 # a value of 0.0 corresponds to a completely transparent color. This
30657 # uses a wrapper message rather than a simple float scalar so that it is
30658 # possible to distinguish between a default value and the value being unset.
30659 # If omitted, this color object is to be rendered as a solid color
30660 # (as if the alpha value had been explicitly given with a value of 1.0).
30661 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
30662 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
30663 },
30664 "width": 42, # The width of the border, in pixels.
30665 # Border widths must be between 0 and 3 pixels.
30666 "style": "A String", # The style of the border.
30667 },
30668 "left": { # A border along a cell. # The left border of the cell.
30669 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
30670 # for simplicity of conversion to/from color representations in various
30671 # languages over compactness; for example, the fields of this representation
30672 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
30673 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
30674 # method in iOS; and, with just a little work, it can be easily formatted into
30675 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
30676 #
30677 # Example (Java):
30678 #
30679 # import com.google.type.Color;
30680 #
30681 # // ...
30682 # public static java.awt.Color fromProto(Color protocolor) {
30683 # float alpha = protocolor.hasAlpha()
30684 # ? protocolor.getAlpha().getValue()
30685 # : 1.0;
30686 #
30687 # return new java.awt.Color(
30688 # protocolor.getRed(),
30689 # protocolor.getGreen(),
30690 # protocolor.getBlue(),
30691 # alpha);
30692 # }
30693 #
30694 # public static Color toProto(java.awt.Color color) {
30695 # float red = (float) color.getRed();
30696 # float green = (float) color.getGreen();
30697 # float blue = (float) color.getBlue();
30698 # float denominator = 255.0;
30699 # Color.Builder resultBuilder =
30700 # Color
30701 # .newBuilder()
30702 # .setRed(red / denominator)
30703 # .setGreen(green / denominator)
30704 # .setBlue(blue / denominator);
30705 # int alpha = color.getAlpha();
30706 # if (alpha != 255) {
30707 # result.setAlpha(
30708 # FloatValue
30709 # .newBuilder()
30710 # .setValue(((float) alpha) / denominator)
30711 # .build());
30712 # }
30713 # return resultBuilder.build();
30714 # }
30715 # // ...
30716 #
30717 # Example (iOS / Obj-C):
30718 #
30719 # // ...
30720 # static UIColor* fromProto(Color* protocolor) {
30721 # float red = [protocolor red];
30722 # float green = [protocolor green];
30723 # float blue = [protocolor blue];
30724 # FloatValue* alpha_wrapper = [protocolor alpha];
30725 # float alpha = 1.0;
30726 # if (alpha_wrapper != nil) {
30727 # alpha = [alpha_wrapper value];
30728 # }
30729 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
30730 # }
30731 #
30732 # static Color* toProto(UIColor* color) {
30733 # CGFloat red, green, blue, alpha;
30734 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
30735 # return nil;
30736 # }
30737 # Color* result = [Color alloc] init];
30738 # [result setRed:red];
30739 # [result setGreen:green];
30740 # [result setBlue:blue];
30741 # if (alpha <= 0.9999) {
30742 # [result setAlpha:floatWrapperWithValue(alpha)];
30743 # }
30744 # [result autorelease];
30745 # return result;
30746 # }
30747 # // ...
30748 #
30749 # Example (JavaScript):
30750 #
30751 # // ...
30752 #
30753 # var protoToCssColor = function(rgb_color) {
30754 # var redFrac = rgb_color.red || 0.0;
30755 # var greenFrac = rgb_color.green || 0.0;
30756 # var blueFrac = rgb_color.blue || 0.0;
30757 # var red = Math.floor(redFrac * 255);
30758 # var green = Math.floor(greenFrac * 255);
30759 # var blue = Math.floor(blueFrac * 255);
30760 #
30761 # if (!('alpha' in rgb_color)) {
30762 # return rgbToCssColor_(red, green, blue);
30763 # }
30764 #
30765 # var alphaFrac = rgb_color.alpha.value || 0.0;
30766 # var rgbParams = [red, green, blue].join(',');
30767 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
30768 # };
30769 #
30770 # var rgbToCssColor_ = function(red, green, blue) {
30771 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
30772 # var hexString = rgbNumber.toString(16);
30773 # var missingZeros = 6 - hexString.length;
30774 # var resultBuilder = ['#'];
30775 # for (var i = 0; i < missingZeros; i++) {
30776 # resultBuilder.push('0');
30777 # }
30778 # resultBuilder.push(hexString);
30779 # return resultBuilder.join('');
30780 # };
30781 #
30782 # // ...
30783 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
30784 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
30785 # the final pixel color is defined by the equation:
30786 #
30787 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
30788 #
30789 # This means that a value of 1.0 corresponds to a solid color, whereas
30790 # a value of 0.0 corresponds to a completely transparent color. This
30791 # uses a wrapper message rather than a simple float scalar so that it is
30792 # possible to distinguish between a default value and the value being unset.
30793 # If omitted, this color object is to be rendered as a solid color
30794 # (as if the alpha value had been explicitly given with a value of 1.0).
30795 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
30796 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
30797 },
30798 "width": 42, # The width of the border, in pixels.
30799 # Border widths must be between 0 and 3 pixels.
30800 "style": "A String", # The style of the border.
30801 },
30802 },
30803 "wrapStrategy": "A String", # The wrap strategy for the value in the cell.
30804 },
30805 },
30806 "gradientRule": { # A rule that applies a gradient color scale format, based on # The formatting will vary based on the gradients in the rule.
30807 # the interpolation points listed. The format of a cell will vary
30808 # based on its contents as compared to the values of the interpolation
30809 # points.
30810 "maxpoint": { # A single interpolation point a gradient conditional format. # The final interpolation point.
30811 # These pin the gradient color scale according to the color,
30812 # type and value chosen.
30813 "color": { # Represents a color in the RGBA color space. This representation is designed # The color this interpolation point should use.
30814 # for simplicity of conversion to/from color representations in various
30815 # languages over compactness; for example, the fields of this representation
30816 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
30817 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
30818 # method in iOS; and, with just a little work, it can be easily formatted into
30819 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
30820 #
30821 # Example (Java):
30822 #
30823 # import com.google.type.Color;
30824 #
30825 # // ...
30826 # public static java.awt.Color fromProto(Color protocolor) {
30827 # float alpha = protocolor.hasAlpha()
30828 # ? protocolor.getAlpha().getValue()
30829 # : 1.0;
30830 #
30831 # return new java.awt.Color(
30832 # protocolor.getRed(),
30833 # protocolor.getGreen(),
30834 # protocolor.getBlue(),
30835 # alpha);
30836 # }
30837 #
30838 # public static Color toProto(java.awt.Color color) {
30839 # float red = (float) color.getRed();
30840 # float green = (float) color.getGreen();
30841 # float blue = (float) color.getBlue();
30842 # float denominator = 255.0;
30843 # Color.Builder resultBuilder =
30844 # Color
30845 # .newBuilder()
30846 # .setRed(red / denominator)
30847 # .setGreen(green / denominator)
30848 # .setBlue(blue / denominator);
30849 # int alpha = color.getAlpha();
30850 # if (alpha != 255) {
30851 # result.setAlpha(
30852 # FloatValue
30853 # .newBuilder()
30854 # .setValue(((float) alpha) / denominator)
30855 # .build());
30856 # }
30857 # return resultBuilder.build();
30858 # }
30859 # // ...
30860 #
30861 # Example (iOS / Obj-C):
30862 #
30863 # // ...
30864 # static UIColor* fromProto(Color* protocolor) {
30865 # float red = [protocolor red];
30866 # float green = [protocolor green];
30867 # float blue = [protocolor blue];
30868 # FloatValue* alpha_wrapper = [protocolor alpha];
30869 # float alpha = 1.0;
30870 # if (alpha_wrapper != nil) {
30871 # alpha = [alpha_wrapper value];
30872 # }
30873 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
30874 # }
30875 #
30876 # static Color* toProto(UIColor* color) {
30877 # CGFloat red, green, blue, alpha;
30878 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
30879 # return nil;
30880 # }
30881 # Color* result = [Color alloc] init];
30882 # [result setRed:red];
30883 # [result setGreen:green];
30884 # [result setBlue:blue];
30885 # if (alpha <= 0.9999) {
30886 # [result setAlpha:floatWrapperWithValue(alpha)];
30887 # }
30888 # [result autorelease];
30889 # return result;
30890 # }
30891 # // ...
30892 #
30893 # Example (JavaScript):
30894 #
30895 # // ...
30896 #
30897 # var protoToCssColor = function(rgb_color) {
30898 # var redFrac = rgb_color.red || 0.0;
30899 # var greenFrac = rgb_color.green || 0.0;
30900 # var blueFrac = rgb_color.blue || 0.0;
30901 # var red = Math.floor(redFrac * 255);
30902 # var green = Math.floor(greenFrac * 255);
30903 # var blue = Math.floor(blueFrac * 255);
30904 #
30905 # if (!('alpha' in rgb_color)) {
30906 # return rgbToCssColor_(red, green, blue);
30907 # }
30908 #
30909 # var alphaFrac = rgb_color.alpha.value || 0.0;
30910 # var rgbParams = [red, green, blue].join(',');
30911 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
30912 # };
30913 #
30914 # var rgbToCssColor_ = function(red, green, blue) {
30915 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
30916 # var hexString = rgbNumber.toString(16);
30917 # var missingZeros = 6 - hexString.length;
30918 # var resultBuilder = ['#'];
30919 # for (var i = 0; i < missingZeros; i++) {
30920 # resultBuilder.push('0');
30921 # }
30922 # resultBuilder.push(hexString);
30923 # return resultBuilder.join('');
30924 # };
30925 #
30926 # // ...
30927 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
30928 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
30929 # the final pixel color is defined by the equation:
30930 #
30931 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
30932 #
30933 # This means that a value of 1.0 corresponds to a solid color, whereas
30934 # a value of 0.0 corresponds to a completely transparent color. This
30935 # uses a wrapper message rather than a simple float scalar so that it is
30936 # possible to distinguish between a default value and the value being unset.
30937 # If omitted, this color object is to be rendered as a solid color
30938 # (as if the alpha value had been explicitly given with a value of 1.0).
30939 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
30940 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
30941 },
30942 "type": "A String", # How the value should be interpreted.
30943 "value": "A String", # The value this interpolation point uses. May be a formula.
30944 # Unused if type is MIN or
30945 # MAX.
30946 },
30947 "midpoint": { # A single interpolation point a gradient conditional format. # An optional midway interpolation point.
30948 # These pin the gradient color scale according to the color,
30949 # type and value chosen.
30950 "color": { # Represents a color in the RGBA color space. This representation is designed # The color this interpolation point should use.
30951 # for simplicity of conversion to/from color representations in various
30952 # languages over compactness; for example, the fields of this representation
30953 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
30954 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
30955 # method in iOS; and, with just a little work, it can be easily formatted into
30956 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
30957 #
30958 # Example (Java):
30959 #
30960 # import com.google.type.Color;
30961 #
30962 # // ...
30963 # public static java.awt.Color fromProto(Color protocolor) {
30964 # float alpha = protocolor.hasAlpha()
30965 # ? protocolor.getAlpha().getValue()
30966 # : 1.0;
30967 #
30968 # return new java.awt.Color(
30969 # protocolor.getRed(),
30970 # protocolor.getGreen(),
30971 # protocolor.getBlue(),
30972 # alpha);
30973 # }
30974 #
30975 # public static Color toProto(java.awt.Color color) {
30976 # float red = (float) color.getRed();
30977 # float green = (float) color.getGreen();
30978 # float blue = (float) color.getBlue();
30979 # float denominator = 255.0;
30980 # Color.Builder resultBuilder =
30981 # Color
30982 # .newBuilder()
30983 # .setRed(red / denominator)
30984 # .setGreen(green / denominator)
30985 # .setBlue(blue / denominator);
30986 # int alpha = color.getAlpha();
30987 # if (alpha != 255) {
30988 # result.setAlpha(
30989 # FloatValue
30990 # .newBuilder()
30991 # .setValue(((float) alpha) / denominator)
30992 # .build());
30993 # }
30994 # return resultBuilder.build();
30995 # }
30996 # // ...
30997 #
30998 # Example (iOS / Obj-C):
30999 #
31000 # // ...
31001 # static UIColor* fromProto(Color* protocolor) {
31002 # float red = [protocolor red];
31003 # float green = [protocolor green];
31004 # float blue = [protocolor blue];
31005 # FloatValue* alpha_wrapper = [protocolor alpha];
31006 # float alpha = 1.0;
31007 # if (alpha_wrapper != nil) {
31008 # alpha = [alpha_wrapper value];
31009 # }
31010 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
31011 # }
31012 #
31013 # static Color* toProto(UIColor* color) {
31014 # CGFloat red, green, blue, alpha;
31015 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
31016 # return nil;
31017 # }
31018 # Color* result = [Color alloc] init];
31019 # [result setRed:red];
31020 # [result setGreen:green];
31021 # [result setBlue:blue];
31022 # if (alpha <= 0.9999) {
31023 # [result setAlpha:floatWrapperWithValue(alpha)];
31024 # }
31025 # [result autorelease];
31026 # return result;
31027 # }
31028 # // ...
31029 #
31030 # Example (JavaScript):
31031 #
31032 # // ...
31033 #
31034 # var protoToCssColor = function(rgb_color) {
31035 # var redFrac = rgb_color.red || 0.0;
31036 # var greenFrac = rgb_color.green || 0.0;
31037 # var blueFrac = rgb_color.blue || 0.0;
31038 # var red = Math.floor(redFrac * 255);
31039 # var green = Math.floor(greenFrac * 255);
31040 # var blue = Math.floor(blueFrac * 255);
31041 #
31042 # if (!('alpha' in rgb_color)) {
31043 # return rgbToCssColor_(red, green, blue);
31044 # }
31045 #
31046 # var alphaFrac = rgb_color.alpha.value || 0.0;
31047 # var rgbParams = [red, green, blue].join(',');
31048 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
31049 # };
31050 #
31051 # var rgbToCssColor_ = function(red, green, blue) {
31052 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
31053 # var hexString = rgbNumber.toString(16);
31054 # var missingZeros = 6 - hexString.length;
31055 # var resultBuilder = ['#'];
31056 # for (var i = 0; i < missingZeros; i++) {
31057 # resultBuilder.push('0');
31058 # }
31059 # resultBuilder.push(hexString);
31060 # return resultBuilder.join('');
31061 # };
31062 #
31063 # // ...
31064 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
31065 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
31066 # the final pixel color is defined by the equation:
31067 #
31068 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
31069 #
31070 # This means that a value of 1.0 corresponds to a solid color, whereas
31071 # a value of 0.0 corresponds to a completely transparent color. This
31072 # uses a wrapper message rather than a simple float scalar so that it is
31073 # possible to distinguish between a default value and the value being unset.
31074 # If omitted, this color object is to be rendered as a solid color
31075 # (as if the alpha value had been explicitly given with a value of 1.0).
31076 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
31077 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
31078 },
31079 "type": "A String", # How the value should be interpreted.
31080 "value": "A String", # The value this interpolation point uses. May be a formula.
31081 # Unused if type is MIN or
31082 # MAX.
31083 },
31084 "minpoint": { # A single interpolation point a gradient conditional format. # The starting interpolation point.
31085 # These pin the gradient color scale according to the color,
31086 # type and value chosen.
31087 "color": { # Represents a color in the RGBA color space. This representation is designed # The color this interpolation point should use.
31088 # for simplicity of conversion to/from color representations in various
31089 # languages over compactness; for example, the fields of this representation
31090 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
31091 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
31092 # method in iOS; and, with just a little work, it can be easily formatted into
31093 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
31094 #
31095 # Example (Java):
31096 #
31097 # import com.google.type.Color;
31098 #
31099 # // ...
31100 # public static java.awt.Color fromProto(Color protocolor) {
31101 # float alpha = protocolor.hasAlpha()
31102 # ? protocolor.getAlpha().getValue()
31103 # : 1.0;
31104 #
31105 # return new java.awt.Color(
31106 # protocolor.getRed(),
31107 # protocolor.getGreen(),
31108 # protocolor.getBlue(),
31109 # alpha);
31110 # }
31111 #
31112 # public static Color toProto(java.awt.Color color) {
31113 # float red = (float) color.getRed();
31114 # float green = (float) color.getGreen();
31115 # float blue = (float) color.getBlue();
31116 # float denominator = 255.0;
31117 # Color.Builder resultBuilder =
31118 # Color
31119 # .newBuilder()
31120 # .setRed(red / denominator)
31121 # .setGreen(green / denominator)
31122 # .setBlue(blue / denominator);
31123 # int alpha = color.getAlpha();
31124 # if (alpha != 255) {
31125 # result.setAlpha(
31126 # FloatValue
31127 # .newBuilder()
31128 # .setValue(((float) alpha) / denominator)
31129 # .build());
31130 # }
31131 # return resultBuilder.build();
31132 # }
31133 # // ...
31134 #
31135 # Example (iOS / Obj-C):
31136 #
31137 # // ...
31138 # static UIColor* fromProto(Color* protocolor) {
31139 # float red = [protocolor red];
31140 # float green = [protocolor green];
31141 # float blue = [protocolor blue];
31142 # FloatValue* alpha_wrapper = [protocolor alpha];
31143 # float alpha = 1.0;
31144 # if (alpha_wrapper != nil) {
31145 # alpha = [alpha_wrapper value];
31146 # }
31147 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
31148 # }
31149 #
31150 # static Color* toProto(UIColor* color) {
31151 # CGFloat red, green, blue, alpha;
31152 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
31153 # return nil;
31154 # }
31155 # Color* result = [Color alloc] init];
31156 # [result setRed:red];
31157 # [result setGreen:green];
31158 # [result setBlue:blue];
31159 # if (alpha <= 0.9999) {
31160 # [result setAlpha:floatWrapperWithValue(alpha)];
31161 # }
31162 # [result autorelease];
31163 # return result;
31164 # }
31165 # // ...
31166 #
31167 # Example (JavaScript):
31168 #
31169 # // ...
31170 #
31171 # var protoToCssColor = function(rgb_color) {
31172 # var redFrac = rgb_color.red || 0.0;
31173 # var greenFrac = rgb_color.green || 0.0;
31174 # var blueFrac = rgb_color.blue || 0.0;
31175 # var red = Math.floor(redFrac * 255);
31176 # var green = Math.floor(greenFrac * 255);
31177 # var blue = Math.floor(blueFrac * 255);
31178 #
31179 # if (!('alpha' in rgb_color)) {
31180 # return rgbToCssColor_(red, green, blue);
31181 # }
31182 #
31183 # var alphaFrac = rgb_color.alpha.value || 0.0;
31184 # var rgbParams = [red, green, blue].join(',');
31185 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
31186 # };
31187 #
31188 # var rgbToCssColor_ = function(red, green, blue) {
31189 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
31190 # var hexString = rgbNumber.toString(16);
31191 # var missingZeros = 6 - hexString.length;
31192 # var resultBuilder = ['#'];
31193 # for (var i = 0; i < missingZeros; i++) {
31194 # resultBuilder.push('0');
31195 # }
31196 # resultBuilder.push(hexString);
31197 # return resultBuilder.join('');
31198 # };
31199 #
31200 # // ...
31201 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
31202 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
31203 # the final pixel color is defined by the equation:
31204 #
31205 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
31206 #
31207 # This means that a value of 1.0 corresponds to a solid color, whereas
31208 # a value of 0.0 corresponds to a completely transparent color. This
31209 # uses a wrapper message rather than a simple float scalar so that it is
31210 # possible to distinguish between a default value and the value being unset.
31211 # If omitted, this color object is to be rendered as a solid color
31212 # (as if the alpha value had been explicitly given with a value of 1.0).
31213 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
31214 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
31215 },
31216 "type": "A String", # How the value should be interpreted.
31217 "value": "A String", # The value this interpolation point uses. May be a formula.
31218 # Unused if type is MIN or
31219 # MAX.
31220 },
31221 },
31222 },
31223 ],
31224 "merges": [ # The ranges that are merged together.
31225 { # A range on a sheet.
31226 # All indexes are zero-based.
31227 # Indexes are half open, e.g the start index is inclusive
31228 # and the end index is exclusive -- [start_index, end_index).
31229 # Missing indexes indicate the range is unbounded on that side.
31230 #
31231 # For example, if "Sheet1" is grid ID 0, then:
31232 #
31233 # Sheet1!A1:A1 == sheet_id: 0,
31234 # start_row_index: 0, end_row_index: 1,
31235 # start_column_index: 0, end_column_index: 1
31236 #
31237 # Sheet1!A3:B4 == sheet_id: 0,
31238 # start_row_index: 2, end_row_index: 4,
31239 # start_column_index: 0, end_column_index: 2
31240 #
31241 # Sheet1!A:B == sheet_id: 0,
31242 # start_column_index: 0, end_column_index: 2
31243 #
31244 # Sheet1!A5:B == sheet_id: 0,
31245 # start_row_index: 4,
31246 # start_column_index: 0, end_column_index: 2
31247 #
31248 # Sheet1 == sheet_id:0
31249 #
31250 # The start index must always be less than or equal to the end index.
31251 # If the start index equals the end index, then the range is empty.
31252 # Empty ranges are typically not meaningful and are usually rendered in the
31253 # UI as `#REF!`.
31254 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
31255 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
31256 "sheetId": 42, # The sheet this range is on.
31257 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
31258 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
31259 },
31260 ],
31261 "basicFilter": { # The default filter associated with a sheet. # The filter on this sheet, if any.
31262 "range": { # A range on a sheet. # The range the filter covers.
31263 # All indexes are zero-based.
31264 # Indexes are half open, e.g the start index is inclusive
31265 # and the end index is exclusive -- [start_index, end_index).
31266 # Missing indexes indicate the range is unbounded on that side.
31267 #
31268 # For example, if "Sheet1" is grid ID 0, then:
31269 #
31270 # Sheet1!A1:A1 == sheet_id: 0,
31271 # start_row_index: 0, end_row_index: 1,
31272 # start_column_index: 0, end_column_index: 1
31273 #
31274 # Sheet1!A3:B4 == sheet_id: 0,
31275 # start_row_index: 2, end_row_index: 4,
31276 # start_column_index: 0, end_column_index: 2
31277 #
31278 # Sheet1!A:B == sheet_id: 0,
31279 # start_column_index: 0, end_column_index: 2
31280 #
31281 # Sheet1!A5:B == sheet_id: 0,
31282 # start_row_index: 4,
31283 # start_column_index: 0, end_column_index: 2
31284 #
31285 # Sheet1 == sheet_id:0
31286 #
31287 # The start index must always be less than or equal to the end index.
31288 # If the start index equals the end index, then the range is empty.
31289 # Empty ranges are typically not meaningful and are usually rendered in the
31290 # UI as `#REF!`.
31291 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
31292 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
31293 "sheetId": 42, # The sheet this range is on.
31294 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
31295 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
31296 },
31297 "sortSpecs": [ # The sort order per column. Later specifications are used when values
31298 # are equal in the earlier specifications.
31299 { # A sort order associated with a specific column or row.
31300 "sortOrder": "A String", # The order data should be sorted.
31301 "dimensionIndex": 42, # The dimension the sort should be applied to.
31302 },
31303 ],
31304 "criteria": { # The criteria for showing/hiding values per column.
31305 # The map's key is the column index, and the value is the criteria for
31306 # that column.
31307 "a_key": { # Criteria for showing/hiding rows in a filter, filter view.
31308 "hiddenValues": [ # Values that should be hidden.
31309 "A String",
31310 ],
31311 "condition": { # A condition that can evaluate to true or false. # A condition that must be true for values to be shown.
31312 # (This does not override hiddenValues -- if a value is listed there,
31313 # it will still be hidden.)
31314 # BooleanConditions are used by conditional formatting,
31315 # data validation, and the criteria in filters.
31316 "type": "A String", # The type of condition.
31317 "values": [ # The values of the condition. The number of supported values depends
31318 # on the condition type. Some support zero values,
31319 # others one or two values,
31320 # and ConditionType.ONE_OF_LIST supports an arbitrary number of values.
31321 { # The value of the condition.
31322 "relativeDate": "A String", # A relative date (based on the current date).
31323 # Valid only if the type is
31324 # DATE_BEFORE,
31325 # DATE_AFTER,
31326 # DATE_ON_OR_BEFORE or
31327 # DATE_ON_OR_AFTER.
31328 #
31329 # Relative dates are not supported in data validation.
31330 # They are supported only in conditional formatting and
31331 # conditional filters.
31332 "userEnteredValue": "A String", # A value the condition is based on.
31333 # The value will be parsed as if the user typed into a cell.
31334 # Formulas are supported (and must begin with an `=`).
31335 },
31336 ],
31337 },
31338 },
31339 },
31340 },
31341 "charts": [ # The specifications of every chart on this sheet.
31342 { # A chart embedded in a sheet.
31343 "chartId": 42, # The ID of the chart.
31344 "position": { # The position of an embedded object such as a chart. # The position of the chart.
31345 "newSheet": True or False, # If true, the embedded object will be put on a new sheet whose ID
31346 # is chosen for you. Used only when writing.
31347 "sheetId": 42, # The sheet this is on. Set only if the embedded object
31348 # is on its own sheet. Must be non-negative.
31349 "overlayPosition": { # The location an object is overlaid on top of a grid. # The position the object is overlaid on top of a grid.
31350 "anchorCell": { # A coordinate in a sheet. # The cell the object is anchored to.
31351 # All indexes are zero-based.
31352 "rowIndex": 42, # The row index of the coordinate.
31353 "columnIndex": 42, # The column index of the coordinate.
31354 "sheetId": 42, # The sheet this coordinate is on.
31355 },
31356 "offsetYPixels": 42, # The vertical offset, in pixels, that the object is offset
31357 # from the anchor cell.
31358 "widthPixels": 42, # The width of the object, in pixels. Defaults to 600.
31359 "offsetXPixels": 42, # The horizontal offset, in pixels, that the object is offset
31360 # from the anchor cell.
31361 "heightPixels": 42, # The height of the object, in pixels. Defaults to 371.
31362 },
31363 },
31364 "spec": { # The specifications of a chart. # The specification of the chart.
31365 "hiddenDimensionStrategy": "A String", # Determines how the charts will use hidden rows or columns.
31366 # This value is only meaningful if the
31367 # ChartData.sourceRange
31368 # is used for a domain or series.
31369 "pieChart": { # A <a href="/chart/interactive/docs/gallery/piechart">pie chart</a>. # A pie chart specification.
31370 "series": { # The data included in a domain or series. # The data that covers the one and only series of the pie chart.
31371 "sourceRange": { # Source ranges for a chart. # The source ranges of the data.
31372 "sources": [ # The ranges of data for a series or domain.
31373 # Exactly one dimension must have a length of 1,
31374 # and all sources in the list must have the same dimension
31375 # with length 1.
31376 # The domain (if it exists) & all series must have the same number
31377 # of source ranges. If using more than one source range, then the source
31378 # range at a given offset must be contiguous across the domain and series.
31379 #
31380 # For example, these are valid configurations:
31381 #
31382 # domain sources: A1:A5
31383 # series1 sources: B1:B5
31384 # series2 sources: D6:D10
31385 #
31386 # domain sources: A1:A5, C10:C12
31387 # series1 sources: B1:B5, D10:D12
31388 # series2 sources: C1:C5, E10:E12
31389 { # A range on a sheet.
31390 # All indexes are zero-based.
31391 # Indexes are half open, e.g the start index is inclusive
31392 # and the end index is exclusive -- [start_index, end_index).
31393 # Missing indexes indicate the range is unbounded on that side.
31394 #
31395 # For example, if "Sheet1" is grid ID 0, then:
31396 #
31397 # Sheet1!A1:A1 == sheet_id: 0,
31398 # start_row_index: 0, end_row_index: 1,
31399 # start_column_index: 0, end_column_index: 1
31400 #
31401 # Sheet1!A3:B4 == sheet_id: 0,
31402 # start_row_index: 2, end_row_index: 4,
31403 # start_column_index: 0, end_column_index: 2
31404 #
31405 # Sheet1!A:B == sheet_id: 0,
31406 # start_column_index: 0, end_column_index: 2
31407 #
31408 # Sheet1!A5:B == sheet_id: 0,
31409 # start_row_index: 4,
31410 # start_column_index: 0, end_column_index: 2
31411 #
31412 # Sheet1 == sheet_id:0
31413 #
31414 # The start index must always be less than or equal to the end index.
31415 # If the start index equals the end index, then the range is empty.
31416 # Empty ranges are typically not meaningful and are usually rendered in the
31417 # UI as `#REF!`.
31418 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
31419 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
31420 "sheetId": 42, # The sheet this range is on.
31421 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
31422 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
31423 },
31424 ],
31425 },
31426 },
31427 "domain": { # The data included in a domain or series. # The data that covers the domain of the pie chart.
31428 "sourceRange": { # Source ranges for a chart. # The source ranges of the data.
31429 "sources": [ # The ranges of data for a series or domain.
31430 # Exactly one dimension must have a length of 1,
31431 # and all sources in the list must have the same dimension
31432 # with length 1.
31433 # The domain (if it exists) & all series must have the same number
31434 # of source ranges. If using more than one source range, then the source
31435 # range at a given offset must be contiguous across the domain and series.
31436 #
31437 # For example, these are valid configurations:
31438 #
31439 # domain sources: A1:A5
31440 # series1 sources: B1:B5
31441 # series2 sources: D6:D10
31442 #
31443 # domain sources: A1:A5, C10:C12
31444 # series1 sources: B1:B5, D10:D12
31445 # series2 sources: C1:C5, E10:E12
31446 { # A range on a sheet.
31447 # All indexes are zero-based.
31448 # Indexes are half open, e.g the start index is inclusive
31449 # and the end index is exclusive -- [start_index, end_index).
31450 # Missing indexes indicate the range is unbounded on that side.
31451 #
31452 # For example, if "Sheet1" is grid ID 0, then:
31453 #
31454 # Sheet1!A1:A1 == sheet_id: 0,
31455 # start_row_index: 0, end_row_index: 1,
31456 # start_column_index: 0, end_column_index: 1
31457 #
31458 # Sheet1!A3:B4 == sheet_id: 0,
31459 # start_row_index: 2, end_row_index: 4,
31460 # start_column_index: 0, end_column_index: 2
31461 #
31462 # Sheet1!A:B == sheet_id: 0,
31463 # start_column_index: 0, end_column_index: 2
31464 #
31465 # Sheet1!A5:B == sheet_id: 0,
31466 # start_row_index: 4,
31467 # start_column_index: 0, end_column_index: 2
31468 #
31469 # Sheet1 == sheet_id:0
31470 #
31471 # The start index must always be less than or equal to the end index.
31472 # If the start index equals the end index, then the range is empty.
31473 # Empty ranges are typically not meaningful and are usually rendered in the
31474 # UI as `#REF!`.
31475 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
31476 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
31477 "sheetId": 42, # The sheet this range is on.
31478 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
31479 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
31480 },
31481 ],
31482 },
31483 },
31484 "threeDimensional": True or False, # True if the pie is three dimensional.
31485 "legendPosition": "A String", # Where the legend of the pie chart should be drawn.
31486 "pieHole": 3.14, # The size of the hole in the pie chart.
31487 },
31488 "basicChart": { # The specification for a basic chart. See BasicChartType for the list # A basic chart specification, can be one of many kinds of charts.
31489 # See BasicChartType for the list of all charts this supports.
31490 # of charts this supports.
31491 "headerCount": 42, # The number of rows or columns in the data that are "headers".
31492 # If not set, Google Sheets will guess how many rows are headers based
31493 # on the data.
31494 #
31495 # (Note that BasicChartAxis.title may override the axis title
31496 # inferred from the header values.)
31497 "series": [ # The data this chart is visualizing.
31498 { # A single series of data in a chart.
31499 # For example, if charting stock prices over time, multiple series may exist,
31500 # one for the "Open Price", "High Price", "Low Price" and "Close Price".
31501 "series": { # The data included in a domain or series. # The data being visualized in this chart series.
31502 "sourceRange": { # Source ranges for a chart. # The source ranges of the data.
31503 "sources": [ # The ranges of data for a series or domain.
31504 # Exactly one dimension must have a length of 1,
31505 # and all sources in the list must have the same dimension
31506 # with length 1.
31507 # The domain (if it exists) & all series must have the same number
31508 # of source ranges. If using more than one source range, then the source
31509 # range at a given offset must be contiguous across the domain and series.
31510 #
31511 # For example, these are valid configurations:
31512 #
31513 # domain sources: A1:A5
31514 # series1 sources: B1:B5
31515 # series2 sources: D6:D10
31516 #
31517 # domain sources: A1:A5, C10:C12
31518 # series1 sources: B1:B5, D10:D12
31519 # series2 sources: C1:C5, E10:E12
31520 { # A range on a sheet.
31521 # All indexes are zero-based.
31522 # Indexes are half open, e.g the start index is inclusive
31523 # and the end index is exclusive -- [start_index, end_index).
31524 # Missing indexes indicate the range is unbounded on that side.
31525 #
31526 # For example, if "Sheet1" is grid ID 0, then:
31527 #
31528 # Sheet1!A1:A1 == sheet_id: 0,
31529 # start_row_index: 0, end_row_index: 1,
31530 # start_column_index: 0, end_column_index: 1
31531 #
31532 # Sheet1!A3:B4 == sheet_id: 0,
31533 # start_row_index: 2, end_row_index: 4,
31534 # start_column_index: 0, end_column_index: 2
31535 #
31536 # Sheet1!A:B == sheet_id: 0,
31537 # start_column_index: 0, end_column_index: 2
31538 #
31539 # Sheet1!A5:B == sheet_id: 0,
31540 # start_row_index: 4,
31541 # start_column_index: 0, end_column_index: 2
31542 #
31543 # Sheet1 == sheet_id:0
31544 #
31545 # The start index must always be less than or equal to the end index.
31546 # If the start index equals the end index, then the range is empty.
31547 # Empty ranges are typically not meaningful and are usually rendered in the
31548 # UI as `#REF!`.
31549 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
31550 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
31551 "sheetId": 42, # The sheet this range is on.
31552 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
31553 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
31554 },
31555 ],
31556 },
31557 },
31558 "targetAxis": "A String", # The minor axis that will specify the range of values for this series.
31559 # For example, if charting stocks over time, the "Volume" series
31560 # may want to be pinned to the right with the prices pinned to the left,
31561 # because the scale of trading volume is different than the scale of
31562 # prices.
31563 # It is an error to specify an axis that isn't a valid minor axis
31564 # for the chart's type.
31565 "type": "A String", # The type of this series. Valid only if the
31566 # chartType is
31567 # COMBO.
31568 # Different types will change the way the series is visualized.
31569 # Only LINE, AREA,
31570 # and COLUMN are supported.
31571 },
31572 ],
31573 "legendPosition": "A String", # The position of the chart legend.
31574 "domains": [ # The domain of data this is charting.
31575 # Only a single domain is currently supported.
31576 { # The domain of a chart.
31577 # For example, if charting stock prices over time, this would be the date.
31578 "domain": { # The data included in a domain or series. # The data of the domain. For example, if charting stock prices over time,
31579 # this be the data representing the dates.
31580 "sourceRange": { # Source ranges for a chart. # The source ranges of the data.
31581 "sources": [ # The ranges of data for a series or domain.
31582 # Exactly one dimension must have a length of 1,
31583 # and all sources in the list must have the same dimension
31584 # with length 1.
31585 # The domain (if it exists) & all series must have the same number
31586 # of source ranges. If using more than one source range, then the source
31587 # range at a given offset must be contiguous across the domain and series.
31588 #
31589 # For example, these are valid configurations:
31590 #
31591 # domain sources: A1:A5
31592 # series1 sources: B1:B5
31593 # series2 sources: D6:D10
31594 #
31595 # domain sources: A1:A5, C10:C12
31596 # series1 sources: B1:B5, D10:D12
31597 # series2 sources: C1:C5, E10:E12
31598 { # A range on a sheet.
31599 # All indexes are zero-based.
31600 # Indexes are half open, e.g the start index is inclusive
31601 # and the end index is exclusive -- [start_index, end_index).
31602 # Missing indexes indicate the range is unbounded on that side.
31603 #
31604 # For example, if "Sheet1" is grid ID 0, then:
31605 #
31606 # Sheet1!A1:A1 == sheet_id: 0,
31607 # start_row_index: 0, end_row_index: 1,
31608 # start_column_index: 0, end_column_index: 1
31609 #
31610 # Sheet1!A3:B4 == sheet_id: 0,
31611 # start_row_index: 2, end_row_index: 4,
31612 # start_column_index: 0, end_column_index: 2
31613 #
31614 # Sheet1!A:B == sheet_id: 0,
31615 # start_column_index: 0, end_column_index: 2
31616 #
31617 # Sheet1!A5:B == sheet_id: 0,
31618 # start_row_index: 4,
31619 # start_column_index: 0, end_column_index: 2
31620 #
31621 # Sheet1 == sheet_id:0
31622 #
31623 # The start index must always be less than or equal to the end index.
31624 # If the start index equals the end index, then the range is empty.
31625 # Empty ranges are typically not meaningful and are usually rendered in the
31626 # UI as `#REF!`.
31627 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
31628 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
31629 "sheetId": 42, # The sheet this range is on.
31630 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
31631 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
31632 },
31633 ],
31634 },
31635 },
31636 },
31637 ],
31638 "chartType": "A String", # The type of the chart.
31639 "axis": [ # The axis on the chart.
31640 { # An axis of the chart.
31641 # A chart may not have more than one axis per
31642 # axis position.
31643 "position": "A String", # The position of this axis.
31644 "format": { # The format of a run of text in a cell. # The format of the title.
31645 # Only valid if the axis is not associated with the domain.
31646 # Absent values indicate that the field isn't specified.
31647 "foregroundColor": { # Represents a color in the RGBA color space. This representation is designed # The foreground color of the text.
31648 # for simplicity of conversion to/from color representations in various
31649 # languages over compactness; for example, the fields of this representation
31650 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
31651 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
31652 # method in iOS; and, with just a little work, it can be easily formatted into
31653 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
31654 #
31655 # Example (Java):
31656 #
31657 # import com.google.type.Color;
31658 #
31659 # // ...
31660 # public static java.awt.Color fromProto(Color protocolor) {
31661 # float alpha = protocolor.hasAlpha()
31662 # ? protocolor.getAlpha().getValue()
31663 # : 1.0;
31664 #
31665 # return new java.awt.Color(
31666 # protocolor.getRed(),
31667 # protocolor.getGreen(),
31668 # protocolor.getBlue(),
31669 # alpha);
31670 # }
31671 #
31672 # public static Color toProto(java.awt.Color color) {
31673 # float red = (float) color.getRed();
31674 # float green = (float) color.getGreen();
31675 # float blue = (float) color.getBlue();
31676 # float denominator = 255.0;
31677 # Color.Builder resultBuilder =
31678 # Color
31679 # .newBuilder()
31680 # .setRed(red / denominator)
31681 # .setGreen(green / denominator)
31682 # .setBlue(blue / denominator);
31683 # int alpha = color.getAlpha();
31684 # if (alpha != 255) {
31685 # result.setAlpha(
31686 # FloatValue
31687 # .newBuilder()
31688 # .setValue(((float) alpha) / denominator)
31689 # .build());
31690 # }
31691 # return resultBuilder.build();
31692 # }
31693 # // ...
31694 #
31695 # Example (iOS / Obj-C):
31696 #
31697 # // ...
31698 # static UIColor* fromProto(Color* protocolor) {
31699 # float red = [protocolor red];
31700 # float green = [protocolor green];
31701 # float blue = [protocolor blue];
31702 # FloatValue* alpha_wrapper = [protocolor alpha];
31703 # float alpha = 1.0;
31704 # if (alpha_wrapper != nil) {
31705 # alpha = [alpha_wrapper value];
31706 # }
31707 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
31708 # }
31709 #
31710 # static Color* toProto(UIColor* color) {
31711 # CGFloat red, green, blue, alpha;
31712 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
31713 # return nil;
31714 # }
31715 # Color* result = [Color alloc] init];
31716 # [result setRed:red];
31717 # [result setGreen:green];
31718 # [result setBlue:blue];
31719 # if (alpha <= 0.9999) {
31720 # [result setAlpha:floatWrapperWithValue(alpha)];
31721 # }
31722 # [result autorelease];
31723 # return result;
31724 # }
31725 # // ...
31726 #
31727 # Example (JavaScript):
31728 #
31729 # // ...
31730 #
31731 # var protoToCssColor = function(rgb_color) {
31732 # var redFrac = rgb_color.red || 0.0;
31733 # var greenFrac = rgb_color.green || 0.0;
31734 # var blueFrac = rgb_color.blue || 0.0;
31735 # var red = Math.floor(redFrac * 255);
31736 # var green = Math.floor(greenFrac * 255);
31737 # var blue = Math.floor(blueFrac * 255);
31738 #
31739 # if (!('alpha' in rgb_color)) {
31740 # return rgbToCssColor_(red, green, blue);
31741 # }
31742 #
31743 # var alphaFrac = rgb_color.alpha.value || 0.0;
31744 # var rgbParams = [red, green, blue].join(',');
31745 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
31746 # };
31747 #
31748 # var rgbToCssColor_ = function(red, green, blue) {
31749 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
31750 # var hexString = rgbNumber.toString(16);
31751 # var missingZeros = 6 - hexString.length;
31752 # var resultBuilder = ['#'];
31753 # for (var i = 0; i < missingZeros; i++) {
31754 # resultBuilder.push('0');
31755 # }
31756 # resultBuilder.push(hexString);
31757 # return resultBuilder.join('');
31758 # };
31759 #
31760 # // ...
31761 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
31762 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
31763 # the final pixel color is defined by the equation:
31764 #
31765 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
31766 #
31767 # This means that a value of 1.0 corresponds to a solid color, whereas
31768 # a value of 0.0 corresponds to a completely transparent color. This
31769 # uses a wrapper message rather than a simple float scalar so that it is
31770 # possible to distinguish between a default value and the value being unset.
31771 # If omitted, this color object is to be rendered as a solid color
31772 # (as if the alpha value had been explicitly given with a value of 1.0).
31773 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
31774 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
31775 },
31776 "bold": True or False, # True if the text is bold.
31777 "strikethrough": True or False, # True if the text has a strikethrough.
31778 "fontFamily": "A String", # The font family.
31779 "fontSize": 42, # The size of the font.
31780 "italic": True or False, # True if the text is italicized.
31781 "underline": True or False, # True if the text is underlined.
31782 },
31783 "title": "A String", # The title of this axis. If set, this overrides any title inferred
31784 # from headers of the data.
31785 },
31786 ],
31787 },
31788 "title": "A String", # The title of the chart.
31789 },
31790 },
31791 ],
31792 "filterViews": [ # The filter views in this sheet.
31793 { # A filter view.
31794 "title": "A String", # The name of the filter view.
31795 "namedRangeId": "A String", # The named range this filter view is backed by, if any.
31796 #
31797 # When writing, only one of range or namedRangeId
31798 # may be set.
31799 "filterViewId": 42, # The ID of the filter view.
31800 "range": { # A range on a sheet. # The range this filter view covers.
31801 #
31802 # When writing, only one of range or namedRangeId
31803 # may be set.
31804 # All indexes are zero-based.
31805 # Indexes are half open, e.g the start index is inclusive
31806 # and the end index is exclusive -- [start_index, end_index).
31807 # Missing indexes indicate the range is unbounded on that side.
31808 #
31809 # For example, if "Sheet1" is grid ID 0, then:
31810 #
31811 # Sheet1!A1:A1 == sheet_id: 0,
31812 # start_row_index: 0, end_row_index: 1,
31813 # start_column_index: 0, end_column_index: 1
31814 #
31815 # Sheet1!A3:B4 == sheet_id: 0,
31816 # start_row_index: 2, end_row_index: 4,
31817 # start_column_index: 0, end_column_index: 2
31818 #
31819 # Sheet1!A:B == sheet_id: 0,
31820 # start_column_index: 0, end_column_index: 2
31821 #
31822 # Sheet1!A5:B == sheet_id: 0,
31823 # start_row_index: 4,
31824 # start_column_index: 0, end_column_index: 2
31825 #
31826 # Sheet1 == sheet_id:0
31827 #
31828 # The start index must always be less than or equal to the end index.
31829 # If the start index equals the end index, then the range is empty.
31830 # Empty ranges are typically not meaningful and are usually rendered in the
31831 # UI as `#REF!`.
31832 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
31833 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
31834 "sheetId": 42, # The sheet this range is on.
31835 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
31836 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
31837 },
31838 "sortSpecs": [ # The sort order per column. Later specifications are used when values
31839 # are equal in the earlier specifications.
31840 { # A sort order associated with a specific column or row.
31841 "sortOrder": "A String", # The order data should be sorted.
31842 "dimensionIndex": 42, # The dimension the sort should be applied to.
31843 },
31844 ],
31845 "criteria": { # The criteria for showing/hiding values per column.
31846 # The map's key is the column index, and the value is the criteria for
31847 # that column.
31848 "a_key": { # Criteria for showing/hiding rows in a filter, filter view.
31849 "hiddenValues": [ # Values that should be hidden.
31850 "A String",
31851 ],
31852 "condition": { # A condition that can evaluate to true or false. # A condition that must be true for values to be shown.
31853 # (This does not override hiddenValues -- if a value is listed there,
31854 # it will still be hidden.)
31855 # BooleanConditions are used by conditional formatting,
31856 # data validation, and the criteria in filters.
31857 "type": "A String", # The type of condition.
31858 "values": [ # The values of the condition. The number of supported values depends
31859 # on the condition type. Some support zero values,
31860 # others one or two values,
31861 # and ConditionType.ONE_OF_LIST supports an arbitrary number of values.
31862 { # The value of the condition.
31863 "relativeDate": "A String", # A relative date (based on the current date).
31864 # Valid only if the type is
31865 # DATE_BEFORE,
31866 # DATE_AFTER,
31867 # DATE_ON_OR_BEFORE or
31868 # DATE_ON_OR_AFTER.
31869 #
31870 # Relative dates are not supported in data validation.
31871 # They are supported only in conditional formatting and
31872 # conditional filters.
31873 "userEnteredValue": "A String", # A value the condition is based on.
31874 # The value will be parsed as if the user typed into a cell.
31875 # Formulas are supported (and must begin with an `=`).
31876 },
31877 ],
31878 },
31879 },
31880 },
31881 },
31882 ],
31883 "protectedRanges": [ # The protected ranges in this sheet.
31884 { # A protected range.
31885 "unprotectedRanges": [ # The list of unprotected ranges within a protected sheet.
31886 # Unprotected ranges are only supported on protected sheets.
31887 { # A range on a sheet.
31888 # All indexes are zero-based.
31889 # Indexes are half open, e.g the start index is inclusive
31890 # and the end index is exclusive -- [start_index, end_index).
31891 # Missing indexes indicate the range is unbounded on that side.
31892 #
31893 # For example, if "Sheet1" is grid ID 0, then:
31894 #
31895 # Sheet1!A1:A1 == sheet_id: 0,
31896 # start_row_index: 0, end_row_index: 1,
31897 # start_column_index: 0, end_column_index: 1
31898 #
31899 # Sheet1!A3:B4 == sheet_id: 0,
31900 # start_row_index: 2, end_row_index: 4,
31901 # start_column_index: 0, end_column_index: 2
31902 #
31903 # Sheet1!A:B == sheet_id: 0,
31904 # start_column_index: 0, end_column_index: 2
31905 #
31906 # Sheet1!A5:B == sheet_id: 0,
31907 # start_row_index: 4,
31908 # start_column_index: 0, end_column_index: 2
31909 #
31910 # Sheet1 == sheet_id:0
31911 #
31912 # The start index must always be less than or equal to the end index.
31913 # If the start index equals the end index, then the range is empty.
31914 # Empty ranges are typically not meaningful and are usually rendered in the
31915 # UI as `#REF!`.
31916 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
31917 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
31918 "sheetId": 42, # The sheet this range is on.
31919 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
31920 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
31921 },
31922 ],
31923 "requestingUserCanEdit": True or False, # True if the user who requested this protected range can edit the
31924 # protected area.
31925 # This field is read-only.
31926 "description": "A String", # The description of this protected range.
31927 "namedRangeId": "A String", # The named range this protected range is backed by, if any.
31928 #
31929 # When writing, only one of range or namedRangeId
31930 # may be set.
31931 "editors": { # The editors of a protected range. # The users and groups with edit access to the protected range.
31932 # This field is only visible to users with edit access to the protected
31933 # range and the document.
31934 # Editors are not supported with warningOnly protection.
31935 "domainUsersCanEdit": True or False, # True if anyone in the document's domain has edit access to the protected
31936 # range. Domain protection is only supported on documents within a domain.
31937 "users": [ # The email addresses of users with edit access to the protected range.
31938 "A String",
31939 ],
31940 "groups": [ # The email addresses of groups with edit access to the protected range.
31941 "A String",
31942 ],
31943 },
31944 "protectedRangeId": 42, # The ID of the protected range.
31945 # This field is read-only.
31946 "warningOnly": True or False, # True if this this protected range will show a warning when editing.
31947 # Warning-based protection means that every user can edit data in the
31948 # protected range, except editing will prompt a warning asking the user
31949 # to confirm the edit.
31950 #
31951 # When warning: if this field is true, then editors is ignored.
31952 # Additionally, if this field is changed from true to false and the
31953 # `editors` field is not set (nor included in the field mask), then
31954 # the editors will be set to all the editors in the document.
31955 "range": { # A range on a sheet. # The range that is being protected.
31956 # The range may be fully unbounded, in which case this is considered
31957 # a protected sheet.
31958 #
31959 # When writing, only one of range or namedRangeId
31960 # may be set.
31961 # All indexes are zero-based.
31962 # Indexes are half open, e.g the start index is inclusive
31963 # and the end index is exclusive -- [start_index, end_index).
31964 # Missing indexes indicate the range is unbounded on that side.
31965 #
31966 # For example, if "Sheet1" is grid ID 0, then:
31967 #
31968 # Sheet1!A1:A1 == sheet_id: 0,
31969 # start_row_index: 0, end_row_index: 1,
31970 # start_column_index: 0, end_column_index: 1
31971 #
31972 # Sheet1!A3:B4 == sheet_id: 0,
31973 # start_row_index: 2, end_row_index: 4,
31974 # start_column_index: 0, end_column_index: 2
31975 #
31976 # Sheet1!A:B == sheet_id: 0,
31977 # start_column_index: 0, end_column_index: 2
31978 #
31979 # Sheet1!A5:B == sheet_id: 0,
31980 # start_row_index: 4,
31981 # start_column_index: 0, end_column_index: 2
31982 #
31983 # Sheet1 == sheet_id:0
31984 #
31985 # The start index must always be less than or equal to the end index.
31986 # If the start index equals the end index, then the range is empty.
31987 # Empty ranges are typically not meaningful and are usually rendered in the
31988 # UI as `#REF!`.
31989 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
31990 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
31991 "sheetId": 42, # The sheet this range is on.
31992 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
31993 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
31994 },
31995 },
31996 ],
31997 "data": [ # Data in the grid, if this is a grid sheet.
31998 # The number of GridData objects returned is dependent on the number of
31999 # ranges requested on this sheet. For example, if this is representing
32000 # `Sheet1`, and the spreadsheet was requested with ranges
32001 # `Sheet1!A1:C10` and `Sheet1!D15:E20`, then the first GridData will have a
32002 # startRow/startColumn of `0`,
32003 # while the second one will have `startRow 14` (zero-based row 15),
32004 # and `startColumn 3` (zero-based column D).
32005 { # Data in the grid, as well as metadata about the dimensions.
32006 "startRow": 42, # The first row this GridData refers to, zero-based.
32007 "rowMetadata": [ # Metadata about the requested rows in the grid, starting with the row
32008 # in startRow.
32009 { # Properties about a dimension.
32010 "pixelSize": 42, # The height (if a row) or width (if a column) of the dimension in pixels.
32011 "hiddenByUser": True or False, # True if this dimension is explicitly hidden.
32012 "hiddenByFilter": True or False, # True if this dimension is being filtered.
32013 # This field is read-only.
32014 },
32015 ],
32016 "startColumn": 42, # The first column this GridData refers to, zero-based.
32017 "columnMetadata": [ # Metadata about the requested columns in the grid, starting with the column
32018 # in startColumn.
32019 { # Properties about a dimension.
32020 "pixelSize": 42, # The height (if a row) or width (if a column) of the dimension in pixels.
32021 "hiddenByUser": True or False, # True if this dimension is explicitly hidden.
32022 "hiddenByFilter": True or False, # True if this dimension is being filtered.
32023 # This field is read-only.
32024 },
32025 ],
32026 "rowData": [ # The data in the grid, one entry per row,
32027 # starting with the row in startRow.
32028 # The values in RowData will correspond to columns starting
32029 # at startColumn.
32030 { # Data about each cell in a row.
32031 "values": [ # The values in the row, one per column.
32032 { # Data about a specific cell.
32033 "pivotTable": { # A pivot table. # A pivot table anchored at this cell. The size of pivot table itself
32034 # is computed dynamically based on its data, grouping, filters, values,
32035 # etc... Only the top-left cell of the pivot table contains the pivot table
32036 # definition. The other cells will contain the calculated values of the
32037 # results of the pivot in their effectiveValue fields.
32038 "valueLayout": "A String", # Whether values should be listed horizontally (as columns)
32039 # or vertically (as rows).
32040 "rows": [ # Each row grouping in the pivot table.
32041 { # A single grouping (either row or column) in a pivot table.
32042 "showTotals": True or False, # True if the pivot table should include the totals for this grouping.
32043 "valueMetadata": [ # Metadata about values in the grouping.
32044 { # Metadata about a value in a pivot grouping.
32045 "collapsed": True or False, # True if the data corresponding to the value is collapsed.
32046 "value": { # The kinds of value that a cell in a spreadsheet can have. # The calculated value the metadata corresponds to.
32047 # (Note that formulaValue is not valid,
32048 # because the values will be calculated.)
32049 "numberValue": 3.14, # Represents a double value.
32050 # Note: Dates, Times and DateTimes are represented as doubles in
32051 # "serial number" format.
32052 "boolValue": True or False, # Represents a boolean value.
32053 "formulaValue": "A String", # Represents a formula.
32054 "stringValue": "A String", # Represents a string value.
32055 # Leading single quotes are not included. For example, if the user typed
32056 # `'123` into the UI, this would be represented as a `stringValue` of
32057 # `"123"`.
32058 "errorValue": { # An error in a cell. # Represents an error.
32059 # This field is read-only.
32060 "message": "A String", # A message with more information about the error
32061 # (in the spreadsheet's locale).
32062 "type": "A String", # The type of error.
32063 },
32064 },
32065 },
32066 ],
32067 "valueBucket": { # Information about which values in a pivot group should be used for sorting. # The bucket of the opposite pivot group to sort by.
32068 # If not specified, sorting is alphabetical by this group's values.
32069 "buckets": [ # Determines the bucket from which values are chosen to sort.
32070 #
32071 # For example, in a pivot table with one row group & two column groups,
32072 # the row group can list up to two values. The first value corresponds
32073 # to a value within the first column group, and the second value
32074 # corresponds to a value in the second column group. If no values
32075 # are listed, this would indicate that the row should be sorted according
32076 # to the "Grand Total" over the column groups. If a single value is listed,
32077 # this would correspond to using the "Total" of that bucket.
32078 { # The kinds of value that a cell in a spreadsheet can have.
32079 "numberValue": 3.14, # Represents a double value.
32080 # Note: Dates, Times and DateTimes are represented as doubles in
32081 # "serial number" format.
32082 "boolValue": True or False, # Represents a boolean value.
32083 "formulaValue": "A String", # Represents a formula.
32084 "stringValue": "A String", # Represents a string value.
32085 # Leading single quotes are not included. For example, if the user typed
32086 # `'123` into the UI, this would be represented as a `stringValue` of
32087 # `"123"`.
32088 "errorValue": { # An error in a cell. # Represents an error.
32089 # This field is read-only.
32090 "message": "A String", # A message with more information about the error
32091 # (in the spreadsheet's locale).
32092 "type": "A String", # The type of error.
32093 },
32094 },
32095 ],
32096 "valuesIndex": 42, # The offset in the [PivotTable.values] list which the values in this
32097 # grouping should be sorted by.
32098 },
32099 "sortOrder": "A String", # The order the values in this group should be sorted.
32100 "sourceColumnOffset": 42, # The column offset of the source range that this grouping is based on.
32101 #
32102 # For example, if the source was `C10:E15', a `sourceColumnOffset` of `0`
32103 # means this group refers to column `C`, whereas the offset `1` would refer
32104 # to column `D`.
32105 },
32106 ],
32107 "source": { # A range on a sheet. # The range the pivot table is reading data from.
32108 # All indexes are zero-based.
32109 # Indexes are half open, e.g the start index is inclusive
32110 # and the end index is exclusive -- [start_index, end_index).
32111 # Missing indexes indicate the range is unbounded on that side.
32112 #
32113 # For example, if "Sheet1" is grid ID 0, then:
32114 #
32115 # Sheet1!A1:A1 == sheet_id: 0,
32116 # start_row_index: 0, end_row_index: 1,
32117 # start_column_index: 0, end_column_index: 1
32118 #
32119 # Sheet1!A3:B4 == sheet_id: 0,
32120 # start_row_index: 2, end_row_index: 4,
32121 # start_column_index: 0, end_column_index: 2
32122 #
32123 # Sheet1!A:B == sheet_id: 0,
32124 # start_column_index: 0, end_column_index: 2
32125 #
32126 # Sheet1!A5:B == sheet_id: 0,
32127 # start_row_index: 4,
32128 # start_column_index: 0, end_column_index: 2
32129 #
32130 # Sheet1 == sheet_id:0
32131 #
32132 # The start index must always be less than or equal to the end index.
32133 # If the start index equals the end index, then the range is empty.
32134 # Empty ranges are typically not meaningful and are usually rendered in the
32135 # UI as `#REF!`.
32136 "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
32137 "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
32138 "sheetId": 42, # The sheet this range is on.
32139 "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
32140 "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
32141 },
32142 "values": [ # A list of values to include in the pivot table.
32143 { # The definition of how a value in a pivot table should be calculated.
32144 "formula": "A String", # A custom formula to calculate the value. The formula must start
32145 # with an `=` character.
32146 "summarizeFunction": "A String", # A function to summarize the value.
32147 # If formula is set, the only supported values are
32148 # SUM and
32149 # CUSTOM.
32150 # If sourceColumnOffset is set, then `CUSTOM`
32151 # is not supported.
32152 "sourceColumnOffset": 42, # The column offset of the source range that this value reads from.
32153 #
32154 # For example, if the source was `C10:E15', a `sourceColumnOffset` of `0`
32155 # means this value refers to column `C`, whereas the offset `1` would
32156 # refer to column `D`.
32157 "name": "A String", # A name to use for the value. This is only used if formula was set.
32158 # Otherwise, the column name is used.
32159 },
32160 ],
32161 "criteria": { # An optional mapping of filters per source column offset.
32162 #
32163 # The filters will be applied before aggregating data into the pivot table.
32164 # The map's key is the column offset of the source range that you want to
32165 # filter, and the value is the criteria for that column.
32166 #
32167 # For example, if the source was `C10:E15', a key of `0` will have the filter
32168 # for column `C`, whereas the key `1` is for column `D`.
32169 "a_key": { # Criteria for showing/hiding rows in a pivot table.
32170 "visibleValues": [ # Values that should be included. Values not listed here are excluded.
32171 "A String",
32172 ],
32173 },
32174 },
32175 "columns": [ # Each column grouping in the pivot table.
32176 { # A single grouping (either row or column) in a pivot table.
32177 "showTotals": True or False, # True if the pivot table should include the totals for this grouping.
32178 "valueMetadata": [ # Metadata about values in the grouping.
32179 { # Metadata about a value in a pivot grouping.
32180 "collapsed": True or False, # True if the data corresponding to the value is collapsed.
32181 "value": { # The kinds of value that a cell in a spreadsheet can have. # The calculated value the metadata corresponds to.
32182 # (Note that formulaValue is not valid,
32183 # because the values will be calculated.)
32184 "numberValue": 3.14, # Represents a double value.
32185 # Note: Dates, Times and DateTimes are represented as doubles in
32186 # "serial number" format.
32187 "boolValue": True or False, # Represents a boolean value.
32188 "formulaValue": "A String", # Represents a formula.
32189 "stringValue": "A String", # Represents a string value.
32190 # Leading single quotes are not included. For example, if the user typed
32191 # `'123` into the UI, this would be represented as a `stringValue` of
32192 # `"123"`.
32193 "errorValue": { # An error in a cell. # Represents an error.
32194 # This field is read-only.
32195 "message": "A String", # A message with more information about the error
32196 # (in the spreadsheet's locale).
32197 "type": "A String", # The type of error.
32198 },
32199 },
32200 },
32201 ],
32202 "valueBucket": { # Information about which values in a pivot group should be used for sorting. # The bucket of the opposite pivot group to sort by.
32203 # If not specified, sorting is alphabetical by this group's values.
32204 "buckets": [ # Determines the bucket from which values are chosen to sort.
32205 #
32206 # For example, in a pivot table with one row group & two column groups,
32207 # the row group can list up to two values. The first value corresponds
32208 # to a value within the first column group, and the second value
32209 # corresponds to a value in the second column group. If no values
32210 # are listed, this would indicate that the row should be sorted according
32211 # to the "Grand Total" over the column groups. If a single value is listed,
32212 # this would correspond to using the "Total" of that bucket.
32213 { # The kinds of value that a cell in a spreadsheet can have.
32214 "numberValue": 3.14, # Represents a double value.
32215 # Note: Dates, Times and DateTimes are represented as doubles in
32216 # "serial number" format.
32217 "boolValue": True or False, # Represents a boolean value.
32218 "formulaValue": "A String", # Represents a formula.
32219 "stringValue": "A String", # Represents a string value.
32220 # Leading single quotes are not included. For example, if the user typed
32221 # `'123` into the UI, this would be represented as a `stringValue` of
32222 # `"123"`.
32223 "errorValue": { # An error in a cell. # Represents an error.
32224 # This field is read-only.
32225 "message": "A String", # A message with more information about the error
32226 # (in the spreadsheet's locale).
32227 "type": "A String", # The type of error.
32228 },
32229 },
32230 ],
32231 "valuesIndex": 42, # The offset in the [PivotTable.values] list which the values in this
32232 # grouping should be sorted by.
32233 },
32234 "sortOrder": "A String", # The order the values in this group should be sorted.
32235 "sourceColumnOffset": 42, # The column offset of the source range that this grouping is based on.
32236 #
32237 # For example, if the source was `C10:E15', a `sourceColumnOffset` of `0`
32238 # means this group refers to column `C`, whereas the offset `1` would refer
32239 # to column `D`.
32240 },
32241 ],
32242 },
32243 "hyperlink": "A String", # A hyperlink this cell points to, if any.
32244 # This field is read-only. (To set it, use a `=HYPERLINK` formula.)
32245 "effectiveValue": { # The kinds of value that a cell in a spreadsheet can have. # The effective value of the cell. For cells with formulas, this will be
32246 # the calculated value. For cells with literals, this will be
32247 # the same as the user_entered_value.
32248 # This field is read-only.
32249 "numberValue": 3.14, # Represents a double value.
32250 # Note: Dates, Times and DateTimes are represented as doubles in
32251 # "serial number" format.
32252 "boolValue": True or False, # Represents a boolean value.
32253 "formulaValue": "A String", # Represents a formula.
32254 "stringValue": "A String", # Represents a string value.
32255 # Leading single quotes are not included. For example, if the user typed
32256 # `'123` into the UI, this would be represented as a `stringValue` of
32257 # `"123"`.
32258 "errorValue": { # An error in a cell. # Represents an error.
32259 # This field is read-only.
32260 "message": "A String", # A message with more information about the error
32261 # (in the spreadsheet's locale).
32262 "type": "A String", # The type of error.
32263 },
32264 },
32265 "formattedValue": "A String", # The formatted value of the cell.
32266 # This is the value as it's shown to the user.
32267 # This field is read-only.
32268 "userEnteredValue": { # The kinds of value that a cell in a spreadsheet can have. # The value the user entered in the cell. e.g, `1234`, `'Hello'`, or `=NOW()`
32269 # Note: Dates, Times and DateTimes are represented as doubles in
32270 # serial number format.
32271 "numberValue": 3.14, # Represents a double value.
32272 # Note: Dates, Times and DateTimes are represented as doubles in
32273 # "serial number" format.
32274 "boolValue": True or False, # Represents a boolean value.
32275 "formulaValue": "A String", # Represents a formula.
32276 "stringValue": "A String", # Represents a string value.
32277 # Leading single quotes are not included. For example, if the user typed
32278 # `'123` into the UI, this would be represented as a `stringValue` of
32279 # `"123"`.
32280 "errorValue": { # An error in a cell. # Represents an error.
32281 # This field is read-only.
32282 "message": "A String", # A message with more information about the error
32283 # (in the spreadsheet's locale).
32284 "type": "A String", # The type of error.
32285 },
32286 },
32287 "note": "A String", # Any note on the cell.
32288 "effectiveFormat": { # The format of a cell. # The effective format being used by the cell.
32289 # This includes the results of applying any conditional formatting and,
32290 # if the cell contains a formula, the computed number format.
32291 # If the effective format is the default format, effective format will
32292 # not be written.
32293 # This field is read-only.
32294 "numberFormat": { # The number format of a cell. # A format describing how number values should be represented to the user.
32295 # When updating, all fields must be set.
32296 "pattern": "A String", # Pattern string used for formatting.
32297 "type": "A String", # The type of the number format.
32298 },
32299 "textDirection": "A String", # The direction of the text in the cell.
32300 "padding": { # The amount of padding around the cell, in pixels. # The padding of the cell.
32301 # When updating padding, every field must be specified.
32302 "top": 42, # The top padding of the cell.
32303 "right": 42, # The right padding of the cell.
32304 "bottom": 42, # The bottom padding of the cell.
32305 "left": 42, # The left padding of the cell.
32306 },
32307 "horizontalAlignment": "A String", # The horizontal alignment of the value in cell.
32308 "backgroundColor": { # Represents a color in the RGBA color space. This representation is designed # The background color of the cell.
32309 # for simplicity of conversion to/from color representations in various
32310 # languages over compactness; for example, the fields of this representation
32311 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
32312 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
32313 # method in iOS; and, with just a little work, it can be easily formatted into
32314 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
32315 #
32316 # Example (Java):
32317 #
32318 # import com.google.type.Color;
32319 #
32320 # // ...
32321 # public static java.awt.Color fromProto(Color protocolor) {
32322 # float alpha = protocolor.hasAlpha()
32323 # ? protocolor.getAlpha().getValue()
32324 # : 1.0;
32325 #
32326 # return new java.awt.Color(
32327 # protocolor.getRed(),
32328 # protocolor.getGreen(),
32329 # protocolor.getBlue(),
32330 # alpha);
32331 # }
32332 #
32333 # public static Color toProto(java.awt.Color color) {
32334 # float red = (float) color.getRed();
32335 # float green = (float) color.getGreen();
32336 # float blue = (float) color.getBlue();
32337 # float denominator = 255.0;
32338 # Color.Builder resultBuilder =
32339 # Color
32340 # .newBuilder()
32341 # .setRed(red / denominator)
32342 # .setGreen(green / denominator)
32343 # .setBlue(blue / denominator);
32344 # int alpha = color.getAlpha();
32345 # if (alpha != 255) {
32346 # result.setAlpha(
32347 # FloatValue
32348 # .newBuilder()
32349 # .setValue(((float) alpha) / denominator)
32350 # .build());
32351 # }
32352 # return resultBuilder.build();
32353 # }
32354 # // ...
32355 #
32356 # Example (iOS / Obj-C):
32357 #
32358 # // ...
32359 # static UIColor* fromProto(Color* protocolor) {
32360 # float red = [protocolor red];
32361 # float green = [protocolor green];
32362 # float blue = [protocolor blue];
32363 # FloatValue* alpha_wrapper = [protocolor alpha];
32364 # float alpha = 1.0;
32365 # if (alpha_wrapper != nil) {
32366 # alpha = [alpha_wrapper value];
32367 # }
32368 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
32369 # }
32370 #
32371 # static Color* toProto(UIColor* color) {
32372 # CGFloat red, green, blue, alpha;
32373 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
32374 # return nil;
32375 # }
32376 # Color* result = [Color alloc] init];
32377 # [result setRed:red];
32378 # [result setGreen:green];
32379 # [result setBlue:blue];
32380 # if (alpha <= 0.9999) {
32381 # [result setAlpha:floatWrapperWithValue(alpha)];
32382 # }
32383 # [result autorelease];
32384 # return result;
32385 # }
32386 # // ...
32387 #
32388 # Example (JavaScript):
32389 #
32390 # // ...
32391 #
32392 # var protoToCssColor = function(rgb_color) {
32393 # var redFrac = rgb_color.red || 0.0;
32394 # var greenFrac = rgb_color.green || 0.0;
32395 # var blueFrac = rgb_color.blue || 0.0;
32396 # var red = Math.floor(redFrac * 255);
32397 # var green = Math.floor(greenFrac * 255);
32398 # var blue = Math.floor(blueFrac * 255);
32399 #
32400 # if (!('alpha' in rgb_color)) {
32401 # return rgbToCssColor_(red, green, blue);
32402 # }
32403 #
32404 # var alphaFrac = rgb_color.alpha.value || 0.0;
32405 # var rgbParams = [red, green, blue].join(',');
32406 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
32407 # };
32408 #
32409 # var rgbToCssColor_ = function(red, green, blue) {
32410 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
32411 # var hexString = rgbNumber.toString(16);
32412 # var missingZeros = 6 - hexString.length;
32413 # var resultBuilder = ['#'];
32414 # for (var i = 0; i < missingZeros; i++) {
32415 # resultBuilder.push('0');
32416 # }
32417 # resultBuilder.push(hexString);
32418 # return resultBuilder.join('');
32419 # };
32420 #
32421 # // ...
32422 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
32423 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
32424 # the final pixel color is defined by the equation:
32425 #
32426 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
32427 #
32428 # This means that a value of 1.0 corresponds to a solid color, whereas
32429 # a value of 0.0 corresponds to a completely transparent color. This
32430 # uses a wrapper message rather than a simple float scalar so that it is
32431 # possible to distinguish between a default value and the value being unset.
32432 # If omitted, this color object is to be rendered as a solid color
32433 # (as if the alpha value had been explicitly given with a value of 1.0).
32434 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
32435 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
32436 },
32437 "verticalAlignment": "A String", # The vertical alignment of the value in cell.
32438 "textFormat": { # The format of a run of text in a cell. # The format of the text in the cell (unless overridden by a format run).
32439 # Absent values indicate that the field isn't specified.
32440 "foregroundColor": { # Represents a color in the RGBA color space. This representation is designed # The foreground color of the text.
32441 # for simplicity of conversion to/from color representations in various
32442 # languages over compactness; for example, the fields of this representation
32443 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
32444 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
32445 # method in iOS; and, with just a little work, it can be easily formatted into
32446 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
32447 #
32448 # Example (Java):
32449 #
32450 # import com.google.type.Color;
32451 #
32452 # // ...
32453 # public static java.awt.Color fromProto(Color protocolor) {
32454 # float alpha = protocolor.hasAlpha()
32455 # ? protocolor.getAlpha().getValue()
32456 # : 1.0;
32457 #
32458 # return new java.awt.Color(
32459 # protocolor.getRed(),
32460 # protocolor.getGreen(),
32461 # protocolor.getBlue(),
32462 # alpha);
32463 # }
32464 #
32465 # public static Color toProto(java.awt.Color color) {
32466 # float red = (float) color.getRed();
32467 # float green = (float) color.getGreen();
32468 # float blue = (float) color.getBlue();
32469 # float denominator = 255.0;
32470 # Color.Builder resultBuilder =
32471 # Color
32472 # .newBuilder()
32473 # .setRed(red / denominator)
32474 # .setGreen(green / denominator)
32475 # .setBlue(blue / denominator);
32476 # int alpha = color.getAlpha();
32477 # if (alpha != 255) {
32478 # result.setAlpha(
32479 # FloatValue
32480 # .newBuilder()
32481 # .setValue(((float) alpha) / denominator)
32482 # .build());
32483 # }
32484 # return resultBuilder.build();
32485 # }
32486 # // ...
32487 #
32488 # Example (iOS / Obj-C):
32489 #
32490 # // ...
32491 # static UIColor* fromProto(Color* protocolor) {
32492 # float red = [protocolor red];
32493 # float green = [protocolor green];
32494 # float blue = [protocolor blue];
32495 # FloatValue* alpha_wrapper = [protocolor alpha];
32496 # float alpha = 1.0;
32497 # if (alpha_wrapper != nil) {
32498 # alpha = [alpha_wrapper value];
32499 # }
32500 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
32501 # }
32502 #
32503 # static Color* toProto(UIColor* color) {
32504 # CGFloat red, green, blue, alpha;
32505 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
32506 # return nil;
32507 # }
32508 # Color* result = [Color alloc] init];
32509 # [result setRed:red];
32510 # [result setGreen:green];
32511 # [result setBlue:blue];
32512 # if (alpha <= 0.9999) {
32513 # [result setAlpha:floatWrapperWithValue(alpha)];
32514 # }
32515 # [result autorelease];
32516 # return result;
32517 # }
32518 # // ...
32519 #
32520 # Example (JavaScript):
32521 #
32522 # // ...
32523 #
32524 # var protoToCssColor = function(rgb_color) {
32525 # var redFrac = rgb_color.red || 0.0;
32526 # var greenFrac = rgb_color.green || 0.0;
32527 # var blueFrac = rgb_color.blue || 0.0;
32528 # var red = Math.floor(redFrac * 255);
32529 # var green = Math.floor(greenFrac * 255);
32530 # var blue = Math.floor(blueFrac * 255);
32531 #
32532 # if (!('alpha' in rgb_color)) {
32533 # return rgbToCssColor_(red, green, blue);
32534 # }
32535 #
32536 # var alphaFrac = rgb_color.alpha.value || 0.0;
32537 # var rgbParams = [red, green, blue].join(',');
32538 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
32539 # };
32540 #
32541 # var rgbToCssColor_ = function(red, green, blue) {
32542 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
32543 # var hexString = rgbNumber.toString(16);
32544 # var missingZeros = 6 - hexString.length;
32545 # var resultBuilder = ['#'];
32546 # for (var i = 0; i < missingZeros; i++) {
32547 # resultBuilder.push('0');
32548 # }
32549 # resultBuilder.push(hexString);
32550 # return resultBuilder.join('');
32551 # };
32552 #
32553 # // ...
32554 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
32555 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
32556 # the final pixel color is defined by the equation:
32557 #
32558 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
32559 #
32560 # This means that a value of 1.0 corresponds to a solid color, whereas
32561 # a value of 0.0 corresponds to a completely transparent color. This
32562 # uses a wrapper message rather than a simple float scalar so that it is
32563 # possible to distinguish between a default value and the value being unset.
32564 # If omitted, this color object is to be rendered as a solid color
32565 # (as if the alpha value had been explicitly given with a value of 1.0).
32566 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
32567 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
32568 },
32569 "bold": True or False, # True if the text is bold.
32570 "strikethrough": True or False, # True if the text has a strikethrough.
32571 "fontFamily": "A String", # The font family.
32572 "fontSize": 42, # The size of the font.
32573 "italic": True or False, # True if the text is italicized.
32574 "underline": True or False, # True if the text is underlined.
32575 },
32576 "hyperlinkDisplayType": "A String", # How a hyperlink, if it exists, should be displayed in the cell.
32577 "borders": { # The borders of the cell. # The borders of the cell.
32578 "top": { # A border along a cell. # The top border of the cell.
32579 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
32580 # for simplicity of conversion to/from color representations in various
32581 # languages over compactness; for example, the fields of this representation
32582 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
32583 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
32584 # method in iOS; and, with just a little work, it can be easily formatted into
32585 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
32586 #
32587 # Example (Java):
32588 #
32589 # import com.google.type.Color;
32590 #
32591 # // ...
32592 # public static java.awt.Color fromProto(Color protocolor) {
32593 # float alpha = protocolor.hasAlpha()
32594 # ? protocolor.getAlpha().getValue()
32595 # : 1.0;
32596 #
32597 # return new java.awt.Color(
32598 # protocolor.getRed(),
32599 # protocolor.getGreen(),
32600 # protocolor.getBlue(),
32601 # alpha);
32602 # }
32603 #
32604 # public static Color toProto(java.awt.Color color) {
32605 # float red = (float) color.getRed();
32606 # float green = (float) color.getGreen();
32607 # float blue = (float) color.getBlue();
32608 # float denominator = 255.0;
32609 # Color.Builder resultBuilder =
32610 # Color
32611 # .newBuilder()
32612 # .setRed(red / denominator)
32613 # .setGreen(green / denominator)
32614 # .setBlue(blue / denominator);
32615 # int alpha = color.getAlpha();
32616 # if (alpha != 255) {
32617 # result.setAlpha(
32618 # FloatValue
32619 # .newBuilder()
32620 # .setValue(((float) alpha) / denominator)
32621 # .build());
32622 # }
32623 # return resultBuilder.build();
32624 # }
32625 # // ...
32626 #
32627 # Example (iOS / Obj-C):
32628 #
32629 # // ...
32630 # static UIColor* fromProto(Color* protocolor) {
32631 # float red = [protocolor red];
32632 # float green = [protocolor green];
32633 # float blue = [protocolor blue];
32634 # FloatValue* alpha_wrapper = [protocolor alpha];
32635 # float alpha = 1.0;
32636 # if (alpha_wrapper != nil) {
32637 # alpha = [alpha_wrapper value];
32638 # }
32639 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
32640 # }
32641 #
32642 # static Color* toProto(UIColor* color) {
32643 # CGFloat red, green, blue, alpha;
32644 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
32645 # return nil;
32646 # }
32647 # Color* result = [Color alloc] init];
32648 # [result setRed:red];
32649 # [result setGreen:green];
32650 # [result setBlue:blue];
32651 # if (alpha <= 0.9999) {
32652 # [result setAlpha:floatWrapperWithValue(alpha)];
32653 # }
32654 # [result autorelease];
32655 # return result;
32656 # }
32657 # // ...
32658 #
32659 # Example (JavaScript):
32660 #
32661 # // ...
32662 #
32663 # var protoToCssColor = function(rgb_color) {
32664 # var redFrac = rgb_color.red || 0.0;
32665 # var greenFrac = rgb_color.green || 0.0;
32666 # var blueFrac = rgb_color.blue || 0.0;
32667 # var red = Math.floor(redFrac * 255);
32668 # var green = Math.floor(greenFrac * 255);
32669 # var blue = Math.floor(blueFrac * 255);
32670 #
32671 # if (!('alpha' in rgb_color)) {
32672 # return rgbToCssColor_(red, green, blue);
32673 # }
32674 #
32675 # var alphaFrac = rgb_color.alpha.value || 0.0;
32676 # var rgbParams = [red, green, blue].join(',');
32677 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
32678 # };
32679 #
32680 # var rgbToCssColor_ = function(red, green, blue) {
32681 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
32682 # var hexString = rgbNumber.toString(16);
32683 # var missingZeros = 6 - hexString.length;
32684 # var resultBuilder = ['#'];
32685 # for (var i = 0; i < missingZeros; i++) {
32686 # resultBuilder.push('0');
32687 # }
32688 # resultBuilder.push(hexString);
32689 # return resultBuilder.join('');
32690 # };
32691 #
32692 # // ...
32693 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
32694 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
32695 # the final pixel color is defined by the equation:
32696 #
32697 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
32698 #
32699 # This means that a value of 1.0 corresponds to a solid color, whereas
32700 # a value of 0.0 corresponds to a completely transparent color. This
32701 # uses a wrapper message rather than a simple float scalar so that it is
32702 # possible to distinguish between a default value and the value being unset.
32703 # If omitted, this color object is to be rendered as a solid color
32704 # (as if the alpha value had been explicitly given with a value of 1.0).
32705 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
32706 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
32707 },
32708 "width": 42, # The width of the border, in pixels.
32709 # Border widths must be between 0 and 3 pixels.
32710 "style": "A String", # The style of the border.
32711 },
32712 "right": { # A border along a cell. # The right border of the cell.
32713 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
32714 # for simplicity of conversion to/from color representations in various
32715 # languages over compactness; for example, the fields of this representation
32716 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
32717 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
32718 # method in iOS; and, with just a little work, it can be easily formatted into
32719 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
32720 #
32721 # Example (Java):
32722 #
32723 # import com.google.type.Color;
32724 #
32725 # // ...
32726 # public static java.awt.Color fromProto(Color protocolor) {
32727 # float alpha = protocolor.hasAlpha()
32728 # ? protocolor.getAlpha().getValue()
32729 # : 1.0;
32730 #
32731 # return new java.awt.Color(
32732 # protocolor.getRed(),
32733 # protocolor.getGreen(),
32734 # protocolor.getBlue(),
32735 # alpha);
32736 # }
32737 #
32738 # public static Color toProto(java.awt.Color color) {
32739 # float red = (float) color.getRed();
32740 # float green = (float) color.getGreen();
32741 # float blue = (float) color.getBlue();
32742 # float denominator = 255.0;
32743 # Color.Builder resultBuilder =
32744 # Color
32745 # .newBuilder()
32746 # .setRed(red / denominator)
32747 # .setGreen(green / denominator)
32748 # .setBlue(blue / denominator);
32749 # int alpha = color.getAlpha();
32750 # if (alpha != 255) {
32751 # result.setAlpha(
32752 # FloatValue
32753 # .newBuilder()
32754 # .setValue(((float) alpha) / denominator)
32755 # .build());
32756 # }
32757 # return resultBuilder.build();
32758 # }
32759 # // ...
32760 #
32761 # Example (iOS / Obj-C):
32762 #
32763 # // ...
32764 # static UIColor* fromProto(Color* protocolor) {
32765 # float red = [protocolor red];
32766 # float green = [protocolor green];
32767 # float blue = [protocolor blue];
32768 # FloatValue* alpha_wrapper = [protocolor alpha];
32769 # float alpha = 1.0;
32770 # if (alpha_wrapper != nil) {
32771 # alpha = [alpha_wrapper value];
32772 # }
32773 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
32774 # }
32775 #
32776 # static Color* toProto(UIColor* color) {
32777 # CGFloat red, green, blue, alpha;
32778 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
32779 # return nil;
32780 # }
32781 # Color* result = [Color alloc] init];
32782 # [result setRed:red];
32783 # [result setGreen:green];
32784 # [result setBlue:blue];
32785 # if (alpha <= 0.9999) {
32786 # [result setAlpha:floatWrapperWithValue(alpha)];
32787 # }
32788 # [result autorelease];
32789 # return result;
32790 # }
32791 # // ...
32792 #
32793 # Example (JavaScript):
32794 #
32795 # // ...
32796 #
32797 # var protoToCssColor = function(rgb_color) {
32798 # var redFrac = rgb_color.red || 0.0;
32799 # var greenFrac = rgb_color.green || 0.0;
32800 # var blueFrac = rgb_color.blue || 0.0;
32801 # var red = Math.floor(redFrac * 255);
32802 # var green = Math.floor(greenFrac * 255);
32803 # var blue = Math.floor(blueFrac * 255);
32804 #
32805 # if (!('alpha' in rgb_color)) {
32806 # return rgbToCssColor_(red, green, blue);
32807 # }
32808 #
32809 # var alphaFrac = rgb_color.alpha.value || 0.0;
32810 # var rgbParams = [red, green, blue].join(',');
32811 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
32812 # };
32813 #
32814 # var rgbToCssColor_ = function(red, green, blue) {
32815 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
32816 # var hexString = rgbNumber.toString(16);
32817 # var missingZeros = 6 - hexString.length;
32818 # var resultBuilder = ['#'];
32819 # for (var i = 0; i < missingZeros; i++) {
32820 # resultBuilder.push('0');
32821 # }
32822 # resultBuilder.push(hexString);
32823 # return resultBuilder.join('');
32824 # };
32825 #
32826 # // ...
32827 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
32828 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
32829 # the final pixel color is defined by the equation:
32830 #
32831 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
32832 #
32833 # This means that a value of 1.0 corresponds to a solid color, whereas
32834 # a value of 0.0 corresponds to a completely transparent color. This
32835 # uses a wrapper message rather than a simple float scalar so that it is
32836 # possible to distinguish between a default value and the value being unset.
32837 # If omitted, this color object is to be rendered as a solid color
32838 # (as if the alpha value had been explicitly given with a value of 1.0).
32839 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
32840 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
32841 },
32842 "width": 42, # The width of the border, in pixels.
32843 # Border widths must be between 0 and 3 pixels.
32844 "style": "A String", # The style of the border.
32845 },
32846 "bottom": { # A border along a cell. # The bottom border of the cell.
32847 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
32848 # for simplicity of conversion to/from color representations in various
32849 # languages over compactness; for example, the fields of this representation
32850 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
32851 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
32852 # method in iOS; and, with just a little work, it can be easily formatted into
32853 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
32854 #
32855 # Example (Java):
32856 #
32857 # import com.google.type.Color;
32858 #
32859 # // ...
32860 # public static java.awt.Color fromProto(Color protocolor) {
32861 # float alpha = protocolor.hasAlpha()
32862 # ? protocolor.getAlpha().getValue()
32863 # : 1.0;
32864 #
32865 # return new java.awt.Color(
32866 # protocolor.getRed(),
32867 # protocolor.getGreen(),
32868 # protocolor.getBlue(),
32869 # alpha);
32870 # }
32871 #
32872 # public static Color toProto(java.awt.Color color) {
32873 # float red = (float) color.getRed();
32874 # float green = (float) color.getGreen();
32875 # float blue = (float) color.getBlue();
32876 # float denominator = 255.0;
32877 # Color.Builder resultBuilder =
32878 # Color
32879 # .newBuilder()
32880 # .setRed(red / denominator)
32881 # .setGreen(green / denominator)
32882 # .setBlue(blue / denominator);
32883 # int alpha = color.getAlpha();
32884 # if (alpha != 255) {
32885 # result.setAlpha(
32886 # FloatValue
32887 # .newBuilder()
32888 # .setValue(((float) alpha) / denominator)
32889 # .build());
32890 # }
32891 # return resultBuilder.build();
32892 # }
32893 # // ...
32894 #
32895 # Example (iOS / Obj-C):
32896 #
32897 # // ...
32898 # static UIColor* fromProto(Color* protocolor) {
32899 # float red = [protocolor red];
32900 # float green = [protocolor green];
32901 # float blue = [protocolor blue];
32902 # FloatValue* alpha_wrapper = [protocolor alpha];
32903 # float alpha = 1.0;
32904 # if (alpha_wrapper != nil) {
32905 # alpha = [alpha_wrapper value];
32906 # }
32907 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
32908 # }
32909 #
32910 # static Color* toProto(UIColor* color) {
32911 # CGFloat red, green, blue, alpha;
32912 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
32913 # return nil;
32914 # }
32915 # Color* result = [Color alloc] init];
32916 # [result setRed:red];
32917 # [result setGreen:green];
32918 # [result setBlue:blue];
32919 # if (alpha <= 0.9999) {
32920 # [result setAlpha:floatWrapperWithValue(alpha)];
32921 # }
32922 # [result autorelease];
32923 # return result;
32924 # }
32925 # // ...
32926 #
32927 # Example (JavaScript):
32928 #
32929 # // ...
32930 #
32931 # var protoToCssColor = function(rgb_color) {
32932 # var redFrac = rgb_color.red || 0.0;
32933 # var greenFrac = rgb_color.green || 0.0;
32934 # var blueFrac = rgb_color.blue || 0.0;
32935 # var red = Math.floor(redFrac * 255);
32936 # var green = Math.floor(greenFrac * 255);
32937 # var blue = Math.floor(blueFrac * 255);
32938 #
32939 # if (!('alpha' in rgb_color)) {
32940 # return rgbToCssColor_(red, green, blue);
32941 # }
32942 #
32943 # var alphaFrac = rgb_color.alpha.value || 0.0;
32944 # var rgbParams = [red, green, blue].join(',');
32945 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
32946 # };
32947 #
32948 # var rgbToCssColor_ = function(red, green, blue) {
32949 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
32950 # var hexString = rgbNumber.toString(16);
32951 # var missingZeros = 6 - hexString.length;
32952 # var resultBuilder = ['#'];
32953 # for (var i = 0; i < missingZeros; i++) {
32954 # resultBuilder.push('0');
32955 # }
32956 # resultBuilder.push(hexString);
32957 # return resultBuilder.join('');
32958 # };
32959 #
32960 # // ...
32961 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
32962 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
32963 # the final pixel color is defined by the equation:
32964 #
32965 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
32966 #
32967 # This means that a value of 1.0 corresponds to a solid color, whereas
32968 # a value of 0.0 corresponds to a completely transparent color. This
32969 # uses a wrapper message rather than a simple float scalar so that it is
32970 # possible to distinguish between a default value and the value being unset.
32971 # If omitted, this color object is to be rendered as a solid color
32972 # (as if the alpha value had been explicitly given with a value of 1.0).
32973 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
32974 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
32975 },
32976 "width": 42, # The width of the border, in pixels.
32977 # Border widths must be between 0 and 3 pixels.
32978 "style": "A String", # The style of the border.
32979 },
32980 "left": { # A border along a cell. # The left border of the cell.
32981 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
32982 # for simplicity of conversion to/from color representations in various
32983 # languages over compactness; for example, the fields of this representation
32984 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
32985 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
32986 # method in iOS; and, with just a little work, it can be easily formatted into
32987 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
32988 #
32989 # Example (Java):
32990 #
32991 # import com.google.type.Color;
32992 #
32993 # // ...
32994 # public static java.awt.Color fromProto(Color protocolor) {
32995 # float alpha = protocolor.hasAlpha()
32996 # ? protocolor.getAlpha().getValue()
32997 # : 1.0;
32998 #
32999 # return new java.awt.Color(
33000 # protocolor.getRed(),
33001 # protocolor.getGreen(),
33002 # protocolor.getBlue(),
33003 # alpha);
33004 # }
33005 #
33006 # public static Color toProto(java.awt.Color color) {
33007 # float red = (float) color.getRed();
33008 # float green = (float) color.getGreen();
33009 # float blue = (float) color.getBlue();
33010 # float denominator = 255.0;
33011 # Color.Builder resultBuilder =
33012 # Color
33013 # .newBuilder()
33014 # .setRed(red / denominator)
33015 # .setGreen(green / denominator)
33016 # .setBlue(blue / denominator);
33017 # int alpha = color.getAlpha();
33018 # if (alpha != 255) {
33019 # result.setAlpha(
33020 # FloatValue
33021 # .newBuilder()
33022 # .setValue(((float) alpha) / denominator)
33023 # .build());
33024 # }
33025 # return resultBuilder.build();
33026 # }
33027 # // ...
33028 #
33029 # Example (iOS / Obj-C):
33030 #
33031 # // ...
33032 # static UIColor* fromProto(Color* protocolor) {
33033 # float red = [protocolor red];
33034 # float green = [protocolor green];
33035 # float blue = [protocolor blue];
33036 # FloatValue* alpha_wrapper = [protocolor alpha];
33037 # float alpha = 1.0;
33038 # if (alpha_wrapper != nil) {
33039 # alpha = [alpha_wrapper value];
33040 # }
33041 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
33042 # }
33043 #
33044 # static Color* toProto(UIColor* color) {
33045 # CGFloat red, green, blue, alpha;
33046 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
33047 # return nil;
33048 # }
33049 # Color* result = [Color alloc] init];
33050 # [result setRed:red];
33051 # [result setGreen:green];
33052 # [result setBlue:blue];
33053 # if (alpha <= 0.9999) {
33054 # [result setAlpha:floatWrapperWithValue(alpha)];
33055 # }
33056 # [result autorelease];
33057 # return result;
33058 # }
33059 # // ...
33060 #
33061 # Example (JavaScript):
33062 #
33063 # // ...
33064 #
33065 # var protoToCssColor = function(rgb_color) {
33066 # var redFrac = rgb_color.red || 0.0;
33067 # var greenFrac = rgb_color.green || 0.0;
33068 # var blueFrac = rgb_color.blue || 0.0;
33069 # var red = Math.floor(redFrac * 255);
33070 # var green = Math.floor(greenFrac * 255);
33071 # var blue = Math.floor(blueFrac * 255);
33072 #
33073 # if (!('alpha' in rgb_color)) {
33074 # return rgbToCssColor_(red, green, blue);
33075 # }
33076 #
33077 # var alphaFrac = rgb_color.alpha.value || 0.0;
33078 # var rgbParams = [red, green, blue].join(',');
33079 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
33080 # };
33081 #
33082 # var rgbToCssColor_ = function(red, green, blue) {
33083 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
33084 # var hexString = rgbNumber.toString(16);
33085 # var missingZeros = 6 - hexString.length;
33086 # var resultBuilder = ['#'];
33087 # for (var i = 0; i < missingZeros; i++) {
33088 # resultBuilder.push('0');
33089 # }
33090 # resultBuilder.push(hexString);
33091 # return resultBuilder.join('');
33092 # };
33093 #
33094 # // ...
33095 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
33096 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
33097 # the final pixel color is defined by the equation:
33098 #
33099 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
33100 #
33101 # This means that a value of 1.0 corresponds to a solid color, whereas
33102 # a value of 0.0 corresponds to a completely transparent color. This
33103 # uses a wrapper message rather than a simple float scalar so that it is
33104 # possible to distinguish between a default value and the value being unset.
33105 # If omitted, this color object is to be rendered as a solid color
33106 # (as if the alpha value had been explicitly given with a value of 1.0).
33107 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
33108 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
33109 },
33110 "width": 42, # The width of the border, in pixels.
33111 # Border widths must be between 0 and 3 pixels.
33112 "style": "A String", # The style of the border.
33113 },
33114 },
33115 "wrapStrategy": "A String", # The wrap strategy for the value in the cell.
33116 },
33117 "userEnteredFormat": { # The format of a cell. # The format the user entered for the cell.
33118 #
33119 # When writing, the new format will be merged with the existing format.
33120 "numberFormat": { # The number format of a cell. # A format describing how number values should be represented to the user.
33121 # When updating, all fields must be set.
33122 "pattern": "A String", # Pattern string used for formatting.
33123 "type": "A String", # The type of the number format.
33124 },
33125 "textDirection": "A String", # The direction of the text in the cell.
33126 "padding": { # The amount of padding around the cell, in pixels. # The padding of the cell.
33127 # When updating padding, every field must be specified.
33128 "top": 42, # The top padding of the cell.
33129 "right": 42, # The right padding of the cell.
33130 "bottom": 42, # The bottom padding of the cell.
33131 "left": 42, # The left padding of the cell.
33132 },
33133 "horizontalAlignment": "A String", # The horizontal alignment of the value in cell.
33134 "backgroundColor": { # Represents a color in the RGBA color space. This representation is designed # The background color of the cell.
33135 # for simplicity of conversion to/from color representations in various
33136 # languages over compactness; for example, the fields of this representation
33137 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
33138 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
33139 # method in iOS; and, with just a little work, it can be easily formatted into
33140 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
33141 #
33142 # Example (Java):
33143 #
33144 # import com.google.type.Color;
33145 #
33146 # // ...
33147 # public static java.awt.Color fromProto(Color protocolor) {
33148 # float alpha = protocolor.hasAlpha()
33149 # ? protocolor.getAlpha().getValue()
33150 # : 1.0;
33151 #
33152 # return new java.awt.Color(
33153 # protocolor.getRed(),
33154 # protocolor.getGreen(),
33155 # protocolor.getBlue(),
33156 # alpha);
33157 # }
33158 #
33159 # public static Color toProto(java.awt.Color color) {
33160 # float red = (float) color.getRed();
33161 # float green = (float) color.getGreen();
33162 # float blue = (float) color.getBlue();
33163 # float denominator = 255.0;
33164 # Color.Builder resultBuilder =
33165 # Color
33166 # .newBuilder()
33167 # .setRed(red / denominator)
33168 # .setGreen(green / denominator)
33169 # .setBlue(blue / denominator);
33170 # int alpha = color.getAlpha();
33171 # if (alpha != 255) {
33172 # result.setAlpha(
33173 # FloatValue
33174 # .newBuilder()
33175 # .setValue(((float) alpha) / denominator)
33176 # .build());
33177 # }
33178 # return resultBuilder.build();
33179 # }
33180 # // ...
33181 #
33182 # Example (iOS / Obj-C):
33183 #
33184 # // ...
33185 # static UIColor* fromProto(Color* protocolor) {
33186 # float red = [protocolor red];
33187 # float green = [protocolor green];
33188 # float blue = [protocolor blue];
33189 # FloatValue* alpha_wrapper = [protocolor alpha];
33190 # float alpha = 1.0;
33191 # if (alpha_wrapper != nil) {
33192 # alpha = [alpha_wrapper value];
33193 # }
33194 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
33195 # }
33196 #
33197 # static Color* toProto(UIColor* color) {
33198 # CGFloat red, green, blue, alpha;
33199 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
33200 # return nil;
33201 # }
33202 # Color* result = [Color alloc] init];
33203 # [result setRed:red];
33204 # [result setGreen:green];
33205 # [result setBlue:blue];
33206 # if (alpha <= 0.9999) {
33207 # [result setAlpha:floatWrapperWithValue(alpha)];
33208 # }
33209 # [result autorelease];
33210 # return result;
33211 # }
33212 # // ...
33213 #
33214 # Example (JavaScript):
33215 #
33216 # // ...
33217 #
33218 # var protoToCssColor = function(rgb_color) {
33219 # var redFrac = rgb_color.red || 0.0;
33220 # var greenFrac = rgb_color.green || 0.0;
33221 # var blueFrac = rgb_color.blue || 0.0;
33222 # var red = Math.floor(redFrac * 255);
33223 # var green = Math.floor(greenFrac * 255);
33224 # var blue = Math.floor(blueFrac * 255);
33225 #
33226 # if (!('alpha' in rgb_color)) {
33227 # return rgbToCssColor_(red, green, blue);
33228 # }
33229 #
33230 # var alphaFrac = rgb_color.alpha.value || 0.0;
33231 # var rgbParams = [red, green, blue].join(',');
33232 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
33233 # };
33234 #
33235 # var rgbToCssColor_ = function(red, green, blue) {
33236 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
33237 # var hexString = rgbNumber.toString(16);
33238 # var missingZeros = 6 - hexString.length;
33239 # var resultBuilder = ['#'];
33240 # for (var i = 0; i < missingZeros; i++) {
33241 # resultBuilder.push('0');
33242 # }
33243 # resultBuilder.push(hexString);
33244 # return resultBuilder.join('');
33245 # };
33246 #
33247 # // ...
33248 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
33249 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
33250 # the final pixel color is defined by the equation:
33251 #
33252 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
33253 #
33254 # This means that a value of 1.0 corresponds to a solid color, whereas
33255 # a value of 0.0 corresponds to a completely transparent color. This
33256 # uses a wrapper message rather than a simple float scalar so that it is
33257 # possible to distinguish between a default value and the value being unset.
33258 # If omitted, this color object is to be rendered as a solid color
33259 # (as if the alpha value had been explicitly given with a value of 1.0).
33260 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
33261 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
33262 },
33263 "verticalAlignment": "A String", # The vertical alignment of the value in cell.
33264 "textFormat": { # The format of a run of text in a cell. # The format of the text in the cell (unless overridden by a format run).
33265 # Absent values indicate that the field isn't specified.
33266 "foregroundColor": { # Represents a color in the RGBA color space. This representation is designed # The foreground color of the text.
33267 # for simplicity of conversion to/from color representations in various
33268 # languages over compactness; for example, the fields of this representation
33269 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
33270 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
33271 # method in iOS; and, with just a little work, it can be easily formatted into
33272 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
33273 #
33274 # Example (Java):
33275 #
33276 # import com.google.type.Color;
33277 #
33278 # // ...
33279 # public static java.awt.Color fromProto(Color protocolor) {
33280 # float alpha = protocolor.hasAlpha()
33281 # ? protocolor.getAlpha().getValue()
33282 # : 1.0;
33283 #
33284 # return new java.awt.Color(
33285 # protocolor.getRed(),
33286 # protocolor.getGreen(),
33287 # protocolor.getBlue(),
33288 # alpha);
33289 # }
33290 #
33291 # public static Color toProto(java.awt.Color color) {
33292 # float red = (float) color.getRed();
33293 # float green = (float) color.getGreen();
33294 # float blue = (float) color.getBlue();
33295 # float denominator = 255.0;
33296 # Color.Builder resultBuilder =
33297 # Color
33298 # .newBuilder()
33299 # .setRed(red / denominator)
33300 # .setGreen(green / denominator)
33301 # .setBlue(blue / denominator);
33302 # int alpha = color.getAlpha();
33303 # if (alpha != 255) {
33304 # result.setAlpha(
33305 # FloatValue
33306 # .newBuilder()
33307 # .setValue(((float) alpha) / denominator)
33308 # .build());
33309 # }
33310 # return resultBuilder.build();
33311 # }
33312 # // ...
33313 #
33314 # Example (iOS / Obj-C):
33315 #
33316 # // ...
33317 # static UIColor* fromProto(Color* protocolor) {
33318 # float red = [protocolor red];
33319 # float green = [protocolor green];
33320 # float blue = [protocolor blue];
33321 # FloatValue* alpha_wrapper = [protocolor alpha];
33322 # float alpha = 1.0;
33323 # if (alpha_wrapper != nil) {
33324 # alpha = [alpha_wrapper value];
33325 # }
33326 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
33327 # }
33328 #
33329 # static Color* toProto(UIColor* color) {
33330 # CGFloat red, green, blue, alpha;
33331 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
33332 # return nil;
33333 # }
33334 # Color* result = [Color alloc] init];
33335 # [result setRed:red];
33336 # [result setGreen:green];
33337 # [result setBlue:blue];
33338 # if (alpha <= 0.9999) {
33339 # [result setAlpha:floatWrapperWithValue(alpha)];
33340 # }
33341 # [result autorelease];
33342 # return result;
33343 # }
33344 # // ...
33345 #
33346 # Example (JavaScript):
33347 #
33348 # // ...
33349 #
33350 # var protoToCssColor = function(rgb_color) {
33351 # var redFrac = rgb_color.red || 0.0;
33352 # var greenFrac = rgb_color.green || 0.0;
33353 # var blueFrac = rgb_color.blue || 0.0;
33354 # var red = Math.floor(redFrac * 255);
33355 # var green = Math.floor(greenFrac * 255);
33356 # var blue = Math.floor(blueFrac * 255);
33357 #
33358 # if (!('alpha' in rgb_color)) {
33359 # return rgbToCssColor_(red, green, blue);
33360 # }
33361 #
33362 # var alphaFrac = rgb_color.alpha.value || 0.0;
33363 # var rgbParams = [red, green, blue].join(',');
33364 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
33365 # };
33366 #
33367 # var rgbToCssColor_ = function(red, green, blue) {
33368 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
33369 # var hexString = rgbNumber.toString(16);
33370 # var missingZeros = 6 - hexString.length;
33371 # var resultBuilder = ['#'];
33372 # for (var i = 0; i < missingZeros; i++) {
33373 # resultBuilder.push('0');
33374 # }
33375 # resultBuilder.push(hexString);
33376 # return resultBuilder.join('');
33377 # };
33378 #
33379 # // ...
33380 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
33381 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
33382 # the final pixel color is defined by the equation:
33383 #
33384 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
33385 #
33386 # This means that a value of 1.0 corresponds to a solid color, whereas
33387 # a value of 0.0 corresponds to a completely transparent color. This
33388 # uses a wrapper message rather than a simple float scalar so that it is
33389 # possible to distinguish between a default value and the value being unset.
33390 # If omitted, this color object is to be rendered as a solid color
33391 # (as if the alpha value had been explicitly given with a value of 1.0).
33392 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
33393 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
33394 },
33395 "bold": True or False, # True if the text is bold.
33396 "strikethrough": True or False, # True if the text has a strikethrough.
33397 "fontFamily": "A String", # The font family.
33398 "fontSize": 42, # The size of the font.
33399 "italic": True or False, # True if the text is italicized.
33400 "underline": True or False, # True if the text is underlined.
33401 },
33402 "hyperlinkDisplayType": "A String", # How a hyperlink, if it exists, should be displayed in the cell.
33403 "borders": { # The borders of the cell. # The borders of the cell.
33404 "top": { # A border along a cell. # The top border of the cell.
33405 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
33406 # for simplicity of conversion to/from color representations in various
33407 # languages over compactness; for example, the fields of this representation
33408 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
33409 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
33410 # method in iOS; and, with just a little work, it can be easily formatted into
33411 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
33412 #
33413 # Example (Java):
33414 #
33415 # import com.google.type.Color;
33416 #
33417 # // ...
33418 # public static java.awt.Color fromProto(Color protocolor) {
33419 # float alpha = protocolor.hasAlpha()
33420 # ? protocolor.getAlpha().getValue()
33421 # : 1.0;
33422 #
33423 # return new java.awt.Color(
33424 # protocolor.getRed(),
33425 # protocolor.getGreen(),
33426 # protocolor.getBlue(),
33427 # alpha);
33428 # }
33429 #
33430 # public static Color toProto(java.awt.Color color) {
33431 # float red = (float) color.getRed();
33432 # float green = (float) color.getGreen();
33433 # float blue = (float) color.getBlue();
33434 # float denominator = 255.0;
33435 # Color.Builder resultBuilder =
33436 # Color
33437 # .newBuilder()
33438 # .setRed(red / denominator)
33439 # .setGreen(green / denominator)
33440 # .setBlue(blue / denominator);
33441 # int alpha = color.getAlpha();
33442 # if (alpha != 255) {
33443 # result.setAlpha(
33444 # FloatValue
33445 # .newBuilder()
33446 # .setValue(((float) alpha) / denominator)
33447 # .build());
33448 # }
33449 # return resultBuilder.build();
33450 # }
33451 # // ...
33452 #
33453 # Example (iOS / Obj-C):
33454 #
33455 # // ...
33456 # static UIColor* fromProto(Color* protocolor) {
33457 # float red = [protocolor red];
33458 # float green = [protocolor green];
33459 # float blue = [protocolor blue];
33460 # FloatValue* alpha_wrapper = [protocolor alpha];
33461 # float alpha = 1.0;
33462 # if (alpha_wrapper != nil) {
33463 # alpha = [alpha_wrapper value];
33464 # }
33465 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
33466 # }
33467 #
33468 # static Color* toProto(UIColor* color) {
33469 # CGFloat red, green, blue, alpha;
33470 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
33471 # return nil;
33472 # }
33473 # Color* result = [Color alloc] init];
33474 # [result setRed:red];
33475 # [result setGreen:green];
33476 # [result setBlue:blue];
33477 # if (alpha <= 0.9999) {
33478 # [result setAlpha:floatWrapperWithValue(alpha)];
33479 # }
33480 # [result autorelease];
33481 # return result;
33482 # }
33483 # // ...
33484 #
33485 # Example (JavaScript):
33486 #
33487 # // ...
33488 #
33489 # var protoToCssColor = function(rgb_color) {
33490 # var redFrac = rgb_color.red || 0.0;
33491 # var greenFrac = rgb_color.green || 0.0;
33492 # var blueFrac = rgb_color.blue || 0.0;
33493 # var red = Math.floor(redFrac * 255);
33494 # var green = Math.floor(greenFrac * 255);
33495 # var blue = Math.floor(blueFrac * 255);
33496 #
33497 # if (!('alpha' in rgb_color)) {
33498 # return rgbToCssColor_(red, green, blue);
33499 # }
33500 #
33501 # var alphaFrac = rgb_color.alpha.value || 0.0;
33502 # var rgbParams = [red, green, blue].join(',');
33503 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
33504 # };
33505 #
33506 # var rgbToCssColor_ = function(red, green, blue) {
33507 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
33508 # var hexString = rgbNumber.toString(16);
33509 # var missingZeros = 6 - hexString.length;
33510 # var resultBuilder = ['#'];
33511 # for (var i = 0; i < missingZeros; i++) {
33512 # resultBuilder.push('0');
33513 # }
33514 # resultBuilder.push(hexString);
33515 # return resultBuilder.join('');
33516 # };
33517 #
33518 # // ...
33519 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
33520 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
33521 # the final pixel color is defined by the equation:
33522 #
33523 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
33524 #
33525 # This means that a value of 1.0 corresponds to a solid color, whereas
33526 # a value of 0.0 corresponds to a completely transparent color. This
33527 # uses a wrapper message rather than a simple float scalar so that it is
33528 # possible to distinguish between a default value and the value being unset.
33529 # If omitted, this color object is to be rendered as a solid color
33530 # (as if the alpha value had been explicitly given with a value of 1.0).
33531 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
33532 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
33533 },
33534 "width": 42, # The width of the border, in pixels.
33535 # Border widths must be between 0 and 3 pixels.
33536 "style": "A String", # The style of the border.
33537 },
33538 "right": { # A border along a cell. # The right border of the cell.
33539 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
33540 # for simplicity of conversion to/from color representations in various
33541 # languages over compactness; for example, the fields of this representation
33542 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
33543 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
33544 # method in iOS; and, with just a little work, it can be easily formatted into
33545 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
33546 #
33547 # Example (Java):
33548 #
33549 # import com.google.type.Color;
33550 #
33551 # // ...
33552 # public static java.awt.Color fromProto(Color protocolor) {
33553 # float alpha = protocolor.hasAlpha()
33554 # ? protocolor.getAlpha().getValue()
33555 # : 1.0;
33556 #
33557 # return new java.awt.Color(
33558 # protocolor.getRed(),
33559 # protocolor.getGreen(),
33560 # protocolor.getBlue(),
33561 # alpha);
33562 # }
33563 #
33564 # public static Color toProto(java.awt.Color color) {
33565 # float red = (float) color.getRed();
33566 # float green = (float) color.getGreen();
33567 # float blue = (float) color.getBlue();
33568 # float denominator = 255.0;
33569 # Color.Builder resultBuilder =
33570 # Color
33571 # .newBuilder()
33572 # .setRed(red / denominator)
33573 # .setGreen(green / denominator)
33574 # .setBlue(blue / denominator);
33575 # int alpha = color.getAlpha();
33576 # if (alpha != 255) {
33577 # result.setAlpha(
33578 # FloatValue
33579 # .newBuilder()
33580 # .setValue(((float) alpha) / denominator)
33581 # .build());
33582 # }
33583 # return resultBuilder.build();
33584 # }
33585 # // ...
33586 #
33587 # Example (iOS / Obj-C):
33588 #
33589 # // ...
33590 # static UIColor* fromProto(Color* protocolor) {
33591 # float red = [protocolor red];
33592 # float green = [protocolor green];
33593 # float blue = [protocolor blue];
33594 # FloatValue* alpha_wrapper = [protocolor alpha];
33595 # float alpha = 1.0;
33596 # if (alpha_wrapper != nil) {
33597 # alpha = [alpha_wrapper value];
33598 # }
33599 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
33600 # }
33601 #
33602 # static Color* toProto(UIColor* color) {
33603 # CGFloat red, green, blue, alpha;
33604 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
33605 # return nil;
33606 # }
33607 # Color* result = [Color alloc] init];
33608 # [result setRed:red];
33609 # [result setGreen:green];
33610 # [result setBlue:blue];
33611 # if (alpha <= 0.9999) {
33612 # [result setAlpha:floatWrapperWithValue(alpha)];
33613 # }
33614 # [result autorelease];
33615 # return result;
33616 # }
33617 # // ...
33618 #
33619 # Example (JavaScript):
33620 #
33621 # // ...
33622 #
33623 # var protoToCssColor = function(rgb_color) {
33624 # var redFrac = rgb_color.red || 0.0;
33625 # var greenFrac = rgb_color.green || 0.0;
33626 # var blueFrac = rgb_color.blue || 0.0;
33627 # var red = Math.floor(redFrac * 255);
33628 # var green = Math.floor(greenFrac * 255);
33629 # var blue = Math.floor(blueFrac * 255);
33630 #
33631 # if (!('alpha' in rgb_color)) {
33632 # return rgbToCssColor_(red, green, blue);
33633 # }
33634 #
33635 # var alphaFrac = rgb_color.alpha.value || 0.0;
33636 # var rgbParams = [red, green, blue].join(',');
33637 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
33638 # };
33639 #
33640 # var rgbToCssColor_ = function(red, green, blue) {
33641 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
33642 # var hexString = rgbNumber.toString(16);
33643 # var missingZeros = 6 - hexString.length;
33644 # var resultBuilder = ['#'];
33645 # for (var i = 0; i < missingZeros; i++) {
33646 # resultBuilder.push('0');
33647 # }
33648 # resultBuilder.push(hexString);
33649 # return resultBuilder.join('');
33650 # };
33651 #
33652 # // ...
33653 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
33654 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
33655 # the final pixel color is defined by the equation:
33656 #
33657 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
33658 #
33659 # This means that a value of 1.0 corresponds to a solid color, whereas
33660 # a value of 0.0 corresponds to a completely transparent color. This
33661 # uses a wrapper message rather than a simple float scalar so that it is
33662 # possible to distinguish between a default value and the value being unset.
33663 # If omitted, this color object is to be rendered as a solid color
33664 # (as if the alpha value had been explicitly given with a value of 1.0).
33665 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
33666 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
33667 },
33668 "width": 42, # The width of the border, in pixels.
33669 # Border widths must be between 0 and 3 pixels.
33670 "style": "A String", # The style of the border.
33671 },
33672 "bottom": { # A border along a cell. # The bottom border of the cell.
33673 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
33674 # for simplicity of conversion to/from color representations in various
33675 # languages over compactness; for example, the fields of this representation
33676 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
33677 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
33678 # method in iOS; and, with just a little work, it can be easily formatted into
33679 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
33680 #
33681 # Example (Java):
33682 #
33683 # import com.google.type.Color;
33684 #
33685 # // ...
33686 # public static java.awt.Color fromProto(Color protocolor) {
33687 # float alpha = protocolor.hasAlpha()
33688 # ? protocolor.getAlpha().getValue()
33689 # : 1.0;
33690 #
33691 # return new java.awt.Color(
33692 # protocolor.getRed(),
33693 # protocolor.getGreen(),
33694 # protocolor.getBlue(),
33695 # alpha);
33696 # }
33697 #
33698 # public static Color toProto(java.awt.Color color) {
33699 # float red = (float) color.getRed();
33700 # float green = (float) color.getGreen();
33701 # float blue = (float) color.getBlue();
33702 # float denominator = 255.0;
33703 # Color.Builder resultBuilder =
33704 # Color
33705 # .newBuilder()
33706 # .setRed(red / denominator)
33707 # .setGreen(green / denominator)
33708 # .setBlue(blue / denominator);
33709 # int alpha = color.getAlpha();
33710 # if (alpha != 255) {
33711 # result.setAlpha(
33712 # FloatValue
33713 # .newBuilder()
33714 # .setValue(((float) alpha) / denominator)
33715 # .build());
33716 # }
33717 # return resultBuilder.build();
33718 # }
33719 # // ...
33720 #
33721 # Example (iOS / Obj-C):
33722 #
33723 # // ...
33724 # static UIColor* fromProto(Color* protocolor) {
33725 # float red = [protocolor red];
33726 # float green = [protocolor green];
33727 # float blue = [protocolor blue];
33728 # FloatValue* alpha_wrapper = [protocolor alpha];
33729 # float alpha = 1.0;
33730 # if (alpha_wrapper != nil) {
33731 # alpha = [alpha_wrapper value];
33732 # }
33733 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
33734 # }
33735 #
33736 # static Color* toProto(UIColor* color) {
33737 # CGFloat red, green, blue, alpha;
33738 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
33739 # return nil;
33740 # }
33741 # Color* result = [Color alloc] init];
33742 # [result setRed:red];
33743 # [result setGreen:green];
33744 # [result setBlue:blue];
33745 # if (alpha <= 0.9999) {
33746 # [result setAlpha:floatWrapperWithValue(alpha)];
33747 # }
33748 # [result autorelease];
33749 # return result;
33750 # }
33751 # // ...
33752 #
33753 # Example (JavaScript):
33754 #
33755 # // ...
33756 #
33757 # var protoToCssColor = function(rgb_color) {
33758 # var redFrac = rgb_color.red || 0.0;
33759 # var greenFrac = rgb_color.green || 0.0;
33760 # var blueFrac = rgb_color.blue || 0.0;
33761 # var red = Math.floor(redFrac * 255);
33762 # var green = Math.floor(greenFrac * 255);
33763 # var blue = Math.floor(blueFrac * 255);
33764 #
33765 # if (!('alpha' in rgb_color)) {
33766 # return rgbToCssColor_(red, green, blue);
33767 # }
33768 #
33769 # var alphaFrac = rgb_color.alpha.value || 0.0;
33770 # var rgbParams = [red, green, blue].join(',');
33771 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
33772 # };
33773 #
33774 # var rgbToCssColor_ = function(red, green, blue) {
33775 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
33776 # var hexString = rgbNumber.toString(16);
33777 # var missingZeros = 6 - hexString.length;
33778 # var resultBuilder = ['#'];
33779 # for (var i = 0; i < missingZeros; i++) {
33780 # resultBuilder.push('0');
33781 # }
33782 # resultBuilder.push(hexString);
33783 # return resultBuilder.join('');
33784 # };
33785 #
33786 # // ...
33787 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
33788 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
33789 # the final pixel color is defined by the equation:
33790 #
33791 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
33792 #
33793 # This means that a value of 1.0 corresponds to a solid color, whereas
33794 # a value of 0.0 corresponds to a completely transparent color. This
33795 # uses a wrapper message rather than a simple float scalar so that it is
33796 # possible to distinguish between a default value and the value being unset.
33797 # If omitted, this color object is to be rendered as a solid color
33798 # (as if the alpha value had been explicitly given with a value of 1.0).
33799 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
33800 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
33801 },
33802 "width": 42, # The width of the border, in pixels.
33803 # Border widths must be between 0 and 3 pixels.
33804 "style": "A String", # The style of the border.
33805 },
33806 "left": { # A border along a cell. # The left border of the cell.
33807 "color": { # Represents a color in the RGBA color space. This representation is designed # The color of the border.
33808 # for simplicity of conversion to/from color representations in various
33809 # languages over compactness; for example, the fields of this representation
33810 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
33811 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
33812 # method in iOS; and, with just a little work, it can be easily formatted into
33813 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
33814 #
33815 # Example (Java):
33816 #
33817 # import com.google.type.Color;
33818 #
33819 # // ...
33820 # public static java.awt.Color fromProto(Color protocolor) {
33821 # float alpha = protocolor.hasAlpha()
33822 # ? protocolor.getAlpha().getValue()
33823 # : 1.0;
33824 #
33825 # return new java.awt.Color(
33826 # protocolor.getRed(),
33827 # protocolor.getGreen(),
33828 # protocolor.getBlue(),
33829 # alpha);
33830 # }
33831 #
33832 # public static Color toProto(java.awt.Color color) {
33833 # float red = (float) color.getRed();
33834 # float green = (float) color.getGreen();
33835 # float blue = (float) color.getBlue();
33836 # float denominator = 255.0;
33837 # Color.Builder resultBuilder =
33838 # Color
33839 # .newBuilder()
33840 # .setRed(red / denominator)
33841 # .setGreen(green / denominator)
33842 # .setBlue(blue / denominator);
33843 # int alpha = color.getAlpha();
33844 # if (alpha != 255) {
33845 # result.setAlpha(
33846 # FloatValue
33847 # .newBuilder()
33848 # .setValue(((float) alpha) / denominator)
33849 # .build());
33850 # }
33851 # return resultBuilder.build();
33852 # }
33853 # // ...
33854 #
33855 # Example (iOS / Obj-C):
33856 #
33857 # // ...
33858 # static UIColor* fromProto(Color* protocolor) {
33859 # float red = [protocolor red];
33860 # float green = [protocolor green];
33861 # float blue = [protocolor blue];
33862 # FloatValue* alpha_wrapper = [protocolor alpha];
33863 # float alpha = 1.0;
33864 # if (alpha_wrapper != nil) {
33865 # alpha = [alpha_wrapper value];
33866 # }
33867 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
33868 # }
33869 #
33870 # static Color* toProto(UIColor* color) {
33871 # CGFloat red, green, blue, alpha;
33872 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
33873 # return nil;
33874 # }
33875 # Color* result = [Color alloc] init];
33876 # [result setRed:red];
33877 # [result setGreen:green];
33878 # [result setBlue:blue];
33879 # if (alpha <= 0.9999) {
33880 # [result setAlpha:floatWrapperWithValue(alpha)];
33881 # }
33882 # [result autorelease];
33883 # return result;
33884 # }
33885 # // ...
33886 #
33887 # Example (JavaScript):
33888 #
33889 # // ...
33890 #
33891 # var protoToCssColor = function(rgb_color) {
33892 # var redFrac = rgb_color.red || 0.0;
33893 # var greenFrac = rgb_color.green || 0.0;
33894 # var blueFrac = rgb_color.blue || 0.0;
33895 # var red = Math.floor(redFrac * 255);
33896 # var green = Math.floor(greenFrac * 255);
33897 # var blue = Math.floor(blueFrac * 255);
33898 #
33899 # if (!('alpha' in rgb_color)) {
33900 # return rgbToCssColor_(red, green, blue);
33901 # }
33902 #
33903 # var alphaFrac = rgb_color.alpha.value || 0.0;
33904 # var rgbParams = [red, green, blue].join(',');
33905 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
33906 # };
33907 #
33908 # var rgbToCssColor_ = function(red, green, blue) {
33909 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
33910 # var hexString = rgbNumber.toString(16);
33911 # var missingZeros = 6 - hexString.length;
33912 # var resultBuilder = ['#'];
33913 # for (var i = 0; i < missingZeros; i++) {
33914 # resultBuilder.push('0');
33915 # }
33916 # resultBuilder.push(hexString);
33917 # return resultBuilder.join('');
33918 # };
33919 #
33920 # // ...
33921 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
33922 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
33923 # the final pixel color is defined by the equation:
33924 #
33925 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
33926 #
33927 # This means that a value of 1.0 corresponds to a solid color, whereas
33928 # a value of 0.0 corresponds to a completely transparent color. This
33929 # uses a wrapper message rather than a simple float scalar so that it is
33930 # possible to distinguish between a default value and the value being unset.
33931 # If omitted, this color object is to be rendered as a solid color
33932 # (as if the alpha value had been explicitly given with a value of 1.0).
33933 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
33934 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
33935 },
33936 "width": 42, # The width of the border, in pixels.
33937 # Border widths must be between 0 and 3 pixels.
33938 "style": "A String", # The style of the border.
33939 },
33940 },
33941 "wrapStrategy": "A String", # The wrap strategy for the value in the cell.
33942 },
33943 "dataValidation": { # A data validation rule. # A data validation rule on the cell, if any.
33944 #
33945 # When writing, the new data validation rule will overwrite any prior rule.
33946 "showCustomUi": True or False, # True if the UI should be customized based on the kind of condition.
33947 # If true, "List" conditions will show a dropdown.
33948 "strict": True or False, # True if invalid data should be rejected.
33949 "inputMessage": "A String", # A message to show the user when adding data to the cell.
33950 "condition": { # A condition that can evaluate to true or false. # The condition that data in the cell must match.
33951 # BooleanConditions are used by conditional formatting,
33952 # data validation, and the criteria in filters.
33953 "type": "A String", # The type of condition.
33954 "values": [ # The values of the condition. The number of supported values depends
33955 # on the condition type. Some support zero values,
33956 # others one or two values,
33957 # and ConditionType.ONE_OF_LIST supports an arbitrary number of values.
33958 { # The value of the condition.
33959 "relativeDate": "A String", # A relative date (based on the current date).
33960 # Valid only if the type is
33961 # DATE_BEFORE,
33962 # DATE_AFTER,
33963 # DATE_ON_OR_BEFORE or
33964 # DATE_ON_OR_AFTER.
33965 #
33966 # Relative dates are not supported in data validation.
33967 # They are supported only in conditional formatting and
33968 # conditional filters.
33969 "userEnteredValue": "A String", # A value the condition is based on.
33970 # The value will be parsed as if the user typed into a cell.
33971 # Formulas are supported (and must begin with an `=`).
33972 },
33973 ],
33974 },
33975 },
33976 "textFormatRuns": [ # Runs of rich text applied to subsections of the cell.
33977 # Runs start at specific indexes in the text and continue until the next
33978 # run. Properties of a run will continue unless explicitly changed
33979 # in a subsequent run (and properties of the first run will continue
33980 # the properties of the cell unless explicitly changed).
33981 #
33982 # When writing, the new runs will overwrite any prior runs.
33983 { # A run of a text format. The format of this run continues until explicitly
33984 # overridden in the next run.
33985 # When updating, all fields must be set.
33986 "startIndex": 42, # The character index where this run starts.
33987 "format": { # The format of a run of text in a cell. # The format of this run. Absent values inherit the cell's format.
33988 # Absent values indicate that the field isn't specified.
33989 "foregroundColor": { # Represents a color in the RGBA color space. This representation is designed # The foreground color of the text.
33990 # for simplicity of conversion to/from color representations in various
33991 # languages over compactness; for example, the fields of this representation
33992 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
33993 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
33994 # method in iOS; and, with just a little work, it can be easily formatted into
33995 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
33996 #
33997 # Example (Java):
33998 #
33999 # import com.google.type.Color;
34000 #
34001 # // ...
34002 # public static java.awt.Color fromProto(Color protocolor) {
34003 # float alpha = protocolor.hasAlpha()
34004 # ? protocolor.getAlpha().getValue()
34005 # : 1.0;
34006 #
34007 # return new java.awt.Color(
34008 # protocolor.getRed(),
34009 # protocolor.getGreen(),
34010 # protocolor.getBlue(),
34011 # alpha);
34012 # }
34013 #
34014 # public static Color toProto(java.awt.Color color) {
34015 # float red = (float) color.getRed();
34016 # float green = (float) color.getGreen();
34017 # float blue = (float) color.getBlue();
34018 # float denominator = 255.0;
34019 # Color.Builder resultBuilder =
34020 # Color
34021 # .newBuilder()
34022 # .setRed(red / denominator)
34023 # .setGreen(green / denominator)
34024 # .setBlue(blue / denominator);
34025 # int alpha = color.getAlpha();
34026 # if (alpha != 255) {
34027 # result.setAlpha(
34028 # FloatValue
34029 # .newBuilder()
34030 # .setValue(((float) alpha) / denominator)
34031 # .build());
34032 # }
34033 # return resultBuilder.build();
34034 # }
34035 # // ...
34036 #
34037 # Example (iOS / Obj-C):
34038 #
34039 # // ...
34040 # static UIColor* fromProto(Color* protocolor) {
34041 # float red = [protocolor red];
34042 # float green = [protocolor green];
34043 # float blue = [protocolor blue];
34044 # FloatValue* alpha_wrapper = [protocolor alpha];
34045 # float alpha = 1.0;
34046 # if (alpha_wrapper != nil) {
34047 # alpha = [alpha_wrapper value];
34048 # }
34049 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
34050 # }
34051 #
34052 # static Color* toProto(UIColor* color) {
34053 # CGFloat red, green, blue, alpha;
34054 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
34055 # return nil;
34056 # }
34057 # Color* result = [Color alloc] init];
34058 # [result setRed:red];
34059 # [result setGreen:green];
34060 # [result setBlue:blue];
34061 # if (alpha <= 0.9999) {
34062 # [result setAlpha:floatWrapperWithValue(alpha)];
34063 # }
34064 # [result autorelease];
34065 # return result;
34066 # }
34067 # // ...
34068 #
34069 # Example (JavaScript):
34070 #
34071 # // ...
34072 #
34073 # var protoToCssColor = function(rgb_color) {
34074 # var redFrac = rgb_color.red || 0.0;
34075 # var greenFrac = rgb_color.green || 0.0;
34076 # var blueFrac = rgb_color.blue || 0.0;
34077 # var red = Math.floor(redFrac * 255);
34078 # var green = Math.floor(greenFrac * 255);
34079 # var blue = Math.floor(blueFrac * 255);
34080 #
34081 # if (!('alpha' in rgb_color)) {
34082 # return rgbToCssColor_(red, green, blue);
34083 # }
34084 #
34085 # var alphaFrac = rgb_color.alpha.value || 0.0;
34086 # var rgbParams = [red, green, blue].join(',');
34087 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
34088 # };
34089 #
34090 # var rgbToCssColor_ = function(red, green, blue) {
34091 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
34092 # var hexString = rgbNumber.toString(16);
34093 # var missingZeros = 6 - hexString.length;
34094 # var resultBuilder = ['#'];
34095 # for (var i = 0; i < missingZeros; i++) {
34096 # resultBuilder.push('0');
34097 # }
34098 # resultBuilder.push(hexString);
34099 # return resultBuilder.join('');
34100 # };
34101 #
34102 # // ...
34103 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
34104 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
34105 # the final pixel color is defined by the equation:
34106 #
34107 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
34108 #
34109 # This means that a value of 1.0 corresponds to a solid color, whereas
34110 # a value of 0.0 corresponds to a completely transparent color. This
34111 # uses a wrapper message rather than a simple float scalar so that it is
34112 # possible to distinguish between a default value and the value being unset.
34113 # If omitted, this color object is to be rendered as a solid color
34114 # (as if the alpha value had been explicitly given with a value of 1.0).
34115 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
34116 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
34117 },
34118 "bold": True or False, # True if the text is bold.
34119 "strikethrough": True or False, # True if the text has a strikethrough.
34120 "fontFamily": "A String", # The font family.
34121 "fontSize": 42, # The size of the font.
34122 "italic": True or False, # True if the text is italicized.
34123 "underline": True or False, # True if the text is underlined.
34124 },
34125 },
34126 ],
34127 },
34128 ],
34129 },
34130 ],
34131 },
34132 ],
34133 "properties": { # Properties of a sheet. # The properties of the sheet.
34134 "sheetType": "A String", # The type of sheet. Defaults to GRID.
34135 # This field cannot be changed once set.
34136 "index": 42, # The index of the sheet within the spreadsheet.
34137 # When adding or updating sheet properties, if this field
34138 # is excluded then the sheet will be added or moved to the end
34139 # of the sheet list.
34140 "title": "A String", # The name of the sheet.
34141 "gridProperties": { # Properties of a grid. # Additional properties of the sheet if this sheet is a grid.
34142 # (If the sheet is an object sheet, containing a chart or image, then
34143 # this field will be absent.)
34144 # When writing it is an error to set any grid properties on non-grid sheets.
34145 "columnCount": 42, # The number of columns in the grid.
34146 "rowCount": 42, # The number of rows in the grid.
34147 "frozenColumnCount": 42, # The number of columns that are frozen in the grid.
34148 "hideGridlines": True or False, # True if the grid isn't showing gridlines in the UI.
34149 "frozenRowCount": 42, # The number of rows that are frozen in the grid.
34150 },
34151 "rightToLeft": True or False, # True if the sheet is an RTL sheet instead of an LTR sheet.
34152 "tabColor": { # Represents a color in the RGBA color space. This representation is designed # The color of the tab in the UI.
34153 # for simplicity of conversion to/from color representations in various
34154 # languages over compactness; for example, the fields of this representation
34155 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
34156 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
34157 # method in iOS; and, with just a little work, it can be easily formatted into
34158 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
34159 #
34160 # Example (Java):
34161 #
34162 # import com.google.type.Color;
34163 #
34164 # // ...
34165 # public static java.awt.Color fromProto(Color protocolor) {
34166 # float alpha = protocolor.hasAlpha()
34167 # ? protocolor.getAlpha().getValue()
34168 # : 1.0;
34169 #
34170 # return new java.awt.Color(
34171 # protocolor.getRed(),
34172 # protocolor.getGreen(),
34173 # protocolor.getBlue(),
34174 # alpha);
34175 # }
34176 #
34177 # public static Color toProto(java.awt.Color color) {
34178 # float red = (float) color.getRed();
34179 # float green = (float) color.getGreen();
34180 # float blue = (float) color.getBlue();
34181 # float denominator = 255.0;
34182 # Color.Builder resultBuilder =
34183 # Color
34184 # .newBuilder()
34185 # .setRed(red / denominator)
34186 # .setGreen(green / denominator)
34187 # .setBlue(blue / denominator);
34188 # int alpha = color.getAlpha();
34189 # if (alpha != 255) {
34190 # result.setAlpha(
34191 # FloatValue
34192 # .newBuilder()
34193 # .setValue(((float) alpha) / denominator)
34194 # .build());
34195 # }
34196 # return resultBuilder.build();
34197 # }
34198 # // ...
34199 #
34200 # Example (iOS / Obj-C):
34201 #
34202 # // ...
34203 # static UIColor* fromProto(Color* protocolor) {
34204 # float red = [protocolor red];
34205 # float green = [protocolor green];
34206 # float blue = [protocolor blue];
34207 # FloatValue* alpha_wrapper = [protocolor alpha];
34208 # float alpha = 1.0;
34209 # if (alpha_wrapper != nil) {
34210 # alpha = [alpha_wrapper value];
34211 # }
34212 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
34213 # }
34214 #
34215 # static Color* toProto(UIColor* color) {
34216 # CGFloat red, green, blue, alpha;
34217 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
34218 # return nil;
34219 # }
34220 # Color* result = [Color alloc] init];
34221 # [result setRed:red];
34222 # [result setGreen:green];
34223 # [result setBlue:blue];
34224 # if (alpha <= 0.9999) {
34225 # [result setAlpha:floatWrapperWithValue(alpha)];
34226 # }
34227 # [result autorelease];
34228 # return result;
34229 # }
34230 # // ...
34231 #
34232 # Example (JavaScript):
34233 #
34234 # // ...
34235 #
34236 # var protoToCssColor = function(rgb_color) {
34237 # var redFrac = rgb_color.red || 0.0;
34238 # var greenFrac = rgb_color.green || 0.0;
34239 # var blueFrac = rgb_color.blue || 0.0;
34240 # var red = Math.floor(redFrac * 255);
34241 # var green = Math.floor(greenFrac * 255);
34242 # var blue = Math.floor(blueFrac * 255);
34243 #
34244 # if (!('alpha' in rgb_color)) {
34245 # return rgbToCssColor_(red, green, blue);
34246 # }
34247 #
34248 # var alphaFrac = rgb_color.alpha.value || 0.0;
34249 # var rgbParams = [red, green, blue].join(',');
34250 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
34251 # };
34252 #
34253 # var rgbToCssColor_ = function(red, green, blue) {
34254 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
34255 # var hexString = rgbNumber.toString(16);
34256 # var missingZeros = 6 - hexString.length;
34257 # var resultBuilder = ['#'];
34258 # for (var i = 0; i < missingZeros; i++) {
34259 # resultBuilder.push('0');
34260 # }
34261 # resultBuilder.push(hexString);
34262 # return resultBuilder.join('');
34263 # };
34264 #
34265 # // ...
34266 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
34267 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
34268 # the final pixel color is defined by the equation:
34269 #
34270 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
34271 #
34272 # This means that a value of 1.0 corresponds to a solid color, whereas
34273 # a value of 0.0 corresponds to a completely transparent color. This
34274 # uses a wrapper message rather than a simple float scalar so that it is
34275 # possible to distinguish between a default value and the value being unset.
34276 # If omitted, this color object is to be rendered as a solid color
34277 # (as if the alpha value had been explicitly given with a value of 1.0).
34278 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
34279 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
34280 },
34281 "hidden": True or False, # True if the sheet is hidden in the UI, false if it's visible.
34282 "sheetId": 42, # The ID of the sheet. Must be non-negative.
34283 # This field cannot be changed once set.
34284 },
34285 },
34286 ],
34287 }</pre>
34288</div>
34289
34290</body></html>