Forum Discussion

RJ_Nippur's avatar
RJ_Nippur
Regular Visitor
7 years ago

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

  • v-lili6-msft's avatar
    v-lili6-msft
    Icon for Community Support rankCommunity Support

    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