ColorExtensionsTolerantEquals(PColorF, PColorF, Single, Single) Method
Gets whether two
PColorF instances are equal using a specified
tolerance.
Namespace: KGySoft.Drawing.ImagingAssembly: KGySoft.Drawing.Core (in KGySoft.Drawing.Core.dll) Version: 9.0.0
public static bool TolerantEquals(
this PColorF c1,
PColorF c2,
float tolerance = 1E-06f,
float alphaThreshold = 0f
)
<ExtensionAttribute>
Public Shared Function TolerantEquals (
c1 As PColorF,
c2 As PColorF,
Optional tolerance As Single = 1E-06F,
Optional alphaThreshold As Single = 0F
) As Boolean
public:
[ExtensionAttribute]
static bool TolerantEquals(
PColorF c1,
PColorF c2,
float tolerance = 1E-06f,
float alphaThreshold = 0f
)
[<ExtensionAttribute>]
static member TolerantEquals :
c1 : PColorF *
c2 : PColorF *
?tolerance : float32 *
?alphaThreshold : float32
(* Defaults:
let _tolerance = defaultArg tolerance 1E-06f
let _alphaThreshold = defaultArg alphaThreshold 0f
*)
-> bool
- c1 PColorF
- The first color to compare.
- c2 PColorF
- The second color to compare.
- tolerance Single (Optional)
- The allowed tolerance for ARGB components. For performance reasons this parameter is not validated. This parameter is optional.
Default value: 0.000001 (10-6). - alphaThreshold Single (Optional)
- Specifies a threshold under which colors are considered transparent. If both colors have lower A value than the threshold, then they are considered equal.
If only one of the specified colors has lower A value than the threshold, then the colors are considered different.
If both colors' A value are equal to or greater than this value, then tolerance is applied to the A value, too.
For performance reasons this parameter is not validated. This parameter is optional.
Default value: 0.
Boolean, if the colors are considered equal with the specified
tolerance; otherwise,
.In Visual Basic and C#, you can call this method as an instance method on any object of type
PColorF. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).