Sets the RGB value and the position of the ambientLight
970120
public void setAmbientLight(float r, float g, float b, float x, float y,
            float z) {
        float ambient[] = { r, g, b, 255 };
        float position[] = { x, y, z, 1.0f };
        normalize(ambient);
        gl.glEnable(GL2.GL_LIGHTING);
        gl.glEnable(GL2.GL_LIGHT0);
        gl.glLightfv(GL2.GL_LIGHT0, GL2.GL_POSITION, position, 0);
        gl.glLightfv(GL2.GL_LIGHT0, GL2.GL_AMBIENT, ambient, 0);
    }
625899
def set_night_light_brightness(self, brightness=200):
        """"""
        self.publish(
            action='set',
            resource='cameras/{}'.format(self.device_id),
            publish_response=False,
            properties={'nightLight': {'brightness': brightness}}
        )
611545
def set_source_rgb(self, red, green, blue):
        
        cairo.cairo_set_source_rgb(self._pointer, red, green, blue)
        self._check_status()
601584
public void onMapSelected(float x, float y) {

        if (x > 255) {
            x = 255;
        }
        if (x < 0) {
            x = 0;
        }
        if (y > 255) {
            y = 255;
        }
        if (y < 0) {
            y = 0;
        }
        switch (m_colorMode) {
            case CmsSliderBar.HUE:
                m_saturation = percentOf(x, 100);
                m_brightness = 100 - percentOf(y, 100);
                m_tbSaturation.setText(Integer.toString(m_saturation));
                m_tbBrightness.setText(Integer.toString(m_brightness));
                onChange(m_tbHue);
                break;
            case CmsSliderBar.SATURATIN:
                m_hue = percentOf(x, 360);
                m_brightness = 100 - percentOf(y, 100);
                m_tbHue.setText(Integer.toString(m_hue));
                m_tbBrightness.setText(Integer.toString(m_brightness));
                onChange(m_tbSaturation);
                break;
            case CmsSliderBar.BRIGHTNESS:
                m_hue = percentOf(x, 360);
                m_saturation = 100 - percentOf(y, 100);
                m_tbHue.setText(Integer.toString(m_hue));
                m_tbSaturation.setText(Integer.toString(m_saturation));
                onChange(m_tbBrightness);
                break;
            case CmsSliderBar.RED:
                m_blue = (int)x;
                m_green = 255 - (int)y;
                m_tbBlue.setText(Integer.toString(m_blue));
                m_tbGreen.setText(Integer.toString(m_green));
                onChange(m_tbRed);
                break;
            case CmsSliderBar.GREEN:
                m_blue = (int)x;
                m_red = 255 - (int)y;
                m_tbBlue.setText(Integer.toString(m_blue));
                m_tbRed.setText(Integer.toString(m_red));
                onChange(m_tbGreen);
                break;
            case CmsSliderBar.BLUE:
                m_red = (int)x;
                m_green = 255 - (int)y;
                m_tbRed.setText(Integer.toString(m_red));
                m_tbGreen.setText(Integer.toString(m_green));
                onChange(m_tbBlue);
                break;
            default:
                break;
        }
    }
1299376
function(){
		var darkest,
			minBrightness = Number.MAX_VALUE;
		this.each(function(c){
			var luma = c.luminance();
			if(luma < minBrightness){
				darkest = c;
				minBrightness = luma;
			}
		});
		return darkest;
	}
878503
public void setAmbient(float ambient[]){
        for(int i = 0; i<ambient.length;i++)
            this.ambient[i]=ambient[i];
        Am = true;
    }
1108566
void setOrthoShadowMatrix(Matrix4f modelMtx, GVRLight light)
    {
        GVROrthogonalCamera camera = (GVROrthogonalCamera) getCamera();
        if (camera == null)
        {
            return;
        }

        float w = camera.getRightClippingDistance() - camera.getLeftClippingDistance();
        float h = camera.getTopClippingDistance() - camera.getBottomClippingDistance();
        float near = camera.getNearClippingDistance();
        float far = camera.getFarClippingDistance();

        modelMtx.invert();
        modelMtx.get(mTempMtx);
        camera.setViewMatrix(mTempMtx);
        mShadowMatrix.setOrthoSymmetric(w, h, near, far);
        mShadowMatrix.mul(modelMtx);
        sBiasMatrix.mul(mShadowMatrix, mShadowMatrix);
        mShadowMatrix.getColumn(0, mTemp);
        light.setVec4("sm0", mTemp.x, mTemp.y, mTemp.z, mTemp.w);
        mShadowMatrix.getColumn(1, mTemp);
        light.setVec4("sm1", mTemp.x, mTemp.y, mTemp.z, mTemp.w);
        mShadowMatrix.getColumn(2, mTemp);
        light.setVec4("sm2", mTemp.x, mTemp.y, mTemp.z, mTemp.w);
        mShadowMatrix.getColumn(3, mTemp);
        light.setVec4("sm3", mTemp.x, mTemp.y, mTemp.z, mTemp.w);
    }
