public virtual void UpdateWithHSV(HSV hsv) { HSV hsvTemp; hsvTemp.s = 1; hsvTemp.h = hsv.h; hsvTemp.v = 1; RGBA rgb = CCControlUtils.RGBfromHSV(hsvTemp); _background.Color = new CCColor3B((byte)(rgb.r * 255.0f), (byte)(rgb.g * 255.0f), (byte)(rgb.b * 255.0f)); }
//virtual ~ControlColourPicker(); public void HueSliderValueChanged(Object sender, CCControlEvent controlEvent) { _hsv.h = ((CCControlHuePicker)sender).Hue; // Update the value RGBA rgb = CCControlUtils.RGBfromHSV(_hsv); // XXX fixed me if not correct base.Color = new CCColor3B((byte)(rgb.r * 255.0f), (byte)(rgb.g * 255.0f), (byte)(rgb.b * 255.0f)); // Send Control callback SendActionsForControlEvents(CCControlEvent.ValueChanged); UpdateControlPicker(); }
public void ColourSliderValueChanged(Object sender, CCControlEvent controlEvent) { _hsv.s = ((CCControlSaturationBrightnessPicker)sender).Saturation; _hsv.v = ((CCControlSaturationBrightnessPicker)sender).Brightness; // Update the value RGBA rgb = CCControlUtils.RGBfromHSV(_hsv); // XXX fixed me if not correct base.Color = new CCColor3B((byte)(rgb.r * 255.0f), (byte)(rgb.g * 255.0f), (byte)(rgb.b * 255.0f)); // Send Control callback SendActionsForControlEvents(CCControlEvent.ValueChanged); }