Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback. Functions (Visual Basic for Applications).MyObject.Color = RGB(255, 0, 0) ' Set the Color property of MyObject to Red. Red = RGB(255, 0, 0) ' Return the value for Red. If MyObject does not exist, or if it does not have a Color property, an error occurs. In a RGB color space, which is consist of 100 red, 0 green and 0 blue, and that corresponding RGB values are 255, 0, 0. When color beyond the primary and secondary palettes is needed for distinction, the tertiary colors can be used, but cannot overpower the use of Dartmouth Pine Green. This page lists many detailed information about the hex color FF0000. The object MyObject and its property are used for illustration purposes only. RGB: 255, 255, 255 Midnight Black CMYK: 50, 50, 50, 100 RBG: 0, 0, 0. The value for any argument to RGB that exceeds 255 is assumed to be 255. It is used for those application methods and properties that accept a color specification. An RGB color value specifies the relative intensity of red, green, and blue to cause a specific color to be displayed. This example shows how the RGB function is used to return a whole number representing an RGB color value. They may be used within the context of Microsoft applications for the Macintosh, but should not be used when communicating color changes directly to the Macintosh operating system. The RGB color values returned by this function are incompatible with those used by the Macintosh operating system. The following table lists some standard colors and the red, green, and blue values they include: Color An RGB color value specifies the relative intensity of red, green, and blue to cause a specific color to be displayed. Number in the range 0–255, inclusive, that represents the blue component of the color.Īpplication methods and properties that accept a color specification expect that specification to be a number representing an RGB color value. Number in the range 0–255, inclusive, that represents the green component of the color. For example, rgb (255, 0, 0) is displayed as red, because red is set to its highest value (255) and the others are set to 0. Number in the range 0–255, inclusive, that represents the red component of the color. In CSS, a color can be specified as an RGB value, using this formula: rgb ( red, green, blue) Each parameter (red, green, and blue) defines the intensity of the color between 0 and 255. Hexadecimal colors represent a more efficient way (for machines) to represent the three RGB colors. Given that the three RGB components having 256 possible values, then there are 256256256 possible colors, or a total of 16,777,216 colors. The RGB function syntax has these named arguments: Part Each of the RGB color components ranges from 0 to 255. Returns a Long whole number representing an RGB color value.