API Documentation > CorelDRAW > 2025-v26 > Color > IVGColor
Color.IsSame method
Returns True if the two colors are of the same color model, with equal color values
Syntax:
Function IsSame(ByVal Color As Color) As Boolean
Parameters:
Name Type Description
Color
Remarks:
The IsSame method returns True if the two colors are of the same color model, with equal color values.
Examples:
The following VBA example creates two shapes, fills one with a CMYK color, and fills the other with an RGB color. The CMYK color is converted to RGB and the two colors are tested. If the two colors are the same, the first color is changed to white.
Sub Test()
Dim s1 As Shape, s2 As Shape
'Two shapes with a red fill from different color palettes
Set s1 = ActiveDocument.ActiveLayer.CreateEllipse2(3, 3, 2)
s1.Fill.ApplyUniformFill CreateCMYKColor(0, 100, 100, 0) 'Red
Set s2 = ActiveDocument.ActiveLayer.CreateEllipse2(6, 6, 2)
s2.Fill.ApplyUniformFill CreateRGBColor(255, 0, 0) 'Red
'Convert fill of s1 to the same color palette as the fill of s2
s1.Fill.UniformColor.ConvertToRGB
If Not s1.Fill.UniformColor.IsSame(s2.Fill.UniformColor) Then
  s1.Fill.UniformColor.RGBAssign 255, 255, 255
End If 
End Sub