DynaPDF.SetFillColor
--------------------

The function sets the current fill color as an array of float values.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [DynaPDF](component_DynaPDF.md) | [3.1](newinversion31.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "DynaPDF.SetFillColor"; PDF; Value... ) 

**MBS**( **"DynaPDF.SetFillColor";** /\* The function sets the current fill color as an array of float values. \*/  
**$PDF**; /\* The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). \*/   
**$Value...**) /\* The values for the colors.e.g. 0 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| PDF | The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). | $pdf |
| Value... | The values for the colors. | 0 |

### Result

Returns OK or error message.

### Description

The function sets the current fill color as an array of float values.   
The components of non-Lab color spaces must be in the range from 0 through 1. The \*a and \*b components of a Lab color space are typically in a range from -128 though 127. The \*L component ranges from 0 through 100.  
The number of components must match the number of components of the underlying color space. You can add an alpha value on the end.  
For a grayscale color, please pass 3 times the gray level for a RGB color.  
  
This function takes variable number of parameters. Pass as much parameters as needed separated by the semicolon in FileMaker.  
Please repeat Value parameter as often as you need.  
See also [SetFillColor](https://www.monkeybreadsoftware.com/DynaPDF-Manual/SetFillColor.shtml) function in DynaPDF manual.

### Examples

Sets color to red:

 MBS ( "DynaPDF.SetFillColor"; $PDF ; 1.0 ; 0.0 ; 0.0 )  
Sets color to blue:

 MBS ( "DynaPDF.SetFillColor"; $PDF ; 0.0 ; 0.0 ; 1.0 )  
Sets color to middle level gray:

 MBS ( "DynaPDF.SetFillColor"; $PDF ; 0.5 ; 0.5 ; 0.5 )  
Write in CMYK:

 # switch to CMYK   
Set Variable \[ $r ; Value: MBS ( "[DynaPDF.SetColorSpace](DynaPDFSetColorSpace.md)"; $pdf ; "DeviceCMYK" )\]  
\# set color to Cyan   
Set Variable \[ $r ; Value: MBS ("DynaPDF.SetFillColor"; $pdf ; 1; 0; 0; 0)\]  
\# Write some text   
Set Variable \[ $r ; Value: MBS ("[DynaPDF.WriteText](DynaPDFWriteText.md)"; $pdf ; 100; $x ; "Some cyan text")\]  
\# now switch back to RGB   
Set Variable \[ $r ; Value: MBS ( "[DynaPDF.SetColorSpace](DynaPDFSetColorSpace.md)"; $pdf ; "DeviceRGB" )\]  
Draw line in a separation color:

 # draw line in Cut Color   
Set Variable \[ $cs ; Value: MBS ("[DynaPDF.CreateSeparationCS](DynaPDFCreateSeparationCS.md)"; $pdf ; "Through Cut"; "DeviceCMYK"; -1; MBS ("[DynaPDF.CMYK](DynaPDFCMYK.md)"; 0; 255; 0; 0)) \]   
Set Variable \[ $r ; Value: MBS ("[DynaPDF.SetExtColorSpace](DynaPDFSetExtColorSpace.md)"; $pdf ; $cs ) \]   
Set Variable \[ $r ; Value: MBS ("DynaPDF.SetFillColor"; $pdf ; 1) \]   
Set Variable \[ $r ; Value: MBS ( "[DynaPDF.Rectangle](DynaPDFRectangle.md)"; $pdf ; $x ; $y ; $w ; $h ; "Stroke" ) \]  
Set RGB color:

 MBS ( "DynaPDF.SetFillColor"; $PDF ; 247/255; 162/255; 53/255 )  
// Red 247 Green 162 Blue 53  
Set color to white for RGB:

 MBS ( "DynaPDF.SetFillColor"; $PDF ; 1.0 ; 1.0 ; 1.0 )  
Set color with integer values in range of 0 to 255:

 MBS ( "DynaPDF.SetFillColor"; $PDF ; $red / 255.0 ; $green / 255.0 ; /blue / 255.0 )  
### See also

- [DynaPDF.GetFieldColor](DynaPDFGetFieldColor.md)
- [DynaPDF.SetFieldBBox](DynaPDFSetFieldBBox.md)
- [DynaPDF.SetFieldColor](DynaPDFSetFieldColor.md)
- [DynaPDF.SetStrokeColorValue](DynaPDFSetStrokeColorValue.md)
- [DynaPDF.Triangle](DynaPDFTriangle.md)
- [DynaPDF.WriteFTextEx](DynaPDFWriteFTextEx.md)
- [DynaPDF.WriteFTextExRotated](DynaPDFWriteFTextExRotated.md)
- [DynaPDF.WriteStyledText](DynaPDFWriteStyledText.md)
- [DynaPDF.WriteStyledTextEx](DynaPDFWriteStyledTextEx.md)
- [DynaPDF.WriteText](DynaPDFWriteText.md)

### Release notes

- **Version 11.0**
    - Added [DynaPDF.SetFillColorValue](https://www.mbsplugins.eu/DynaPDFSetFillColorValue.shtml) and [DynaPDF.SetStrokeColorValue](https://www.mbsplugins.eu/DynaPDFSetStrokeColorValue.shtml) functions.

### Example Databases

- [Barcode/DynaPDF Barcode](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Barcode/DynaPDF%20Barcode.shtml#2ScriptAnchor_)
- [DynaPDF/Add Page Links](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Add%20Page%20Links.shtml#2ScriptAnchor_)
- [DynaPDF/Book Creation](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Book%20Creation.shtml#3ScriptAnchor_)
- [DynaPDF/Create DeviceN ColorSpace](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Create%20DeviceN%20ColorSpace.shtml#2ScriptAnchor_)
- [DynaPDF/Multi Column Output](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Multi%20Column%20Output.shtml#1ScriptAnchor_)
- [DynaPDF/Page Layouting](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Page%20Layouting.shtml#2ScriptAnchor_)
- [DynaPDF/Picture to PDF](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Picture%20to%20PDF.shtml#6ScriptAnchor_)
- [DynaPDF/Swiss QRCode](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Swiss%20QRCode.shtml#2ScriptAnchor_)
- [DynaPDF/WriteFText](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/WriteFText.shtml#2ScriptAnchor_)
- [OCR/OCR with DynaPDF](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/OCR/OCR%20with%20DynaPDF.shtml#1ScriptAnchor_)

### Blog Entries

- [Using DynaPDF with Data API for PDF generation](https://www.mbsplugins.de/archive/2026-05-25/Using_DynaPDF_with_Data_API_fo/monkeybreadsoftware_blog_filemaker)
- [Draw images with text using DynaPDF](https://www.mbsplugins.de/archive/2026-01-03/Draw_images_with_text_using_Dy/monkeybreadsoftware_blog_filemaker)
- [PDF Draw Modes](https://www.mbsplugins.de/archive/2025-09-25/PDF_Draw_Modes/monkeybreadsoftware_blog_filemaker)
- [Use complex text rendering with DynaPDF in FileMaker](https://www.mbsplugins.de/archive/2025-06-25/Use_complex_text_rendering_wit/monkeybreadsoftware_blog_filemaker)
- [Page Layouting in DynaPDF](https://www.mbsplugins.de/archive/2024-04-05/Page_Layouting_in_DynaPDF/monkeybreadsoftware_blog_filemaker)
- [Add page links for FileMaker](https://www.mbsplugins.de/archive/2022-06-18/Add_page_links_for_FileMaker/monkeybreadsoftware_blog_filemaker)
- [Things you can do with DynaPDF](https://www.mbsplugins.de/archive/2021-07-02/Things_you_can_do_with_DynaPDF/monkeybreadsoftware_blog_filemaker)
- [Swiss QR-Codes for invoices as vector graphics](https://www.mbsplugins.de/archive/2020-06-12/Swiss_QR-Codes_for_invoices_as/monkeybreadsoftware_blog_filemaker)

### FileMaker Magazin

- [Ausgabe 5/2021, Seite 26](https://filemaker-magazin.de/neuigkeit/4158-Appetithappen-FMM_202105)
- [Ausgabe 5/2018, Seite 28](https://filemaker-magazin.de/neuigkeit/4011-Appetithappen-FMM_201805)

This function checks for a license.

Created 18th August 2014 , last changed 25th February 2026

  
[DynaPDF.SetFieldToolTip](DynaPDFSetFieldToolTip.md) - [DynaPDF.SetFillColorValue](DynaPDFSetFillColorValue.md)

[HTML Version](DynaPDFSetFillColor.shtml)