cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

Theme - Refer to default colour?

Dear all,

When working with Themes, I sometimes want to refer to one of the default colours I declared earlier in the JSON. Is there a way to do this? The usecase is, when a user wants the colour changed, I only have to change it at one point.

Example:

 

{
        "name": "PowerBI_Community_Example",
        "dataColors": ["#862632", "#68afe1", "#5eb991", "#4c4b52"],
    
    "visualStyles": {
        "slicer": {
		"*": {
			"general": [{
				"outlineColor": { "solid": { "color": "#68afe1"}},
				"outlineWeight": 1,
			}]
		}
        }
    }
}

In the example I want the outline of my slicer to be the same colour as my second default colour. So I am looking for something like:

{
        "name": "PowerBI_Community_Example",
        "dataColors": ["#862632", "#68afe1", "#5eb991", "#4c4b52"],
    
    "visualStyles": {
        "slicer": {
		"*": {
			"general": [{
				"outlineColor": { "solid": { "color": "dataColors_2"}},
				"outlineWeight": 1,
			}]
		}
        }
    }
}

Does anybody know the correct syntax to do this?

 

Kind regards,

 

Ricardo Jacobs

 

1 REPLY 1
Highlighted
Community Support
Community Support

Re: Theme - Refer to default colour?

HI, @RJ_Nippur 

According to my knowledge, I'm afraid it couldn't achieve.

You need to define it in the code.

 

Best Regards,

Lin

 

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Upcoming Events

Upcoming Events

Wondering what events you could join or have an event to promote yourself? Check out our Upcoming Events.

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

We are thrilled to announce we will begin running a monthly webinar series named Power BI Dev Camp.

Top Solution Authors
Top Kudoed Authors