Set device color.
323039
def set_color_temp(self, color_temp):
        """"""
        if self._json_state['control_url']:
            url = CONST.INTEGRATIONS_URL + self._device_uuid

            color_data = {
                'action': 'setcolortemperature',
                'colorTemperature': int(color_temp)
            }

            response = self._abode.send_request("post", url, data=color_data)
            response_object = json.loads(response.text)

            _LOGGER.debug("Set Color Temp Response: %s", response.text)

            if response_object['idForPanel'] != self.device_id:
                raise AbodeException((ERROR.SET_STATUS_DEV_ID))

            if response_object['colorTemperature'] != int(color_temp):
                _LOGGER.warning(
                    ("Set color temp mismatch for device %s. "
                     "Request val: %s, Response val: %s "),
                    self.device_id, color_temp,
                    response_object['colorTemperature'])

            self.update(response_object)

            _LOGGER.info("Set device %s color_temp to: %s",
                         self.device_id, color_temp)
            return True

        return False
1329281
def update_colors(self, colors):
        ''''''
        self.colors = np.array(colors, dtype='uint8')
        prim_colors = self._gen_colors(self.colors)
        
        self._color_vbo.set_data(prim_colors)
        self.widget.update()
726056
def apply_color(self, arr, state):
        """"""
        ops = self.cmd(state)
        for func in parse_operations(ops):
            arr = func(arr)
        return arr
983265
def setOverlayColor(self, ulOverlayHandle, fRed, fGreen, fBlue):
        """"""

        fn = self.function_table.setOverlayColor
        result = fn(ulOverlayHandle, fRed, fGreen, fBlue)
        return result
923862
def set_hex_color(self, color, *, index=0, transition_time=None):
        """"""
        values = {
            ATTR_LIGHT_COLOR_HEX: color,
        }

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

        return self.set_values(values, index=index)
392046
def set_color(self, red, green, blue):
        
        if self._pwm_enabled:
            # Set duty cycle of PWM pins.
            rdc, gdc, bdc = self._rgb_to_duty_cycle((red, green, blue))
            self._pwm.set_duty_cycle(self._red, rdc)
            self._pwm.set_duty_cycle(self._green, gdc)
            self._pwm.set_duty_cycle(self._blue, bdc)
        else:
            # Set appropriate backlight pins based on polarity and enabled colors.
            self._gpio.output_pins({self._red:   self._blpol if red else not self._blpol,
                                    self._green: self._blpol if green else not self._blpol,
                                    self._blue:  self._blpol if blue else not self._blpol })
575612
def _write_color (self, text, color=None):
        """"""
        if color is None:
            self.fp.write(text)
        else:
            write_color(self.fp, text, color)
287657
def colors(self):
        """"""
        try:
            return get_console_info(self._kernel32, self._stream_handle)[:2]
        except OSError:
            return WINDOWS_CODES['white'], WINDOWS_CODES['black']
596875
def onThemeColor(self, color, item):
        """"""
        bconf = self.panel_bot.conf
        if item == 'grid':
            bconf.set_gridcolor(color)
        elif item == 'bg':
            bconf.set_bgcolor(color)
        elif item == 'frame':
            bconf.set_framecolor(color)
        elif item == 'text':
            bconf.set_textcolor(color)
        bconf.canvas.draw()
747150
def set_rainbow(self, duration):
        """"""
        for i in range(0, 359):
            self.set_color_hsv(i, 100, 100)
            time.sleep(duration/359)
482840
def set_brightness(host, did, value, token=None):
    """"""
    urllib3.disable_warnings()
    if token:
        scheme = "https"
    if not token:
        scheme = "http"
        token = "1234567890"
    url = (
            scheme + '://' + host + '/gwr/gop.php?cmd=DeviceSendCommand&data=<gip><version>1</version><token>' + token + '</token><did>' + did + '</did><value>' + str(
        value) + '</value><type>level</type></gip>&fmt=xml')
    response = requests.get(url, verify=False)
    if response.status_code == '200':
        return True
    else:
        return False
19764
async def _setcolor(self, *, color : discord.Colour):
        """"""
        data = self.bot.config.get("meta", {})
        data['default_color'] = str(color)
        await self.bot.config.put('meta', data)
        await self.bot.responses.basic(message="The default color has been updated.")
1001569
def set_white(self, brightness, colourtemp):
        
        if not 25 <= brightness <= 255:
            raise ValueError("The brightness needs to be between 25 and 255.")
        if not 0 <= colourtemp <= 255:
            raise ValueError("The colour temperature needs to be between 0 and 255.")

        payload = self.generate_payload(SET, {
            self.DPS_INDEX_MODE: self.DPS_MODE_WHITE,
            self.DPS_INDEX_BRIGHTNESS: brightness,
            self.DPS_INDEX_COLOURTEMP: colourtemp})

        data = self._send_receive(payload)
        return data
117336
def set_brightness(self, brightness, duration=0, rapid=False):
        
        color = self.get_color()
        color2 = (color[0], color[1], brightness, 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
224360
def set_color_scheme(self, color_scheme, reset=True):
        """"""
        # Needed to handle not initialized kernel_client
        # See issue 6996
        try:
            self.shellwidget.set_color_scheme(color_scheme, reset)
        except AttributeError:
            pass
876580
private final void setColor(ColorSet colorSet) {
        int[] rgb = ColorSet.getRGB(colorSet);
        this.red   = rgb[0] / 255.0;
        this.green = rgb[1] / 255.0;
        this.blue  = rgb[2] / 255.0;
    }
85089
def set_color(self, color):
        
        if color is not None:
            self._color_lev = color
            self._need_color_update = True
            self.update()