Reflection Desktop VBA Guide
Attachmate.Reflection.Objects.Emulation.OpenSystems Library / Attachmate.Reflection.Objects.Emulation.OpenSystems Library / ThemeColor Object / SetColorRGB Method

The integer value (between 0 and 15) that you want to change the mapping for in the color map. See the Remarks for more about how colors are mapped.

An integer value that specifies the degree of red saturation (red RGB value) for the new color. This can be any value between 0 and 255.
An integer value that specifies the degree of green saturation (green RGB value) for the new color. This can be any value between 0 and 255.
An integer value that specifies the degree of blue saturation (blue RGB value) for the new color. This can be any value between 0 and 255.
Example
In This Topic
    SetColorRGB Method
    In This Topic
    Sets a default color in the Theme color map to a new custom color.
    Syntax
    expression.SetColorRGB( _
       ByVal color As Integer, _
       ByVal red As Integer, _
       ByVal green As Integer, _
       ByVal blue As Integer _
    ) 
    where expression is a variable that represents a ThemeColor Object

    Parameters

    color

    The integer value (between 0 and 15) that you want to change the mapping for in the color map. See the Remarks for more about how colors are mapped.

    red
    An integer value that specifies the degree of red saturation (red RGB value) for the new color. This can be any value between 0 and 255.
    green
    An integer value that specifies the degree of green saturation (green RGB value) for the new color. This can be any value between 0 and 255.
    blue
    An integer value that specifies the degree of blue saturation (blue RGB value) for the new color. This can be any value between 0 and 255.
    Remarks

    In Open Systems sessions, screen colors are mapped to integer values in a color map. Although you can select from only one of 16 colors, you can change the actual screen colors to any RGB values by changing the RGB values of the color map.

    For example, if the screen foreground color of normal text is mapped to 0 in the map (which has a default color of Black), you can change the default RGB value mapped to 0 to another RGB value.

    You can use this approach to change the actual screen foreground or background color to any RGB color. Use the GetBackgroundColorAsInt Method or GetForegroundColorAsInt Method methods to get the integer value that is mapped to the screen color and then use this method to change the mapping for that color to any RGB value.

    You can view the theme color map in the user interface by clicking Color Map, under Text Color Mapping in the Modify Theme dialog box.

    The default color mapped to each integer value is shown below.

    The Theme Color Map

    Integer Default Colors for Non-Graphic Terminals Default Colors for Regis Graphics Terminals
    0 Black Black
    1 Dark Red Blue
    2 Dark Green Red
    3 Dark Yellow Green
    4 Dark Blue Magenta
    5 Dark Magenta Cyan
    6 Dark Cyan Yellow
    7 Dark Grey Grey
    8 Grey Dark Grey
    9 Red Dark Blue
    10 Green Dark Red
    11 Yellow Dark Green
    12 Blue Dark Magenta
    13 Magenta Dark Cyan
    14 Cyan Dark Yellow
    15 White Light Grey

    Example
    Set screen foreground and background colors
    Public Sub TestColors()
     
        Dim foregroundColorInt As Integer
        Dim backgroundColorInt As Integer
               
        Dim ScreenColor As Attachmate_Reflection_Objects_Emulation_OpenSystems.ThemeColor
            
        Set ScreenColor = ThisTerminal.Theme.color
        
        Rem Get the integer that is associated with the screen foreground and background colors
        foregroundColorInt = ScreenColor.GetForegroundColorAsInt(TextColorMappingAttribute_Plain)
        
        backgroundColorInt = ScreenColor.GetBackgroundColorAsInt(TextColorMappingAttribute_Plain)
        
        Rem Set the screen foreground and background colors by changing the color map
        ScreenColor.SetColorRGB foregroundColorInt, 250, 150, 200
        
        ScreenColor.SetColorRGB backgroundColorInt, 250, 50, 120
     
    End Sub
    See Also