Comments (2)
For anyone spending more than 10 minutes on this, I added on to this stackoverflow answer. There's probably a better way... let me know if you find it!!
https://stackoverflow.com/questions/5623838/rgb-to-hex-and-hex-to-rgb
function formatBackgroundColor(sheetId, orders_length, column_length, userEnteredValue, hexcolor) {
return {
"rule": {
"ranges": [{
"sheetId": sheetId,
"startRowIndex": 1,
"endRowIndex": orders_length + 1,
"startColumnIndex": 0,
"endColumnIndex": column_length,
}],
"booleanRule": {
"condition": {
"type": "TEXT_CONTAINS",
"values": [
{ "userEnteredValue": userEnteredValue },
]
},
"format": {
"backgroundColor": convertHexToArithmeticRGB(hexcolor)
}
}
},
"index": 0
}
}
function convertHexToArithmeticRGB(hexcolor) {
const hexToRgb = hex =>
hex.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i
,(m, r, g, b) => '#' + r + r + g + g + b + b)
.substring(1).match(/.{2}/g)
.map(x => parseInt(x, 16))
.map(rgb => rgb/255);
const rgbArray = hexToRgb(hexcolor)
return {"red": rgbArray[0], "green": rgbArray[1], "blue": rgbArray[2]}
}
from node-samples.
This issue tracker is for problems with the samples in this repo. For issues with the API more broadly, see the Sheets API support page.
from node-samples.
Related Issues (20)
- Code sample response after add sheet is not accurate
- The API returned an error: Invalid Input HOT 1
- isTokenExpiring is not working, we need to refresh the token
- No authorization code HOT 2
- Access response with data field
- adminSDK samples using deprecated OAuth out-of-band flow. HOT 3
- Dependency Dashboard
- V3 Upload to folder snippet parents value incorrect HOT 1
- Incorrect scopes url
- Filename issue HOT 1
- Documentation update HOT 1
- Cannot read properties of undefined (reading 'redirect_uris') at authenticate HOT 2
- [SyncRepoSettings bot] - Invalid config file
- I am not able to create folder in google drive using google drive APIs HOT 1
- Issue Title
- Incorrect code in drive_move_file_to_folder node sample
- getting random localhost urls with google gmail nodejs quickstart HOT 2
- bugs: Failed to get started with gmail Guide HOT 3
- "The API returned an error: GaxiosError: Invalid Credentials" while calling Gmail API
- how to authentication in sheets using service accounts
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-samples.