Plotly color package : named CSS color parser

Hi there,

I try to find the way Plotly parses CSS named colors. My intention is to create a quick function that create a rgba version of the underlying rgb value of those colors.

Here is my idea :

  1. my func get a color name : 'darkgoldenrod'
  2. it translates the name into rgb ' rgb(184, 134, 11)' ← this is where I need help
  3. create a semi-transparent version : ' rgba(184, 134, 11, 0.5)'
  4. feed another fonction that can plot with plain color and semi-transparent version

I’m sure i can find another library to do this, but since Plotly does the same thing under the hood it would be more convenient. I read the color module code and didn’t find anything. Does anyone have any experience with that ?

Thank you !