[Python] How to assign a RGB background color to a Quarto dashboard valuebox?

Discussão em 'Python' iniciado por Stack, Julho 4, 2025.

  1. Stack

    Stack Membro Participativo

    Consider the following quarto dashboard:

    ---
    title: "Test"
    format: dashboard
    ---

    ```{python}
    #| content: valuebox
    #| title: "Test Box"
    dict(value=10, color="red")
    ```


    [​IMG]

    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)")
    ```


    [​IMG]

    Continue reading...

Compartilhe esta Página