Blame Scripts/Functions/Render/render_svg_convertGplToHex.sh
|
|
bd5b82 |
#!/bin/bash
|
|
|
bd5b82 |
#
|
|
|
ed4f4c |
# render_svg_convertGplToHex.sh -- This function takes one palette
|
|
|
bd5b82 |
|
|
|
bd5b82 |
|
|
|
bd5b82 |
# `pnmtolss16' program needs (e.g., #RRGGBB=0 #RRGGBB=1 ... [all
|
|
|
bd5b82 |
# values in the same line]).
|
|
|
bd5b82 |
#
|
|
|
3b0984 |
# Copyright (C) 2009, 2010, 2011 The CentOS Artwork SIG
|
|
|
fa95b1 |
#
|
|
|
fa95b1 |
# This program is free software; you can redistribute it and/or modify
|
|
|
fa95b1 |
|
|
|
dcd347 |
|
|
|
dcd347 |
|
|
|
bd5b82 |
#
|
|
|
74a058 |
|
|
|
74a058 |
|
|
|
bd5b82 |
|
|
|
bd5b82 |
# General Public License for more details.
|
|
|
bd5b82 |
#
|
|
|
bd5b82 |
|
|
|
bd5b82 |
# along with this program; if not, write to the Free Software
|
|
|
dcd347 |
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
7ac5a5 |
#
|
|
|
bd5b82 |
# ----------------------------------------------------------------------
|
|
|
bd5b82 |
# $Id$
|
|
|
bd5b82 |
# ----------------------------------------------------------------------
|
|
|
bd5b82 |
|
|
|
ed4f4c |
function render_svg_convertGplToHex {
|
|
|
bd5b82 |
|
|
|
bd5b82 |
|
|
|
bd5b82 |
|
|
|
bd5b82 |
local PALETTE_GPL="$1"
|
|
|
bd5b82 |
|
|
|
bd5b82 |
|
|
|
bd5b82 |
|
|
|
bd5b82 |
local PALETTE_HEX="$2"
|
|
|
bd5b82 |
|
|
|
bd5b82 |
|
|
|
aa5e47 |
local NUMBER="$3"
|
|
|
bd5b82 |
|
|
|
bd5b82 |
|
|
|
aa5e47 |
local COLORS=$(render_svg_getColors $PALETTE_GPL --head=$NUMBER --tail=$NUMBER)
|
|
|
bd5b82 |
|
|
|
aa5e47 |
|
|
|
aa5e47 |
|
|
|
aa5e47 |
|
|
|
aa5e47 |
|
|
|
aa5e47 |
render_svg_checkColorAmount "$COLORS" "$NUMBER"
|
|
|
bd5b82 |
|
|
|
aa5e47 |
|
|
|
aa5e47 |
render_svg_checkColorFormats "$COLORS" --format='rrggbb'
|
|
|
bd5b82 |
|
|
|
bd5b82 |
|
|
|
aa5e47 |
echo "$COLORS" | nl | awk '{ printf "%s=%d ", $2, $1 - 1 }' \
|
|
|
bd5b82 |
> $PALETTE_HEX
|
|
|
bd5b82 |
|
|
|
bd5b82 |
|
|
|
aa5e47 |
cli_checkFiles $PALETTE_HEX
|
|
|
bd5b82 |
|
|
|
bd5b82 |
}
|