Consider the following quarto dashboard:
---
title: "Test"
format: dashboard
---
```{python}
#| content: valuebox
#| title: "Test Box"
dict(value=10, color="red")
```
How can I define the background color of the valuebox
dynamically using RGB colors? I am probably missing the correct syntax.
Doing it like this doesn't lead to the expected result:
---
title: "Test"
format: dashboard
---
```{python}
#| content: valuebox
#| title: "Test Box"
dict(value=10, color="background-color: rgb(255,0,0)")
```
You can convert the rgb values to hex:
---
title: "Test"
format: dashboard
---
```{python}
#| content: valuebox
#| title: "Test Box"
dict(value=10, color='#%02x%02x%02x' % (255, 0, 0))
```