Color

This topic describes how color may be set FinalMesh WebGL. Internally color is stored as array of 3 or 4 floating point numbers. However for convinience color may be specified in following ways:

Type Example Description
array [1,1,1] array of 3 or 4 numbers. RGB or RGBA - Each component is in range from 0 to 1.
number 0xf0f0f0 RGB color in integer form. 8 least significant bits are blue color, next 8 bits are green and bits from 16 to 23 are red. Each component is in 0-255 range.
string "rgba(0,122,204,0.2)" RGBA color values are RGB color values with an alpha channel - which specifies the opacity for a color. An RGBA color value is specified with: rgba(red, green, blue, alpha) The alpha parameter is a number between 0.0 (fully transparent) and 1.0 (not transparent at all). Color components are from 0 to 255.
  "#f0f0f0" hexadecimal value in the form: #rrggbb, Where rr (red), gg (green) and bb (blue) are hexadecimal values between 00 and ff (same as decimal 0-255). For example, #ff0000 is red.

 

 

In this article