DundasBlue Equivalent

I have searched a few times for this and never asked the question, so if I’m not looking in the right place please show me the way.

We have a specific color palette that we use for all of our visualizations. We are utilizing Styles and Themes when appropriate. However, on occasion we have use a new element/component that hasn’t been styled and I find myself cursing that I have to go lookup our hex for the specific blue or red that we use. Is there a way to “name” a color, similar to DundasBlue in the UI for easy access to specific Hex codes that are used frequently?

Thanks!

1 Like

Hi Devon,

You can do this by providing a JavaScript override and editing the list of colours. If you’re using version 7+, go to Setup -> App Styling and double click on the JavaScript resource. Add something like this:

$(document).ready(function () {
    window.dundas.context.ready(function () {
        dundas.controls.Colors.push({ name: "DundasPurple", value: 4466537 });
        dundas.controls.Color.updateColorNames();
    });
});

Note: the ‘value’ provided is an integer representation of your argb value and there are a lot of tools online that can help you get this value. Here’s one i found quickly:
https://www.rapidtables.com/convert/number/hex-to-decimal.html

image

2 Likes

I realized after further testing that the script i posted had some issues. If you want to do this, use this one instead as the previous script ran too late in the loading lifecycle.

 $(document).ready(function () {
     window.dundas.context.ready(function () {
         dundas.controls.Colors.push({ name: "DundasPurple", value: 4466537 });
         dundas.controls.Color.updateColorNames();
     });
 });
1 Like