From 4e0ad7f83956a4440e1bf5ec5a7a44bb636258e7 Mon Sep 17 00:00:00 2001 From: David Capello Date: Sun, 20 Feb 2011 18:59:41 -0300 Subject: [PATCH] Modify short color format in Color::toFormalString(). --- src/app/color.cpp | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/src/app/color.cpp b/src/app/color.cpp index e7b0a86f3..1c3da3f2e 100644 --- a/src/app/color.cpp +++ b/src/app/color.cpp @@ -261,49 +261,38 @@ std::string Color::toFormalString(int imgtype, bool long_format) const switch (getType()) { case Color::MaskType: - result << "MASK"; + result << "Mask"; break; case Color::RgbType: if (imgtype == IMAGE_GRAYSCALE) { - result << "V " << getGray(); + result << "Gry-" << getGray(); } else { - result << "RGB #" << std::hex << std::setfill('0') + result << "#" << std::hex << std::setfill('0') << std::setw(2) << m_value.rgb.r << std::setw(2) << m_value.rgb.g << std::setw(2) << m_value.rgb.b; - - if (imgtype == IMAGE_INDEXED) { - result << " (" << std::dec - << color_utils::color_for_image(*this, imgtype) << ")"; - } } break; case Color::HsvType: if (imgtype == IMAGE_GRAYSCALE) { - result << "V " << getGray(); + result << "Gry-" << getGray(); } else { - result << "HSV " - << m_value.hsv.h << "," + result << m_value.hsv.h << "," << m_value.hsv.s << "," << m_value.hsv.v; - - if (imgtype == IMAGE_INDEXED) { - result << " (" - << color_utils::color_for_image(*this, imgtype) << ")"; - } } break; case Color::GrayType: - result << "V " << m_value.gray; + result << "Gry-" << m_value.gray; break; case Color::IndexType: - result << "I " << m_value.index; + result << "Idx-" << m_value.index; break; default: