---
title: "FloodFill Constructor (Single, Single, Color, Color, FloodFillMode, Single)"
canonical: https://www.graphicsmill.com/docs/gm5/C_Aurigma_GraphicsMill_Transforms_FloodFill_ctor_6_f2180566.htm
product: "Graphics Mill 5.5 for .NET"
---

This documentation is for the old version. [Go to the latest Graphics Mill docs](https://www.graphicsmill.com/docs/gm/)

# FloodFill Constructor (Single, Single, Color, Color, FloodFillMode, Single)
 
Creates and initializes new [FloodFill](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Transforms_FloodFill.htm.md) class instance. You can set main flood fill parameters here.
 
**Namespace:** [Aurigma.GraphicsMill.Transforms](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill_Transforms.htm.md)
 **Assembly:** Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
 
## Syntax
  
```
Public Sub New ( _x As Single, _y As Single, _fillColor As Color, _targetColor As Color, _mode As FloodFillMode, _tolerance As Single _
)
```
 
```csharp
public FloodFill(float x,float y,Color fillColor,Color targetColor,FloodFillMode mode,float tolerance
)
```
 
### Parameters
 
 - x
     - Type: [System.Single](http://msdn2.microsoft.com/en-us/3www918f)
X-coordinate of the point to start filling from. You can change it later using [Point](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_Transforms_FloodFill_Point.htm.md) property.

 - y
     - Type: [System.Single](http://msdn2.microsoft.com/en-us/3www918f)
Y-coordinate of the point to start filling from. You can change it later using [Point](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_Transforms_FloodFill_Point.htm.md) property.

 - fillColor
     - Type: [Aurigma.GraphicsMill.Color](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Color.htm.md)
 [Color](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Color.htm.md) value that specifies a color to fill with. You can change it later using [FillColor](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_Transforms_FloodFill_FillColor.htm.md) property.

 - targetColor
     - Type: [Aurigma.GraphicsMill.Color](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Color.htm.md)
The [Color](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Color.htm.md) which is used to determine the filling area boundaries. The method behaviour depends on *mode* argument value. If *mode* is [UntilColor](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Transforms_FloodFillMode.htm.md), this is a boundary color (when algorithm meets this color, it stops filling). If *mode* is [TillColor](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Transforms_FloodFillMode.htm.md), this is a surface color (algorithm continue filling till current color is the same as target color). You can change it later using [TargetColor](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_Transforms_FloodFill_TargetColor.htm.md) property.

 - mode
     - Type: [Aurigma.GraphicsMill.Transforms.FloodFillMode](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Transforms_FloodFillMode.htm.md)
 [FloodFillMode](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Transforms_FloodFillMode.htm.md) value specifying how to determine the filling area boundary (see comments for *targetColor*). You can change it later using [Mode](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_Transforms_FloodFill_Mode.htm.md) property.

 - tolerance
     - Type: [System.Single](http://msdn2.microsoft.com/en-us/3www918f)
Value in range [0, 1] specifying admissible tolerance (distance between colors in color space) when comparing current color and target color (see comments for *targetColor*). Minimum value (0) means exact match of the colors, maximum value (1) means that any color matches. You can change it later using [Tolerance](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_Transforms_FloodFill_Tolerance.htm.md) property.
   
## See Also

### Reference

- [FloodFill Class](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Transforms_FloodFill.htm.md)
- [FloodFill Overload](https://www.graphicsmill.com/docs/gm5/O_T_Aurigma_GraphicsMill_Transforms_FloodFill_ctor.htm.md)
- [Aurigma.GraphicsMill.Transforms Namespace](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill_Transforms.htm.md)
