Skip to content

Commit 30a443e

Browse files
committed
OcdFileExport: Warn when exporting transparent colors to v8 format
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.
1 parent c8a7ea3 commit 30a443e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/fileformats/ocd_file_export.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -881,6 +881,9 @@ void OcdFileExport::exportSetup(OcdFile<Ocd::FormatV8>& file)
881881
for (int i = 0; i < num_colors; ++i)
882882
{
883883
const auto* color = map->getColorByPrio(i);
884+
if (color->getOpacity() < 1)
885+
addWarning(::OpenOrienteering::OcdFileExport::tr("Variable color opacity in \"%1\" is not supported by OCD version 8. Exporting as a fully opaque color.")
886+
.arg(color->getName()));
884887
const auto& cmyk = color->getCmyk();
885888
// OC*D stores CMYK values as integers from 0-200.
886889
auto ocd_cmyk = Ocd::CmykV8 {

0 commit comments

Comments
 (0)