|
|
2b536f |
#!/bin/bash
|
|
|
2b536f |
#
|
|
|
6c8f8b |
# svg_checkColorAmount.sh -- This function verifies whether the list
|
|
|
6c8f8b |
# of colors provided in the first argument matches the amount of
|
|
|
2b536f |
# colors specified by the second argument.
|
|
|
2b536f |
#
|
|
|
2fe9b7 |
# Copyright (C) 2009, 2010, 2011 The CentOS Project
|
|
|
2b536f |
#
|
|
|
2b536f |
# This program is free software; you can redistribute it and/or modify
|
|
|
2b536f |
# it under the terms of the GNU General Public License as published by
|
|
|
2b536f |
# the Free Software Foundation; either version 2 of the License, or (at
|
|
|
2b536f |
# your option) any later version.
|
|
|
2b536f |
#
|
|
|
2b536f |
# This program is distributed in the hope that it will be useful, but
|
|
|
2b536f |
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
2b536f |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
2b536f |
# General Public License for more details.
|
|
|
2b536f |
#
|
|
|
2b536f |
# You should have received a copy of the GNU General Public License
|
|
|
2b536f |
# along with this program; if not, write to the Free Software
|
|
|
2b536f |
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
2b536f |
#
|
|
|
2b536f |
# ----------------------------------------------------------------------
|
|
|
2b536f |
# $Id$
|
|
|
2b536f |
# ----------------------------------------------------------------------
|
|
|
2b536f |
|
|
|
6c8f8b |
function svg_checkColorAmount {
|
|
|
2b536f |
|
|
|
2b536f |
# Define list of colors.
|
|
|
2b536f |
local COLORS=$1
|
|
|
2b536f |
|
|
|
2b536f |
# Define the amount of colors the list provided must have, in
|
|
|
2b536f |
# order to be considered as valid.
|
|
|
2b536f |
local NUMBER=$2
|
|
|
2b536f |
|
|
|
2b536f |
# Verify amount of colors provided in the list.
|
|
|
2b536f |
if [[ $(echo "$COLORS" | wc -l) -ne $NUMBER ]];then
|
|
|
2b536f |
cli_printMessage "`gettext "The palette does not have the correct number of colors."`" --as-error-line
|
|
|
2b536f |
fi
|
|
|
2b536f |
|
|
|
2b536f |
}
|