// SetRGB sets the Red Green Blue value of the LED.
321681
func (l *RgbLedDriver) SetRGB(r, g, b byte) error {
	l.redColor = r
	l.greenColor = g
	l.blueColor = b

	return l.On()
}
1056736
func (p *propMigratedMB) SetMigratedGB(size int) {
	if size <= 0 {
		p.MigratedMB = 0
	} else {
		p.MigratedMB = size * 1024
	}
}
50699
func (s *UploadLayerPartInput) SetLayerPartBlob(v []byte) *UploadLayerPartInput {
	s.LayerPartBlob = v
	return s
}
35060
func (b *Bucket) SetRaw(k string, exp int, v []byte) error {
	return b.Write(k, 0, exp, v, Raw)
}
44499
func (p *propSizeMB) SetSizeGB(size int) {
	if size <= 0 {
		p.SizeMB = 0
	} else {
		p.SizeMB = size * 1024
	}
}
761566
func (builder *Builder) RGB3BitB(r, g, b uint8) *Builder {
	return builder.Color3BitB(NewRGB3Bit(r, g, b))
}
650708
func (texture *Texture) UpdateRGBA(rect *Rect, pixels []uint32, pitch int) error {
	if pixels == nil {
		return nil
	}
	return errorFromInt(int(
		C.SDL_UpdateTexture(
			texture.cptr(),
			rect.cptr(),
			unsafe.Pointer(&pixels[0]),
			C.int(4*pitch)))) // 4 bytes in one uint32
}
323300
func hslToRGB(h, s, l float64) (uint8, uint8, uint8) {
	var r, g, b float64
	if s == 0 {
		v := clamp(l * 255)
		return v, v, v
	}

	var q float64
	if l < 0.5 {
		q = l * (1 + s)
	} else {
		q = l + s - l*s
	}
	p := 2*l - q

	r = hueToRGB(p, q, h+1/3.0)
	g = hueToRGB(p, q, h)
	b = hueToRGB(p, q, h-1/3.0)

	return clamp(r * 255), clamp(g * 255), clamp(b * 255)
}
900750
func NewRGB8Bit(r, g, b uint8) RGB8Bit {
	return RGB8Bit(16 + 36*(r/43) + 6*(g/43) + b/43)
}
752148
func (h *JHD1313M1Driver) SetRGB(r, g, b int) error {
	if err := h.setReg(REG_RED, r); err != nil {
		return err
	}
	if err := h.setReg(REG_GREEN, g); err != nil {
		return err
	}
	return h.setReg(REG_BLUE, b)
}
1126497
func (pattern *MeshPattern) SetCornerColorRGB(cornerNum int, red, green, blue float64) {
	C.cairo_mesh_pattern_set_corner_color_rgb(pattern.Ptr, C.uint(cornerNum), C.double(red), C.double(green), C.double(blue))
	if err := pattern.status(); err != nil {
		panic(err)
	}
}
327093
func (s *AttributeValue) SetB(v []byte) *AttributeValue {
	s.B = v
	return s
}
1242906
func (window *Window) SetGammaRamp(red, green, blue *[256]uint16) error {
	return errorFromInt(int(
		C.SDL_SetWindowGammaRamp(
			window.cptr(),
			(*C.Uint16)(unsafe.Pointer(red)),
			(*C.Uint16)(unsafe.Pointer(green)),
			(*C.Uint16)(unsafe.Pointer(blue)))))
}
326229
func (cr *Context) SetSourceRGB(red, green, blue float64) {
	C.cairo_set_source_rgb(cr.Ptr, C.double(red), C.double(green), C.double(blue))
	if err := cr.status(); err != nil {
		panic(err)
	}
}
1056352
func MapRGB(format *PixelFormat, r, g, b uint8) uint32 {
	return uint32(C.SDL_MapRGB((*C.SDL_PixelFormat)(unsafe.Pointer(format)),
		C.Uint8(r), C.Uint8(g), C.Uint8(b)))
}
674645
func (s *Hdr10Metadata) SetBluePrimaryX(v int64) *Hdr10Metadata {
	s.BluePrimaryX = &v
	return s
}
742418
func TrueColorFromRGB(r byte, g byte, b byte) TrueColor {
	return TrueColor(((uint(r) & 0xff) << 16) | ((uint(g) & 0xff) << 8) | (uint(b) & 0xff))
}