Skip to content

Commit

Permalink
OcdFileExport: Warn when exporting transparent colors to v8 format
Browse files Browse the repository at this point in the history
Transparent (semi-opaque) colors are supported only in later format
versions. This patch makes Mapper write out a warning when the color
opacity value gets dropped.
  • Loading branch information
lpechacek committed Apr 3, 2024
1 parent 4d26dfe commit 29a4b10
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/fileformats/ocd_file_export.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -883,6 +883,9 @@ void OcdFileExport::exportSetup(OcdFile<Ocd::FormatV8>& file)
for (int i = 0; i < num_colors; ++i)
{
const auto* color = map->getColorByPrio(i);
if (color->getOpacity() < 1)
addWarning(::OpenOrienteering::OcdFileExport::tr("Variable color opacity in \"%1\" is not supported by OCD version 8. Exporting as a fully opaque color.")
.arg(color->getName()));
const auto& cmyk = color->getCmyk();
// OC*D stores CMYK values as integers from 0-200.
auto ocd_cmyk = Ocd::CmykV8 {
Expand Down

0 comments on commit 29a4b10

Please sign in to comment.