SAP / openui5

OpenUI5 lets you build enterprise-ready web applications, responsive to all devices, running on almost any browser of your choice.
http://openui5.org
Apache License 2.0
2.97k stars 1.24k forks source link

Request: method to get hex code of an sap.ui.core.IndicationColor #4041

Open swayongshen opened 7 months ago

swayongshen commented 7 months ago

I need to draw a rectangle on a canvas that has the same color as a chart which is based on sap.ui.core.IndicationColor. I want to avoid hardcoding the hex code of the IndicationColor when drawing the rectangle so such a method would be necessary, as per this screenshot. Is there such a method already that I'm just missing out on?

image

https://experience.sap.com/fiori-design-web/values-and-names/

PetyaMarkovaBogdanova commented 7 months ago

Hi @swayongshen , Thank you for sharing your enhancement proposal. I've created an internal incident DINC0139852. The status of the issue will be updated here in GitHub. Regards, Petya Markova. (UI5 Dispatcher)

NHristov-sap commented 1 month ago

Hi @swayongshen ,

As I understood your request, you need to know the color value associated for each Indication color? If yes, you can use the following:

https://sapui5.hana.ondemand.com/#/api/sap.ui.core.theming.Parameters%23methods/sap.ui.core.theming.Parameters.get

For example, if you want to get value of Indication color 3, you can use:

sap.ui.core.theming.Parameters.get("sapUiIndication3")

This takes the value assigned to the corresponding LESS parameter from the theme - @sapUiIndication3

Is this what you need?

Best Regards, Nikolay Hristov