diff --git a/Scripts/Functions/Render/render_svg_convertPngToGrub.sh b/Scripts/Functions/Render/render_svg_convertPngToGrub.sh index d31c169..7ab73e7 100644 --- a/Scripts/Functions/Render/render_svg_convertPngToGrub.sh +++ b/Scripts/Functions/Render/render_svg_convertPngToGrub.sh @@ -26,7 +26,7 @@ function render_svg_convertPngToGrub { # Define number of colors the images will be produced on. - local COLOR_NUMBER='14' + local COLORS='14' # Define options using those passed to actions from pre-rendition # configuration script. These options are applied to pnmremap when @@ -46,7 +46,7 @@ function render_svg_convertPngToGrub { done # Define file name prefix. - local PREFIX="-${COLOR_NUMBER}c" + local PREFIX="-${COLORS}c" # Redefine file name prefix using options as reference. This is # useful to differenciate final files produced using @@ -55,16 +55,18 @@ function render_svg_convertPngToGrub { PREFIX="${PREFIX}-floyd" fi - # Define theme-specific palettes directory. - local PALETTES=$(cli_getRepoTLDir)/Identity/Images/Themes/$(cli_getPathComponent $ACTIONVAL --theme)/Palettes - # Define absolute path to GPL palette. This palettes should have # 14 colors only. For more information on this see the GRUB's # documentation. - local PALETTE_GPL=${PALETTES}/grub.gpl - - # Verify GPL palette existence. - cli_checkFiles $PALETTE_GPL + local PALETTE_GPL=${MOTIF_DIR}/Palettes/grub.gpl + + # Verify GPL palette existence. If it doesn't exist copy the one + # provided by the design model and expand translation markers in + # it. + if [[ ! -f $PALETTE_GPL ]];then + cp ${MODEL_BASEDIR}/${FLAG_THEME_MODEL}/Palettes/grub.gpl ${PALETTE_GPL} + cli_replaceTMarkers ${PALETTE_GPL} + fi # Define absolute path to PPM palette. The PPM palette is built # from source palette (PALETTE_GPL) and provides the color @@ -84,7 +86,7 @@ function render_svg_convertPngToGrub { cli_printMessage "$PALETTE_GPL" --as-palette-line # Create PPM palette using GPL palette. - render_svg_convertGplToPpm "$PALETTE_GPL" "$PALETTE_PPM" "$COLOR_NUMBER" + render_svg_convertGplToPpm "$PALETTE_GPL" "$PALETTE_PPM" "$COLORS" # Reduce colors as specified in PPM palette. Here we use the PPM # palette to enforce the color position in the image index and the