RGB Function

Returns a Long integer color value consisting of red, green, and blue components.

SĂĽntaks:


RGB (Red, Green, Blue)

Tagastusväärtus:

Long

Parameeter:

Red: suvaline täisarvavaldis, mis tähistab liitvärvi punase komponenti (0-255).

Green: suvaline täisarvavaldis, mis tähistab liitvärvi rohelise komponenti (0-255).

Blue: suvaline täisarvavaldis, mis tähistab liitvärvi sinise komponenti (0-255).

tip

The color picker dialog helps computing red, green and blue components of a composite color. Changing the color of text and selecting Custom color displays the color picker dialog.


Veakoodid:

5 Vigane protseduuri väljakutse

Näide:


Sub ExampleColor
Dim lVar As Long
    lVar = rgb(128,0,200)
    MsgBox "Värv " & lVar & " koosneb:" & Chr(13) &_
        "punasest= " & red(lVar) & Chr(13)&_
        "rohelisest= " & green(lVar) & Chr(13)&_
        "sinisest= " & blue(lVar) & Chr(13) , 64,"värvist"
End Sub