colours | objects | textures | transformation | lighting


p o v - r a y
colours

rgb notation

red sphere

this image is a scene of a red sphere. its pigment is determined using the rgb notation. the code used is as follows:
line90: color rgb <1.0, 0.0, 0.0>
this line is used in the pigment parameter of the sphere object. the three numbers within the angle brackets represent, from left to right; red, green, and blue. as these numbers normally range between 0 to 1, therefore, red is at 100% intensity whereas green and blue are at 0% intensity resulting in the colour red.



predefined colours

yellow sphere

this image is a scene of a yellow sphere. its pigment is determined using predefined colours. the code used is as follows:
line06: #include "colors.inc"
line90: color Yellow
line06 is required to use predefined colours as these colours are set in the include file, in this case, colors.inc. it is possible that users create their own include file for custom predefined colours. line90 is used in the pigment parameter of the sphere object. the colour name is case sensitive according to how it is named in the include file.



color_map

blue and white sphere » blue and white striped sphere

the left image is a scene of a blue and white sphere. its pigment is determined using color_map. the code used is as follows:
line90: gradient x
line92: [0.0 rgb <1.0, 1.0, 1.0>]
line93: [0.5 rgb <0.0, 0.0, 1.0>]
line94: [1.0 rgb <1.0, 1.0, 1.0>]
line90 is used to create the colour change along the x axis of the sphere. line92, line93 and line94 follows the rgb notation for colour, but the preceeding value of each line normally range from 0 to 1 and represents the location on the sphere, with 0 being the center as well as one end, and 1 being the other end as well as the center. as line92 and line93 changes colour from 0.0 to 0.5, this creates a smooth change.

the right image is a scene of a blue and white striped sphere. it is actually the same sphere as on the left, but with modified and added lines. the code used is as follows:
line92: [0.0 rgb <1.0, 1.0, 1.0>]
line93: [0.3 rgb <1.0, 1.0, 1.0>]
line94: [0.3 rgb <0.0, 0.0, 1.0>]
line95: [0.6 rgb <0.0, 0.0, 1.0>]
line96: [0.6 rgb <1.0, 1.0, 1.0>]
line97: [1.0 rgb <1.0, 1.0, 1.0>]
line92 and line93 does not have any colour change between 0.0 to 0.3. line93 and line94, on the other hand, encounters a change in colour. because it occurs between 0.3 and 0.3, this results in an abrupt change, resulting in a clear border between the white and blue pigments.



colours | objects | textures | transformation | lighting