Change hue.

        :param value: new hue value (between 0 and 360)
        :type value: int
194382
def set_hue(self, value):
        
        old = self._hue
        self._hue = value
        if value != old:
            self._fill()
            self.event_generate("<<ColorChanged>>")
1001916
def on_transparency_value_changed(self, hscale):
        
        value = hscale.get_value()
        self.prefDlg.set_colors_from_settings()
        self.settings.styleBackground.set_int('transparency', MAX_TRANSPARENCY - int(value))
230447
def set_xy_color(self, color_x, color_y, *, index=0, transition_time=None):
        """"""
        self._value_validate(color_x, RANGE_X, "X color")
        self._value_validate(color_y, RANGE_Y, "Y color")

        values = {
            ATTR_LIGHT_COLOR_X: color_x,
            ATTR_LIGHT_COLOR_Y: color_y
        }

        if transition_time is not None:
            values[ATTR_TRANSITION_TIME] = transition_time

        return self.set_values(values, index=index)
1048286
def text_color(self, value):
        

        if value is not None:
            assert type(value) in (Qt.GlobalColor, QColor), \
                "'{0}' attribute: '{1}' type is not 'int' or 'QColor'!".format("text_color", value)
        self.__text_color = value
599334
def add_lumOff(self, value):
        
        lumOff = self._add_lumOff()
        lumOff.val = value
        return lumOff
1286174
def set_hue(self, hue, duration=0, rapid=False):
        
        color = self.get_color()
        color2 = (hue, color[1], color[2], color[3])
        try:
            if rapid:
                self.fire_and_forget(LightSetColor, {"color": color2, "duration": duration}, num_repeats=1)
            else:
                self.req_with_ack(LightSetColor, {"color": color2, "duration": duration})
        except WorkflowException as e:
            raise
669806
def setvalue(self, value):
		
		self._value = abs(value)
		self._sign = 0
		if(value < 0):
			self._sign = 1
759099
def __RGB_to_Hue(var_R, var_G, var_B, var_min, var_max):
    
    if var_max == var_min:
        return 0.0
    elif var_max == var_R:
        return (60.0 * ((var_G - var_B) / (var_max - var_min)) + 360) % 360.0
    elif var_max == var_G:
        return 60.0 * ((var_B - var_R) / (var_max - var_min)) + 120
    elif var_max == var_B:
        return 60.0 * ((var_R - var_G) / (var_max - var_min)) + 240.0
401629
public void changeAlpha(int alpha) {
        alpha = alpha > 255 ? 255 : alpha < 0 ? 0 : alpha;

        Color foreground = getForeground();
        int red = foreground.getRed();
        int green = foreground.getGreen();
        int blue = foreground.getBlue();

        Color withAlpha = new Color(red, green, blue, alpha);
        super.setForeground(withAlpha);
    }
12651
def add_lumMod(self, value):
        
        lumMod = self._add_lumMod()
        lumMod.val = value
        return lumMod
1086511
def set_brightness(self, brightness):
        
        percent = 0
        if brightness > 0:
            percent = round(brightness / 2.55)

        self.set_service_value(
            self.dimmer_service,
            'LoadLevelTarget',
            'newLoadlevelTarget',
            percent)
        self.set_cache_value('level', percent)
1286807
def hue(self, hue):
        
        return self._build_command(0x40, self.convert_hue(hue),
                                   select=True, select_command=self.on())
884254
public static void adjustHue(ColorMatrix cm, float value)
    {
        value = cleanValue(value, 180f) / 180f * (float) Math.PI;
        if (value == 0)
        {
            return;
        }
        float cosVal = (float) Math.cos(value);
        float sinVal = (float) Math.sin(value);
        float lumR = 0.213f;
        float lumG = 0.715f;
        float lumB = 0.072f;
        float[] mat = new float[]
                {
                        lumR + cosVal * (1 - lumR) + sinVal * (-lumR), lumG + cosVal * (-lumG) + sinVal * (-lumG), lumB + cosVal * (-lumB) + sinVal * (1 - lumB), 0, 0,
                        lumR + cosVal * (-lumR) + sinVal * (0.143f), lumG + cosVal * (1 - lumG) + sinVal * (0.140f), lumB + cosVal * (-lumB) + sinVal * (-0.283f), 0, 0,
                        lumR + cosVal * (-lumR) + sinVal * (-(1 - lumR)), lumG + cosVal * (-lumG) + sinVal * (lumG), lumB + cosVal * (1 - lumB) + sinVal * (lumB), 0, 0,
                        0f, 0f, 0f, 1f, 0f
                };
        cm.postConcat(new ColorMatrix(mat));
    }
1357205
private static float hslConvert(float t1, float t2, float hue) {
		float value;
		if (hue < 0) {
			hue += 6;
		}
		if (hue >= 6) {
			hue -= 6;
		}
		if (hue < 1) {
			value = (t2 - t1) * hue + t1;
		} else if (hue < 3) {
			value = t2;
		} else if (hue < 4) {
			value = (t2 - t1) * (4 - hue) + t1;
		} else {
			value = t1;
		}
		return value;
	}
1327805
def update_color_state(self, light):
        """"""
        x, y = light.xy or (None, None)
        self.async_update({
            'state': {
                'bri': light.brightness,
                'hue': light.hue,
                'sat': light.sat,
                'ct': light.ct,
                'x': x,
                'y': y,
                'colormode': light.colormode,
            },
        })
115276
def get_color(self, value):
        
        if value in COLOR_SET:
            value = COLOR_MAP[value]
        else:
            try:
                value = int(value)
                if value >= 8:
                    raise ValueError()
            except ValueError as exc:
                raise ValueError(
                    'Colors should either a member of: {} or a positive '
                    'integer below 8'.format(', '.join(COLOR_NAMES))
                )
        return '{}{}'.format(self.PREFIX, value)
1348386
def change_interval(self, value):
        
        assert not isinstance(value, string_types)
        self.timestamps = []

        for timestamp in value:
            event = EventTime(timestamp)
            self.timestamps.append(event)