UtilColorIsColorSimilar(Color, Color, Byte, Byte, Byte) Method
Determines whether two colors are similar.
It compares the RGB channel differences to match inside the range of the specified tolerance threshold values.
Namespace: DevCase.Core.Media.GraphicsAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
public static bool IsColorSimilar(
Color color1,
Color color2,
byte thresholdR,
byte thresholdG,
byte thresholdB
)
Public Shared Function IsColorSimilar (
color1 As Color,
color2 As Color,
thresholdR As Byte,
thresholdG As Byte,
thresholdB As Byte
) As Boolean
Dim color1 As Color
Dim color2 As Color
Dim thresholdR As Byte
Dim thresholdG As Byte
Dim thresholdB As Byte
Dim returnValue As Boolean
returnValue = UtilColor.IsColorSimilar(color1,
color2, thresholdR, thresholdG, thresholdB)
public:
static bool IsColorSimilar(
Color color1,
Color color2,
unsigned char thresholdR,
unsigned char thresholdG,
unsigned char thresholdB
)
static member IsColorSimilar :
color1 : Color *
color2 : Color *
thresholdR : byte *
thresholdG : byte *
thresholdB : byte -> bool
No code example is currently available or this language may not be supported.
- color1 Color
-
The first color to compare.
- color2 Color
-
The second color to compare.
- thresholdR Byte
-
The tolerance threshold of the Red color channel.
From 0 to 255.
- thresholdG Byte
-
The tolerance threshold of the Green color channel.
From 0 to 255.
- thresholdB Byte
-
The tolerance threshold of the Blue color channel.
From 0 to 255.
Boolean if the colors are similar,
this means the RGB differences matches inside the range of the specified tolerance threshold value,
otherwise.
This is a code example.
No code example is currently available or this language may not be supported.
Dim areSimilar As Boolean = IsColorSimilar(Color.FromArgb(0, 0, 0), Color.FromArgb(0, 0, 1),
thresholdR:=0, thresholdG:=0, thresholdB:=1)
' Result: True
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.