![](/img/trans.png)
[英]Google sheet Duplicatea specific sheet from a specific sheet and specific cell
[英]getting font cell and backcolor cell of a specific sheet of google spread sheet
例子:
床單:
查詢參數:
響應正文:
Spreadsheets.get 將返回一個Resource:Spreadsheet ,您可以在“ sheets ”->“ data ”->“ rowData ”->“ values ”->“ userEnteredFormat ”->“ textFormat ”下獲取所需范圍的單元格字體顏色->“ 前景色”
"sheets": [ { "data": [ { "rowData": [ { "values": [ { "userEnteredValue": { "stringValue": "DONE" }, "effectiveValue": { "stringValue": "DONE" }, "formattedValue": "DONE", "userEnteredFormat": { "textFormat": { "foregroundColor": { "red": 0.9843137, "green": 0.7372549, "blue": 0.015686275 }, "fontFamily": "Arial", "foregroundColorStyle": { "themeColor": "ACCENT3" } } }, * * * { "startRow": 1, "rowData": [ { "values": [ { "userEnteredValue": { "stringValue": "NOK" }, "effectiveValue": { "stringValue": "NOK" }, "formattedValue": "NOK", "userEnteredFormat": { "textFormat": { "foregroundColor": { "red": 1, "blue": 1 }, "fontFamily": "Arial", "foregroundColorStyle": { "rgbColor": { "red": 1, "blue": 1 } } } }, * **
}
Sheet1:A1 的字體顏色為:
"foregroundColor": { "red": 0.9843137, "green": 0.7372549, "blue": 0.015686275 }
您需要使用以下公式轉換浮動 rgb 值:
Math.floor( floating color value * 255)
基於此參考: https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/other#Color
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.