# Plotly color package : named CSS color parser

**URL:** <https://community.plotly.com/t/plotly-color-package-named-css-color-parser/52705>\
**Category:** 📊 Plotly Python\
**Created:** [May 5, 2021, 8:15pm UTC](https://community.plotly.com/t/plotly-color-package-named-css-color-parser/52705 "2021-05-05T20:15:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![AZXP](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/azxp/32/14924_2.png) [@AZXP](https://community.plotly.com/u/AZXP)\
**Post date:** [May 5, 2021, 8:15pm UTC](https://community.plotly.com/t/plotly-color-package-named-css-color-parser/52705/1 "2021-05-05T20:15:03Z")

</div>

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](https://github.com/plotly/plotly.py/tree/93776274e5e48ca04ee68d20f9ebb09458dfa79f/packages/python/plotly/_plotly_utils/colors) and didn’t find anything. Does anyone have any experience with that ?

Thank you !
