---
title: "setFillColor(_:)"
framework: coregraphics
role: symbol
role_heading: Instance Method
path: "coregraphics/cgcontext/setfillcolor(_:)-8lhn8"
---

# setFillColor(_:)

Sets the current fill color in a graphics context, using a CGColor.

## Declaration

```swift
func setFillColor(_ color: CGColor)
```

## Parameters

- `color`: The new fill color.

## See Also

### Setting Fill, Stroke, and Shadow Colors

- [setFillColor(_:)](coregraphics/cgcontext/setfillcolor(_:)-756dy.md)
- [setFillColor(cyan:magenta:yellow:black:alpha:)](coregraphics/cgcontext/setfillcolor(cyan:magenta:yellow:black:alpha:).md)
- [setFillColor(gray:alpha:)](coregraphics/cgcontext/setfillcolor(gray:alpha:).md)
- [setFillColor(red:green:blue:alpha:)](coregraphics/cgcontext/setfillcolor(red:green:blue:alpha:).md)
- [setFillColorSpace(_:)](coregraphics/cgcontext/setfillcolorspace(_:).md)
- [setShadow(offset:blur:)](coregraphics/cgcontext/setshadow(offset:blur:).md)
- [setShadow(offset:blur:color:)](coregraphics/cgcontext/setshadow(offset:blur:color:).md)
- [setStrokeColor(_:)](coregraphics/cgcontext/setstrokecolor(_:)-1sskg.md)
- [setStrokeColor(_:)](coregraphics/cgcontext/setstrokecolor(_:)-4pd8p.md)
- [setStrokeColor(cyan:magenta:yellow:black:alpha:)](coregraphics/cgcontext/setstrokecolor(cyan:magenta:yellow:black:alpha:).md)
- [setStrokeColor(gray:alpha:)](coregraphics/cgcontext/setstrokecolor(gray:alpha:).md)
- [setStrokeColor(red:green:blue:alpha:)](coregraphics/cgcontext/setstrokecolor(red:green:blue:alpha:).md)
- [setStrokeColorSpace(_:)](coregraphics/cgcontext/setstrokecolorspace(_:).md)
- [setStrokePattern(_:colorComponents:)](coregraphics/cgcontext/setstrokepattern(_:colorcomponents:).md)
- [setAlpha(_:)](coregraphics/cgcontext/setalpha(_:).md)
