Colour palette table to reference in SVG Image expressions

Encrafted_0-1713074503317.pngThis is what the table looks like. Of course you can change it to be gallery or whatever suits you best.

I don't know if it's possible but a nice added function could be to create an action that copies the selected row's ID or Hex code to the clipboard.

Encrafted_1-1713091128488.png

The leftmost column is an Image type with the bare minimum SVG code. [Encoded Hex] is a virtual column that uses ENCODEURL() on a column with the hash-hex colour value.

 

CONCATENATE(
"data&colon;image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' 
width='100%' height='100%' 
style='background-color:", [Encoded hex], "'>
</svg>"
)

 

 With Hex set to quick edit you can immediately see the preview change (after clicking out, of course). I actually think the preview works without the #, but I've included it so the colour works in SVG fill expressions.

Encrafted_2-1713091326371.png

 

An extract from where I've used the colour palette table to set the fill of a circle. This is inside <svg> tags with CONCATENATE() gluing everything together.

 

<circle cx='0' cy='0' r='95' fill=""", 
SELECT(Colour hex codes[Encoded hex], ([Colour ID] = "Purple highlight"), TRUE), 
"""/>

 

Even if it looks a bit unwieldy it's way easier to change colours and stick to a consistent palette.  Just a shame the Format Rules don't accept expressions for the colours otherwise I'd use it there.

5 1 82
  • UX
1 REPLY 1

Top Labels in this Space