示例#1
0
//--------------------------------------------------------------
ofColor ColorUtil::getNoiseAround( ofColor c, float radius, float seedValue )
{
	float hue, saturation, brightness;
	
	c.getHsb(hue, saturation, brightness);

	float noise = (ofNoise(seedValue) * (radius * 2)) - radius;
	hue = hue + noise;
	if (hue < 0) 
		hue = 255.0f + hue;
	if (hue > 255.0) 
		hue = hue - 255.0f;
	
	c.setHsb(hue, saturation, brightness);

	return (c);
}
示例#2
0
//--------------------------------------------------------------
ofColor ColorUtil::getNoiseAroundMax( ofColor c, float radius )
{

	float hue, saturation, brightness;
	
	c.getHsb(hue, saturation, brightness);

	hue = hue + radius;
	if (hue < 0) 
		hue = 255.0f + hue;
	if (hue > 255.0) 
		hue = hue - 255.0f;
	
	c.setHsb(hue, saturation, brightness);

	return (c);

}