// setShapeRef provides a function to set color with hex model by given actual
// color value.
358084
func setShapeRef(color string, i int) *aRef {
	if color == "" {
		return &aRef{
			Idx: 0,
			ScrgbClr: &aScrgbClr{
				R: 0,
				G: 0,
				B: 0,
			},
		}
	}
	return &aRef{
		Idx: i,
		SrgbClr: &attrValString{
			Val: strings.Replace(strings.ToUpper(color), "#", "", -1),
		},
	}
}
478247
func (palette *Palette) SetColors(colors []Color) error {
	if colors == nil {
		return nil
	}
	var ptr *C.SDL_Color
	if len(colors) > 0 {
		ptr = (*C.SDL_Color)(unsafe.Pointer(&colors[0]))
	}

	r := C.SDL_SetPaletteColors((*C.SDL_Palette)(unsafe.Pointer(palette)),
		ptr, 0, C.int(len(colors)))
	if r != 0 {
		return GetError()
	}
	return nil
}
886019
func (s *BurnInDestinationSettings) SetShadowXOffset(v int64) *BurnInDestinationSettings {
	s.ShadowXOffset = &v
	return s
}
270715
func LabWhiteRef(l, a, b float64, wref [3]float64) Color {
	return Xyz(LabToXyzWhiteRef(l, a, b, wref))
}
857070
func (a *PrintToPDFArgs) SetMarginLeft(marginLeft float64) *PrintToPDFArgs {
	a.MarginLeft = &marginLeft
	return a
}
879863
func (s *DvbSubDestinationSettings) SetShadowYOffset(v int64) *DvbSubDestinationSettings {
	s.ShadowYOffset = &v
	return s
}
259254
func (s *ImportJobResource) SetDefineSegment(v bool) *ImportJobResource {
	s.DefineSegment = &v
	return s
}
1311488
func (renderer *Renderer) SetDrawColor(r, g, b, a uint8) error {
	return errorFromInt(int(
		C.SDL_SetRenderDrawColor(
			renderer.cptr(),
			C.Uint8(r),
			C.Uint8(g),
			C.Uint8(b),
			C.Uint8(a))))
}
233365
func (pattern *MeshPattern) SetCornerColorRGBA(cornerNum int, red, green, blue, alpha float64) {
	C.cairo_mesh_pattern_set_corner_color_rgba(pattern.Ptr, C.uint(cornerNum), C.double(red), C.double(green), C.double(blue), C.double(alpha))
	if err := pattern.status(); err != nil {
		panic(err)
	}
}
196458
func (met *Metrics) SetF(name string, value float64) {
	rounded := math.Floor(value + 0.5)
	atomic.StoreInt64(met.get(name), int64(rounded))
}
476336
func (builder *Builder) Color8BitF(c RGB8Bit) *Builder {
	return builder.With(Color8BitF(c))
}
1102064
func setColor(h windows.Handle, attr uint16) error {
	r1, _, err := setConsoleTextAttribute.Call(uintptr(h), uintptr(attr))

	if int(r1) == 0 { // setConsoleTextAttribute 返回 BOOL，而不是 bool
		return err
	}
	return nil
}
249967
func (imd *IMDraw) SetColorMask(color color.Color) {
	imd.mask = pixel.ToRGBA(color)
	imd.batch.SetColorMask(imd.mask)
}
545880
func (model *Model) SetDepth(val int) {
	model.Lock()
	model.Depth = val
	model.Unlock()
}
359904
func LuvWhiteRef(l, u, v float64, wref [3]float64) Color {
	return Xyz(LuvToXyzWhiteRef(l, u, v, wref))
}
665370
func (t *Table) SetColumnColor(colors ...Colors) {
	if t.colSize != len(colors) {
		panic("Number of column colors must be equal to number of headers.")
	}
	for i := 0; i < len(colors); i++ {
		t.columnsParams = append(t.columnsParams, makeSequence(colors[i]))
	}
}
1181099
func (gp *GoPdf) SetMarginLeft(margin float64) {
	gp.margins.Left = gp.UnitsToPoints(margin)
}