[Libufo-commits] ufo-0.5/src/util ucolor.cpp,1.13,1.14
Status: Beta
Brought to you by:
schmidtjf
|
From: Johannes S. <sch...@us...> - 2005-10-17 15:36:44
|
Update of /cvsroot/libufo/ufo-0.5/src/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5722/src/util Modified Files: ucolor.cpp Log Message: Fixed alpha value for colors returned by brighter, darker. Index: ucolor.cpp =================================================================== RCS file: /cvsroot/libufo/ufo-0.5/src/util/ucolor.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** ucolor.cpp 13 Feb 2005 16:53:52 -0000 1.13 --- ucolor.cpp 17 Oct 2005 15:36:32 -0000 1.14 *************** *** 237,244 **** UColor UColor::darker() const { ! float temp[3]; temp[0] = m_farr[0] * FACTOR; temp[1] = m_farr[1] * FACTOR; temp[2] = m_farr[2] * FACTOR; // clamp --- 237,245 ---- UColor UColor::darker() const { ! float temp[4]; temp[0] = m_farr[0] * FACTOR; temp[1] = m_farr[1] * FACTOR; temp[2] = m_farr[2] * FACTOR; + temp[3] = m_farr[3]; // clamp *************** *** 248,252 **** } } ! return UColor(temp); } --- 249,253 ---- } } ! return UColor(temp, true); } *************** *** 255,265 **** // if is entirely black don't calculate other minima if (isBlack()) { ! return UColor(MIN_VAL, MIN_VAL, MIN_VAL); } else { // create temporary values, we do not want to modify this color ! float temp[3]; temp[0] = m_farr[0] / FACTOR; temp[1] = m_farr[1] / FACTOR; temp[2] = m_farr[2] / FACTOR; // clamp --- 256,267 ---- // if is entirely black don't calculate other minima if (isBlack()) { ! return UColor(MIN_VAL, MIN_VAL, MIN_VAL, getAlpha()); } else { // create temporary values, we do not want to modify this color ! float temp[4]; temp[0] = m_farr[0] / FACTOR; temp[1] = m_farr[1] / FACTOR; temp[2] = m_farr[2] / FACTOR; + temp[3] = m_farr[3]; // clamp *************** *** 268,272 **** temp[i] = std::min(temp[i], 1.0f); } ! return UColor(temp); } } --- 270,274 ---- temp[i] = std::min(temp[i], 1.0f); } ! return UColor(temp, true); } } |