Forum Discussion

TrentS's avatar
TrentS
Helper IV
1 year ago
Solved

Naming Custom Colors in a theme

Good day all,

Created a custom json theme and want to name the colors so that when a user hovers over the color in the picker, it shows the custom name. ("Company Blue" for example.)
Using the 'Customize Theme' tool in Power BI does not allow the option to change the color names, only the Theme name.
In the JSON file, I can load the colors without the names so I know those are valid.
I have tried multiple formats.
{ "colors": [ { "color": "black", "category": "hue", "type": "primary", "code": { "rgba": [255,255,255,1], "hex": "#000" } }, { "color": "white", "category": "value", "code": { "rgba": [0,0,0,1], "hex": "#FFF" } }

and
{ "aliceblue": "#f0f8ff", "antiquewhite": "#faebd7", "aqua": "#00ffff", "aquamarine": "#7fffd4", "azure": "#f0ffff", "beige": "#f5f5dc", "bisque": "#ffe4c4", "black": "#000000", "blanchedalmond": "#ffebcd", "blue": "#0000ff", "blueviolet": "#8a2be2", "brown": "#a52a2a", }

However those files will not load producing an error about invalid JSON structure.

Does Power BI simply not allow for naming the individual colors?

Note:Examples are from Sitepoint.com

  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi TrentS ,
    There is really no support for naming individual colors in the color picker via JSON themes. You can customize theme colors in Power BI Desktop, but there is no way to assign custom names to those colors.

    Your idea makes sense and you can submit an idea for it at: Home
    and wait for users with the same needs as you to vote for you to help make it happen as soon as possible.

    Use report themes in Power BI Desktop - Power BI | Microsoft Learn

     

    Best regards,
    Albert He


    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

3 Replies

  • Hello TrentS,

     

    Can you please try this approach:

    {
      "name": "Custom Theme with Colors",
      "dataColors": [
        "#005A9C", // Company Blue
        "#0078D4", // Light Blue
        "#E81123", // Company Red
        "#107C10"  // Company Green
      ],
      "visualStyles": {},
      "background": "#FFFFFF",
      "foreground": "#000000",
      "tableAccent": "#005A9C"
    }
    

     

    Alternatively, you can create a legend using conditional formatting to display the actual colors next to their names.

     

    Hope this helps.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi TrentS ,
    There is really no support for naming individual colors in the color picker via JSON themes. You can customize theme colors in Power BI Desktop, but there is no way to assign custom names to those colors.

    Your idea makes sense and you can submit an idea for it at: Home
    and wait for users with the same needs as you to vote for you to help make it happen as soon as possible.

    Use report themes in Power BI Desktop - Power BI | Microsoft Learn

     

    Best regards,
    Albert He


    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

  • Thank you Sahir.
    Unfortunately it gets the same message.