Skip to content

Instantly share code, notes, and snippets.

View caburum's full-sized avatar
🎒

Calum Dingwall caburum

🎒
View GitHub Profile
@caburum
caburum / google-sheets-color-preview.js
Last active July 4, 2021 02:36 — forked from wjmazza/google-sheets-colour-preview.js
A Google Sheets script which adds color preview to cells. When you edit a cell containing a valid CSS hexadecimal color code (like #000 or 000 or #000000 or 000000), the background color will be changed to that color and the font color will be changed to the inverse color for readability.
/*
This script is meant to be used with a Google Sheets spreadsheet. When you edit a cell containing a valid CSS hexadecimal color code (like #000 or 000 or #000000 or 000000), the background color will be changed to that color and the font color will be changed to the inverse color for readability.
To use this script in a Google Sheets spreadsheet:
1. Go to "Tools" » "Script Editor"
2. Erase everything in the text editor
3. Change the title to "Set color preview on edit"
4. Paste this code in
5. Click save
*/