About
Side Projects
Blog
2022-11-07

Custom Palette for LibreOffice

The LibreOffice applications offer a palette function in the colour picker.

Colour Picker

One can choose, using the drop down, from a number of palettes which can contain a number of colours to choose from. Some palettes are provided “out of the box”, but how to add your own palettes should you need to – for example to include a corporate colour set?

This is achieved by creating a file on your disk system. For Linux, the file is located at;

~/.config/libreoffice/4/user/config/mypalette.soc

You can swap the mypalette.soc for the name of the palette that you want to add not forgetting the .soc extension. The file should be structured as follows;

<?xml version="1.0" encoding="UTF-8"?>
<ooo:color-table 
   xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
   xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
   xmlns:xlink="http://www.w3.org/1999/xlink"
   xmlns:svg="http://www.w3.org/2000/svg"
   xmlns:ooo="http://openoffice.org/2004/office">
  <draw:color draw:name="red" draw:color="#FF0000"/>
  <draw:color draw:name="green" draw:color="#00FF00"/>
  <draw:color draw:name="blue" draw:color="#0000FF"/>
</ooo:color-table>

In this fashion it is possible to add a number of colours. Restart the LibreOffice application in question to pickup the new palette.