This example uses GetColorRGB to return the current color settings for magenta. SetColorMap assigns magenta to the background display so you can view this color. SetColorRGB is used to modify the magenta color.

Sub ModifyMagenta ()

 'Declare variables for color coponents

 Dim magentaRed As Integer

 Dim magentaGreen As Integer

 Dim magentaBlue As Integer

 With Session

  'Restore the default colors

  .RestoreDefaults rcColors


  'Get the defaults color values for magenta

  magentaRed = .GetColorRGB(rcMagenta, rcRed)

  magentaGreen = .GetColorRGB(rcMagenta, rcGreen)

  magentaBlue = .GetColorRGB(rcMagenta, rcBlue)


  'Set plain text to black text on a magenta background

  'And pause to view the results

  .SetColorMap rcPlainAttribute, rcBlack, rcMagenta

  .MsgBox "Default Magenta"


  'Change the color coponents for magenta, decreasing the

  'red value by 20 and using default green and blue values

  .SetColorRGB rcMagenta, magentaRed -20, magentaGreen, magentaBlue


  .MsgBox "Edited Magenta"

 End With

End Sub