🖌 Convert Colors
Do you have a color library that needs some conversions? Using a Notion formula, the replace function and regular expressions in particular, a user can convert RGB to HEX and vice versa. I also discuss how to extract or remove items in a list of three divided by commas. Copy the Notion template below.
How To Copy Formulas
Click inside cell
Click out (cell should be blue)
Copy + Paste where desired
Notion Formula Tips
These tips explain how to separate values in a list of three, divided by a comma (ie. the RGB syntax 220, 20, 60).
Removing numbers in the sequence:
1. Remove First Number
replace(prop("RGB"), "[^,]*, ", "")
2. Remove Middle Number
replace(prop("RGB"), ",[^,]*", "")
3. Remove Last Number
replace(prop("RGB"), ",[^,]*$", "")
Isolating numbers in the sequence:
1. Isolate First Number
replaceAll(replace(prop("RGB"), "(?:[^,]*, ){0}", ""), ",.*", "")
2. Isolate Second Number
replaceAll(replace(prop("RGB"), "(?:[^,]*, ){1}", ""), ",.*", "")
3. Isolate Third Number
replaceAll(replace(prop("RGB"), "(?:[^,]*, ){2}", ""), ",.*", "")
Isolating List Items In Notion
Learn more about isolating and extracting list items with Notion formulas.