| 1 |
How to recolor icons for doc.qt.io |
| 2 |
================================== |
| 3 |
|
| 4 |
You can view Qt Documentation online at https://doc.qt.io in dark and light |
| 5 |
modes. To make the icons you use in the docs visible in both modes, save icon |
| 6 |
files as gray-scale images with a transparent background. |
| 7 |
|
| 8 |
If you receive a large number of icons that are not visible in either light |
| 9 |
or dark mode or have a solid background, run the ``recolordocsicons.py`` |
| 10 |
Python script. |
| 11 |
|
| 12 |
The script runs ImageMagick to recolor the images and optipng to optimize the |
| 13 |
icon files. |
| 14 |
|
| 15 |
## Preparation |
| 16 |
|
| 17 |
To run the script, you will need to install the following tools and add them |
| 18 |
to the PATH: |
| 19 |
|
| 20 |
- Python 3.x (the script has been tested to work with 3.10) |
| 21 |
- ImageMagick |
| 22 |
- optipng |
| 23 |
|
| 24 |
## Running the script |
| 25 |
|
| 26 |
Use the `-docspath` option to specify the path to the folder where you stored |
| 27 |
the icons. |
| 28 |
|
| 29 |
For example, if you saved the new icons in `C:\iconconversions`, switch to |
| 30 |
the `qttools\util\recolordocsicons` folder and enter: |
| 31 |
|
| 32 |
`recolordocsicons.py -docspath C:\iconconversions` |