# [name]

Represents a color. See also [page:ColorUtils].

## Example

`var color = new THREE.Color( 0xff0000 );`

## Constructor

### [name]( [page:Integer hex])

hex — initial color in hexadecimal

## Properties

### .[page:Float r]

Red channel value between 0 and 1. Default is 1.

### .[page:Float g]

Green channel value between 0 and 1. Default is 1.

### .[page:Float b]

Blue channel value between 0 and 1. Default is 1.

## Methods

### .copy( [page:Color color] ) [page:this]

color — Color to copy.
Copies given color.

### .copyGammaToLinear( [page:Color color] ) [page:this]

color — Color to copy.
Copies given color making conversion from gamma to linear space.

### .copyLinearToGamma( [page:Color color] ) [page:this]

color — Color to copy.
Copies given color making conversion from linear to gamma space.

### .convertGammaToLinear() [page:this]

Converts this color from gamma to linear space.

### .convertLinearToGamma() [page:this]

Converts this color from linear to gamma space.

### .setRGB( [page:Float r], [page:Float g], [page:Float b] ) [page:this]

r — Red channel value between 0 and 1.
g — Green channel value between 0 and 1.
b — Blue channel value between 0 and 1.
Sets this color from RGB values.

### .setHSV( [page:Float h], [page:Float s], [page:Float v] ) [page:this]

h — Hue channel value between 0 and 1.
s — Saturation value channel between 0 and 1.
v — Value channel value between 0 and 1.
Sets this color from HSV values.
Based on MochiKit implementation by Bob Ippolito.

### .setHex( [page:Integer hex] ) [page:this]

hex — Color in hexadecimal.
Sets this color from a hexadecimal value.

### .getHex() [page:Integer]

Returns the value of this color in hexadecimal.

### .getContextStyle() [page:String]

Returns the value of this color in CSS context style.
Example: rgb(r, g, b)

### .clone() [page:Color]

Clones this object.

## Source

src/[path].js