Archicad 29 C++ API
Loading...
Searching...
No Matches
Dark mode icon generation

Starting with Archicad 29, the APIDevKit provides automatic dark mode icon generation, available exclusively on the Mac platform. This feature processes SVG files to create dark mode variants, but only if colors are specified in the #xxxxxx or #xxx hexadecimal format. Icons using color literals are not supported.

During the build process, a color check is performed for all SVG files. This check ensures that every color in the SVG has a corresponding dark mode color defined in the configuration file. If any color is missing a counterpart, the build will fail with an error.

The configuration file, SVG_ColorChange_Darkmode.json under Support/Tools/OSX/ folder, manages the color conversion under the colorTable key. By default, it contains Graphisoft colors and their dark mode equivalents, but you can extend it with your own custom color pairs. The file also allows you to exclude specific files (excludeFiles key) or folders (excludeFolders key) from processing, so those SVGs remain unchanged in dark mode.

Additionally, you can specify noCheckFiles and noCheckFolders. For these, dark mode icons will be generated, but the color check will be skipped.

See the example below:

{
"colorTable": {
"#010101": "#010101",
"#06A647": "#0CCA59",
"#14FF73": "#8DFFBB",
"#1D9D48": "#1D9D48",
"#262626": "#E0E0E0",
"#263238": "#D9CDC7",
"#263239": "#263239",
},
"excludeFiles": [
"cursor"
],
"excludeFolders": [
"Assets"
],
"noCheckFiles": [
"icon"
],
"noCheckFolders": [
"Customs"
]
}

In this configuration:

  • Any file with a name matching cursor.svg will be excluded from processing entirely. No dark mode icon will be generated for these files.
  • Files named icon.svg will have dark mode icons generated, but the color check will be skipped for them.
  • If a file's path contains the Assets folder (for example, /Volumes/Mac HD/MyProject/Assets/file.svg), it will be excluded from processing, so no dark mode icon will be generated for any file within any Assets folder.
  • Similarly, if a file's path contains the Customs folder, all SVGs in that folder will be converted to dark mode icons, but the color check will be skipped for them.

This allows for flexible control over which icons are processed and how, based on file names and folder paths.