1102440
function (ui, context) {
					if (context != colorMap) {
						switch (settings.color.mode) {
						case 'h':
							var sv = ui.val('sv');
							colorMap.val('xy', {
								x: sv != null ? sv.s : 100,
								y: 100 - (sv != null ? sv.v : 100)
							}, context);
							break;
						case 's':
						case 'a':
							var hv = ui.val('hv');
							colorMap.val('xy', {
								x: hv && hv.h || 0,
								y: 100 - (hv != null ? hv.v : 100)
							}, context);
							break;
						case 'v':
							var hs = ui.val('hs');
							colorMap.val('xy', {
								x: hs && hs.h || 0,
								y: 100 - (hs != null ? hs.s : 100)
							}, context);
							break;
						case 'r':
							var bg = ui.val('bg');
							colorMap.val('xy', {
								x: bg && bg.b || 0,
								y: 255 - (bg && bg.g || 0)
							}, context);
							break;
						case 'g':
							var br = ui.val('br');
							colorMap.val('xy', {
								x: br && br.b || 0,
								y: 255 - (br && br.r || 0)
							}, context);
							break;
						case 'b':
							var rg = ui.val('rg');
							colorMap.val('xy', {
								x: rg && rg.r || 0,
								y: 255 - (rg && rg.g || 0)
							}, context);
							break;
						}
					}
					if (context != colorBar) {
						switch (settings.color.mode) {
						case 'h':
							colorBar.val('y', 360 - (ui.val('h') || 0), context);
							break;
						case 's':
							var s = ui.val('s');
							colorBar.val('y', 100 - (s != null ? s : 100), context);
							break;
						case 'v':
							var v = ui.val('v');
							colorBar.val('y', 100 - (v != null ? v : 100), context);
							break;
						case 'r':
							colorBar.val('y', 255 - (ui.val('r') || 0), context);
							break;
						case 'g':
							colorBar.val('y', 255 - (ui.val('g') || 0), context);
							break;
						case 'b':
							colorBar.val('y', 255 - (ui.val('b') || 0), context);
							break;
						case 'a':
							var a = ui.val('a');
							colorBar.val('y', 255 - (a != null ? a : 255), context);
							break;
						}
					}
				}
684103
public void setAmbient(float red, float green, float blue){
        ambient[0]=red;
        ambient[1]=green;
        ambient[2]=blue;
        Am = true;
    }
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 })
1204916
public void setAmbientLight(float r, float g, float b, Vector3D v) {
        float ambient[] = { r, g, b, 255 };
        float position[] = { (float)v.getX(), (float)v.getY(), (float)v.getZ(), 1.0f };
        normalize(ambient);
        gl.glEnable(GL2.GL_LIGHTING);
        gl.glEnable(GL2.GL_LIGHT0);
        gl.glLightfv(GL2.GL_LIGHT0, GL2.GL_POSITION, position, 0);
        gl.glLightfv(GL2.GL_LIGHT0, GL2.GL_AMBIENT, ambient, 0);
    }
727136
def ambient_light_intensity(self):
        
        self._ensure_mode(self.MODE_AMBIENT)
        return self.value(0) * self._scale('AMBIENT')
1171049
def set(self, hue):
        """"""
        x = hue / 360. * self.winfo_width()
        self.coords('cursor', x, 0, x, self.winfo_height())
        self._variable.set(hue)
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
686634
def setPixelColorRGB(self, n, red, green, blue):
        
        self.setPixelColor(n, Color(red, green, blue))
514123
def update_value(self, key, value):
        """"""

        if key == "Status":
            self._inhibited = value != "Enabled"
        elif key == "Color temperature":
            self._temperature = int(value.rstrip("K"), 10)
        elif key == "Period":
            self._period = value
        elif key == "Brightness":
            self._brightness = value
        elif key == "Location":
            location = []
            for x in value.split(", "):
                v, d = x.split(" ")
                location.append(float(v) * (1 if d in "NE" else -1))
            self._location = (location)
386318
@Override
    public void setValue(double value) {
        super.setValue(value);

        // Set active leds relating to the new value
        calcNoOfActiveLed();

        if (isValueCoupled()) {
            setLcdValue(value);
        }
        repaint(getInnerBounds());
    }