(This is for LibreOffice version 24.2.7.2 on Kubuntu 24.04.)
I know I’m weird in a lot of ways (I mean, who still blogs in 2025?!?), but here’s a new one. I create lots of charts and graphs as well as presentations for classes. I tend to prefer a minimalist approach – white background with black text. I think the focus should be on the content, not the theme. But I also often draw boxes and need bar charts or figures to have different colors. After making thousands of such figures, I finally decided that I want to have my own color palette – colors I like – and I’ll just use them everywhere I can use my own, preferred colors. I went to a palette generation website and played around until I found a color scheme I liked. I now use these colors whenever I am creating charts/graphs or presentations.
Then I ran into an issue: I use LibreOffice Impress for presentations and LibreOffice Calc for graphs. It’s easy enough to create custom colors in the palettes in LibreOffice. But what if I want to create a custom palette one time, share it across all of my computers, and easily install it again every time I reformat my computers (which is roughly once a year)? Is there a way to create a custom color palette for LibreOffice that you can quickly import into the software without having to select the colors every time?
Yes. Yes, there is.
Here’s how…
First, you’ll need your color palette and the hex codes that correspond to each of the colors. You can get a palette from lots of websites, but you’ll need the hex codes. This site provides them with palettes (not an affiliate link).
Second, there is the issue of how to get this into LibreOffice and how to store a permanent copy. Turns out, this just requires an .XML file. XML is an “eXtensible Markup Language” file. In other words, it’s a text file that has a specific format and can be processed easily by other software. LibreOffice can easily read an XML file, if properly formatted, to get a color palette and put that into your drop-down options. You just have to do two things: (a) create your XML file and (b) store it in the right place. Let’s start with A.
Create Your XML File
Open a text file and enter the following at the top:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE office:color-table PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "color-table.dtd">
<office:color-table xmlns:office="http://openoffice.org/2000/office"
xmlns:draw="http://openoffice.org/2000/drawing">
This explains that it’s an XML file, details the encoding (UTF8), and provides some information on the type of file it is going to be – a color file for “OpenOffice,” the parent software of the now superior LibreOffice.
Next, here is the line of code you’ll use to add a color:
<draw:color draw:name="Tan" draw:color="#F8B195"/>
The parts in quotes are the parts that you should change to reflect your palette. Let’s say you want to add White to your palette. You’d replace “Tan” with “White” and replace “#F8B195” with “#FFFFFF”. That’s it. That’s how hard this is.
Add a new line, replacing the color name and hex code as you go, for every color in your palette.
You also need to add the following at the bottom, with your colors in the middle:
</office:color-table>
Then save the file with a “.soc” extension. That part is important!!!
Also, what you name the file itself (e.g., “Bob’s Color Palette.soc”) will be the name of your color palette when you open LibreOffice. Keep that in mind!
Two bonus bits of information. First, for some reason, LibreOffice wants 12 colors per row. So, if you want two rows of colors in your palette, keep in mind that the first row has to have 12 colors. I couldn’t change this. (If someone knows how, please let me know.)
Second, you can add comments to your XML file like this:
<!-- This is a comment in your XML file. -->
Adding comments can be useful if you just want some organization or to make notes for yourself.
Where To Put Your SOC/XML File
Once you’ve created your XML file with a “.soc” extension, you have to put it in the right place. If you manage to get it into the right folder, LibreOffice will find it, process it, and make your color palette an option the next time you open LibreOffice.
I run Linux (Kubuntu 24.04 right now). The location of my files will differ from yours if you’re on a different type of Linux, on Windows, or on Mac. Also, note that the location is “hidden,” meaning you’ll probably have to turn on “View Hidden Files” in your file explorer to find where you need to copy your SOC/XML file.
You’ll need to figure it out for your OS, but here is the folder location for my installation:
/home/ryan/.config/libreoffice/4/user/config/
Basically, inside the “.config” folder in my user folder is a folder for LibreOffice. Why it has a “4” there when the current version is 24, no idea. But, that’s what it is.
Because I’m going to use this color palette for a long time and across multiple computers, I store a copy of it with my master files in Dropbox. I then just copy the file into that location. Then, when I open up LibreOffice (showing Impress in the photo below) and want to add color to something, I can select my color palette (morningglow):

And select from my custom colors:

Sample XML
As a bonus, here’s the entire contents of my XML file in case you want to copy it and just customize it:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE office:color-table PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "color-table.dtd">
<office:color-table xmlns:office="http://openoffice.org/2000/office"
xmlns:draw="http://openoffice.org/2000/drawing">
<!-- This is the first row of Morning Glow -->
<draw:color draw:name="Tan" draw:color="#F8B195"/>
<draw:color draw:name="Pink" draw:color="#F67280"/>
<draw:color draw:name="Purplish Red" draw:color="#C06C84"/>
<draw:color draw:name="Purple" draw:color="#6C5B7B"/>
<draw:color draw:name="Blue" draw:color="#355C7D"/>
<!-- Add some grays to separate first from second row. -->
<draw:color draw:name="Gray 1" draw:color="#333333"/>
<draw:color draw:name="Gray 2" draw:color="#666666"/>
<draw:color draw:name="Gray 3" draw:color="#808080"/>
<draw:color draw:name="Gray 4" draw:color="#999999"/>
<draw:color draw:name="Gray 5" draw:color="#b2b2b2"/>
<draw:color draw:name="Gray 6" draw:color="#cccccc"/>
<draw:color draw:name="Gray 7" draw:color="#dddddd"/>
<!-- Second row gives me some added options. -->
<draw:color draw:name="Flourescent Yellow" draw:color="#ffff00"/>
<draw:color draw:name="Bright Red" draw:color="#ff0000"/>
<draw:color draw:name="Bright Blue" draw:color="#0000ff"/>
<draw:color draw:name="Light Blue" draw:color="#b4c7dc"/>
<draw:color draw:name="Black" draw:color="#000000"/>
<draw:color draw:name="White" draw:color="#FFFFFF"/>
</office:color-table>
Leave a Reply