//-------------------------------------------------------------- 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); }
//-------------------------------------------------------------- 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); }