1
1
/**************************************************************************\
3
3
* This file is part of the Coin 3D visualization library.
4
* Copyright (C) 1998-2006 by Systems in Motion. All rights reserved.
4
* Copyright (C) 1998-2007 by Systems in Motion. All rights reserved.
6
6
* This library is free software; you can redistribute it and/or
7
7
* modify it under the terms of the GNU General Public License
133
if (!(hue>=0.0f && hue<=1.0f)) {
134
SoDebugError::postWarning("SbColor::setHSVValue",
135
"'hue' (%f) not within [0.0,1.0]; clamping.",
137
if (hue<0.0f) hue=0.0f;
138
else if (hue>1.0f) hue=1.0f;
141
if (!(saturation>=0.0f && saturation<=1.0f)) {
142
SoDebugError::postWarning("SbColor::setHSVValue",
143
"'saturation' (%f) not within [0.0,1.0]; "
144
"clamping.", saturation);
145
if (saturation<0.0f) saturation=0.0f;
146
else if (saturation>1.0f) saturation=1.0f;
149
if (!(value>=0.0f && value<=1.0f)) {
150
SoDebugError::postWarning("SbColor::setHSVValue",
151
"'value' (%f) not within [0.0,1.0]; clamping.",
153
if (value<0.0f) value=0.0f;
154
else if (value>1.0f) value=1.0f;
133
if (!(hue>=0.0f && hue<=1.0f) ||
134
!(saturation>=0.0f && saturation<=1.0f) ||
135
!(value>=0.0f && value<=1.0f)) {
136
SoDebugError::postWarning("SbColor::setHSVValue",
137
"One or more values out of range, clamping.");
138
hue = SbClamp(hue, 0.f, 1.f);
139
saturation = SbClamp(saturation, 0.f, 1.f);
140
value = SbClamp(value, 0.f, 1.f);
156
142
#endif // COIN_DEBUG