VBScript RGBFunction
Complete VBScript Reference
The RGB function returns a number representing an RGB color value.
Syntax
RGB(red,green,blue)
| Parameters | Description |
|---|---|
| red | Required. A number between 0 and 255 (inclusive) that represents the red component of the color. |
| green | Required. A number between 0 and 255 (inclusive) that represents the green component of the color. |
| blue | Required. A number between 0 and 255 (inclusive) that represents the blue component of the color. |
Example
Example 1
<script type="text/vbscript">
document.write(rgb(255,0,0))
</script>
document.write(rgb(255,0,0))
</script>
The output of the above example is:
255
Try it yourself »
Example 2
<script type="text/vbscript">
document.write(rgb(255,30,30))
</script>
document.write(rgb(255,30,30))
</script>
The output of the above example is:
1974015
Try it yourself »
Complete VBScript Reference Other Extensions