Latest web development tutorials

VBScript RGB function

VBScript Reference Complete VBScript Reference

RGB function returns a number that represents an RGB color value.

grammar

RGB(red,green,blue)

参数 描述
red 必需。介于 0 - 255 之间(且包括)的数字,代表颜色的红色部分。
green 必需。介于 0 - 255 之间(且包括)的数字,代表颜色的绿色部分。
blue 必需。介于 0 - 255 之间(且包括)的数字,代表颜色的蓝色部分。

Examples

Example 1

<script type="text/vbscript">

document.write(rgb(255,0,0))

</script>

Examples of the above output:

255

try it"

Example 2

<script type="text/vbscript">

document.write(rgb(255,30,30))

</script>

Examples of the above output:

1974015

try it"

VBScript Reference Complete VBScript Reference