How do I create a custom colour palette (quick version)

To create a custom palette, open the default system-wide palette at the bottom of this entry.

Creating a custom palette


To add a new palette, start with the following script layout:

api.register({
    type: "palette",
    name: "Palette Name",
    items: [
        
    ]
});


After 'items' enter an array (a comma separated list within square brackets) of your chosen colours in hexadecimal format ("#d62728" or 0xD62728).

e.g.

api.register({
    type: "palette",
    name: "NHS Colours",
    items: [
		[
                "#1f77b4",
		"#ff7f0e",
		"#2ca02c",
		"#d62728",
		"#9467bd",
		"#8c564b",
		"#e377c2",
		"#7f7f7f",
		"#bcbd22"
                 ]	 
    ]
});

(To convert colour codes from RGB into HEX you can use a website translator e.g. http://www.rgbtohex.net/)


If you want to add multiple variations of a colour scheme (e.g. NHS 6 colours, 10 colours, 14 colours), simply add multiple arrays to items:

api.register({
    type: "palette",
    name: "NHS Colours",
    items: [
		[	
		"#1f77b4",
		"#ff7f0e",
		"#2ca02c",
		],
		[
		"#d62728",
		"#9467bd",
		"#8c564b",
		"#e377c2",
		"#7f7f7f",
		"#bcbd22",
		]
	 
    ]
});

 


This generates one palette per colour array. By default, these are named in OrgVue as “Palette Name {length of colour array}” – e.g., using the above example, “NHS Colours 3” and “NHS Colours 6”


Adding your custom palette to OrgVue

Navigate to the dataset for which you want to apply your new palette. To copy your Palette script into OrgVue

1. Hold Ctrl and left click on the OrgVue logo in the top left of the dataset taskbar
2. Click “+” next to Scripts to open the New Script panel
3. Copy your script to the clipboard and press CTRL+V
4. Close the Admin panel and recalculate the dataset

 

Have more questions? Submit a request

Comments