Well, I just discovered quarto, so I may be unaware of subtleties.
But my first shot in the dark attempt worked
---
title: "Test"
format: dashboard
---
```{python}
#| content: valuebox
#| title: "Test Box"
dict(value=10, color="#f88868")
```
In the mean time I found some documentation. So I am a bit more aware of what I am doing than with my 1st lucky shot in the dark.
Firstly, color is for background-color only.
So color="backgroundcolor: rgb(255,0,0)" is not only redundant (you are saying that background color is "backgroundcolor:..."), but incorrect. What is expected in the color attribute is just a color, the one of the background.
Meaning that you can't (but that wasn't your question anyway) set the foreground color (actually, you can. But by going behind quarto's back, and tweaking CSS your self, injecting your own css style. So, almost hacking, and clearly in quarto's author mind, that is not what normal people should do)
Now, according to doc, color=rgb(255,0,0) that you've probably tried also should work. But it doesn't.
Because doc say that "any CSS color can be used". And rgb(255,0,0) is a valid color to use anywhere you specify colors in CSS.
As is #ff0000, that works.
When you inspect the generated html you get a hint about what is happening.
When I use #ff0000, I see that generated html contains a style="background-color: #ff0000", while when I use rgb(255,0,0), what I see is a (syntaxically wrong) class=bg-rgb(255,0,0).
So obviously, what is meant to happen is that is color attribute is one of those that have some specific class in quarto, like red or danger or success, it generates some html with class bg-red, bg-danger, bg-success. While when color is some generic css color, which doesn't match a predefined class, it generates an ad-hoc style=....
#ff0000 is correctly detected as some generic "not a predefined class name" color. rgb(255,0,0) is not.
IMHO, that is a bug (even without intend to support rgb(...) colors, the default behavior should be, as long as the bg-xxx class doesn't exist, to pass the torch to html/css. That is to convert any color=xxx where bg-xxx is one of the few predefined class as class=bg-xxx, and anything else as style="background-color:xxx". But maybe they fear some kind of CSS injection attack. Would be a bit strange, since it is possible to inject CSS anyway. Normally a code is not supposed to protect itself against hacking by its own developer. But maybe they want that color attribute to be able to come from end user (like color=input("please choose a background color >") then
color=color. But even if that is the explanation, I think it would be better to just warn not do to that. Point is, I fail to see any reasonable explanation, other than a bug, for rgb(255,0,0) not to work, and generally speaking for anythingThatIsUnderstoodByCSSAndIsNotAPredifinedBg-class to work
style="background-color: rgb(255,0,0)"instead of color?colorattribute is not a style, and is just the name of background-color (socolor="background-color:..."is redundant (and anyway syntaxically wrong). Whilecolor=rgb(255,0,0)should work, according to documentation. But doesn't.