Skip to main content

Color code


Hi guys,

Im new to Airtable but loving it so far. 

I just have one issue. 
- I need to get a HEX color code from a status (approved, awaiting approval and rejected, green, yellow and red) to a new field. 

How do i actually link the status to a hex color code? 

2 replies

TheTimeSavingCo
Forum|alt.badge.img+18

Could you provide a screenshot of your table setup and your expected output please?


Alexey_Gusev
Forum|alt.badge.img+12
  • Inspiring
  • 1111 replies
  • April 9, 2024

Hi,
You can use one-liner in scripting extension, which give you color names (put your table and field name):
Ignore linter warning.

output.text(base.getTable('Tablename').getField('Fieldname')?.options?.choices.map(c=>c.color).join(', '))


Then, you can go to 
https://airtable.com/css/compiled/all.css
and search for --palette-neutral-black
there you can find RGB values in decimal format

 if you just need to get a few values, do a screenshot and use Color Picker in Paint
functionality 'get HEX for Color name' present in Custom Extensions:  colorUtils , 
but I think it's a hardest way to accomplish your task


Reply