Background: my git client allows to choose an icon for each repository, which makes it easier to recognise them in an overview. To do this one simply places a graphic with the name “icon” or “logo” in folder of the repository. Allowed file formats are .tiff
, .png
, .jpg
, .gif
, or icns
. I thought it would be nice to have document automatically create such a file with the theme colour of the document.
In addition to creating a document, I would also like to also create a separate pixel graphic which is a simple square filled with a solid colour. The colour is defined in the preamble of the document. How can I do this?
A simple MWE as starting point:
xxxxxxxxxx
\documentclass{standalone}
\usepackage{xcolor}
\definecolor{duck}{RGB}{255, 216, 1}
\begin{document}
unrelated document content
\end{document}
Using the colour conversion/extraction from https://tex.stackexchange.com/q/436012/36296 one can then for example pass the extracted colour to image magick to create a pixel graphic:
It is probably silly to use TikZ to create a simple square, but one can use the external
library for this: