GMImage.SetFillColor
--------------------

Sets the Color to use when filling drawn objects.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [GraphicsMagick](component_GraphicsMagick.md) | [2.0](newinversion20.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "GMImage.SetFillColor"; ImageRef; Color ) 

**MBS**( **"GMImage.SetFillColor";** /\* Sets the Color to use when filling drawn objects. \*/  
**$ImageRef**; /\* The image reference number.e.g. 1 \*/   
**$Color**) /\* A color specification.   
Multiple formats are supported including various color names and # with hex number.  
See FAQ for details.e.g. "RGB 1 0 0" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| ImageRef | The image reference number. | 1 |
| Color | A color specification.    Multiple formats are supported including various color names and # with hex number.   See [FAQ for details](https://www.monkeybreadsoftware.com/filemaker/faq.shtml#56). | "RGB 1 0 0" |

### Result

Returns "OK" on success.

### Description

Sets the Color to use when filling drawn objects.  
### Examples

Set red fill color:

 MBS ( "GMImage.SetFillColor"; $img ; "red" )  
Draws a cirlce in a rectangle in a circle:

 Set Variable \[$img ; Value:MBS ( "[GMImage.New](GMImageNew.md)"; "100x100"; "white" )\]  
Set Variable \[$r ; Value:MBS ( "GMImage.SetFillColor"; $img ; "RGB 1 0 0" )\]  
Set Variable \[$r ; Value:MBS ( "[GMImage.SetStrokeColor](GMImageSetStrokeColor.md)"; $img ; "RGB 0 0 1" )\]  
Set Variable \[$r ; Value:MBS ( "[GMImage.DrawCircle](GMImageDrawCircle.md)"; $img ; 50; 50; 50; 90 )\]  
Set Variable \[$r ; Value:MBS ( "[GMImage.DrawRectangle](GMImageDrawRectangle.md)"; $img ; 22; 22; 100-22; 100-22 )\]  
Set Variable \[$r ; Value:MBS ( "[GMImage.DrawCircle](GMImageDrawCircle.md)"; $img ; 50; 50; 50; 100-22 )\]  
Set Field \[test::test ; MBS ( "[GMImage.WriteToPNGContainer](GMImageWriteToPNGContainer.md)"; $img ; "test.png" )\]  
Set Variable \[$r ; Value:MBS ( "[GMImage.Release](GMImageRelease.md)"; $img )\]  
Set transparent blue:

 MBS ("GMImage.SetFillColor"; $img ; "RGB 0 0 1 1")  
### See also

- [GMImage.FloodFillColor](GMImageFloodFillColor.md)
- [GMImage.GetBoxColor](GMImageGetBoxColor.md)
- [GMImage.GetFillRule](GMImageGetFillRule.md)
- [GMImage.SetBoxColor](GMImageSetBoxColor.md)
- [GMImage.SetFont](GMImageSetFont.md)
- [GMImage.SetPixelColor](GMImageSetPixelColor.md)
- [GMImage.SetStrokeAntiAlias](GMImageSetStrokeAntiAlias.md)
- [GMImage.SetStrokeColor](GMImageSetStrokeColor.md)
- [GMImage.WriteToFile](GMImageWriteToFile.md)
- [GMImage.WriteToPNGContainer](GMImageWriteToPNGContainer.md)

### Example Databases

- [Barcode/Barcode Generation JSON](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Barcode/Barcode%20Generation%20JSON.shtml#9ScriptAnchor_)
- [DynaPDF/Click Points](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Click%20Points.shtml#2ScriptAnchor_)
- [GraphicsMagick/Annotate Image](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/GraphicsMagick/Annotate%20Image.shtml#2ScriptAnchor_)
- [GraphicsMagick/Clip Image](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/GraphicsMagick/Clip%20Image.shtml#1ScriptAnchor_)
- [GraphicsMagick/Crop with Clicks](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/GraphicsMagick/Crop%20with%20Clicks.shtml#3ScriptAnchor_)
- [GraphicsMagick/Drawing](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/GraphicsMagick/Drawing.shtml#1ScriptAnchor_)
- [GraphicsMagick/Find Pixels](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/GraphicsMagick/Find%20Pixels.shtml#1ScriptAnchor_)
- [GraphicsMagick/GraphicsMagick Path Drawing](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/GraphicsMagick/GraphicsMagick%20Path%20Drawing.shtml#1ScriptAnchor_)
- [Mac and iOS/Machine Learning/Core Image Detection](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Mac%20and%20iOS/Machine%20Learning/Core%20Image%20Detection.shtml#1ScriptAnchor_)
- [Overlay](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Overlay.shtml#4ScriptAnchor_)

### Blog Entries

- [Self made charts in FileMaker](https://www.mbsplugins.de/archive/2025-06-26/Self_made_charts_in_FileMaker/monkeybreadsoftware_blog_filemaker)
- [Create QR-Codes with circles](https://www.mbsplugins.de/archive/2025-02-13/Create_QR-Codes_with_circles/monkeybreadsoftware_blog_filemaker)
- [GraphicsMagick in FileMaker, part 24](https://www.mbsplugins.de/archive/2022-12-24/GraphicsMagick_in_FileMaker_pa/monkeybreadsoftware_blog_filemaker)
- [GraphicsMagick in FileMaker, part 20](https://www.mbsplugins.de/archive/2022-12-20/GraphicsMagick_in_FileMaker_pa/monkeybreadsoftware_blog_filemaker)
- [GraphicsMagick in FileMaker, part 10](https://www.mbsplugins.de/archive/2022-12-10/GraphicsMagick_in_FileMaker_pa/monkeybreadsoftware_blog_filemaker)
- [What is new in the MBS FileMaker Plugin Version 10.4](https://www.mbsplugins.de/archive/2020-09-22/What_is_new_in_the_MBS_FileMak/monkeybreadsoftware_blog_filemaker)
- [Circle crop images in FileMaker with MBS Plugin](https://www.mbsplugins.de/archive/2018-01-18/Circle_crop_images_in_FileMake/monkeybreadsoftware_blog_filemaker)
- [Face detection via CoreImage in FileMaker](https://www.mbsplugins.de/archive/2017-07-23/Face_detection_via_CoreImage_i/monkeybreadsoftware_blog_filemaker)

### FileMaker Magazin

- [Ausgabe 6/2020, Seite 38](https://filemaker-magazin.de/neuigkeit/4118-Appetithappen-FMM_202006)

This function checks for a license.

Created 18th August 2014 , last changed 30th June 2026

  
[GMImage.SetFileName](GMImageSetFileName.md) - [GMImage.SetFillRule](GMImageSetFillRule.md)

[HTML Version](GMImageSetFillColor.shtml)