Namespace ROT.Color
Color operations
Defined in: <rot.js>.
Constructor Attributes | Constructor Name and Description |
---|---|
Method Attributes | Method Name and Description |
---|---|
<static> |
ROT.Color.add(color1, color2)
Add two or more colors
|
<static> |
ROT.Color.add_(color1, color2)
Add two or more colors, MODIFIES FIRST ARGUMENT
|
<static> |
ROT.Color.fromString(str)
|
<static> |
ROT.Color.hsl2rgb(color)
Converts an HSL color value to RGB.
|
<static> |
ROT.Color.interpolate(color1, color2, factor)
Interpolate (blend) two colors with a given factor
|
<static> |
ROT.Color.interpolateHSL(color1, color2, factor)
Interpolate (blend) two colors with a given factor in HSL mode
|
<static> |
ROT.Color.multiply(color1, color2)
Multiply (mix) two or more colors
|
<static> |
ROT.Color.multiply_(color1, color2)
Multiply (mix) two or more colors, MODIFIES FIRST ARGUMENT
|
<static> |
ROT.Color.randomize(color, diff)
Create a new random color based on this one
|
<static> |
ROT.Color.rgb2hsl(color)
Converts an RGB color value to HSL.
|
<static> |
ROT.Color.toHex(color)
|
<static> |
ROT.Color.toRGB(color)
|
Method Detail
<static>
{number[]}
ROT.Color.add(color1, color2)
Add two or more colors
- Parameters:
- {number[]} color1
- {number[]} color2
- Returns:
- {number[]}
<static>
{number[]}
ROT.Color.add_(color1, color2)
Add two or more colors, MODIFIES FIRST ARGUMENT
- Parameters:
- {number[]} color1
- {number[]} color2
- Returns:
- {number[]}
<static>
ROT.Color.fromString(str)
- Parameters:
- str
<static>
{number[]}
ROT.Color.hsl2rgb(color)
Converts an HSL color value to RGB. Expects 0..1 inputs, produces 0..255 outputs.
- Parameters:
- {number[]} color
- Returns:
- {number[]}
<static>
{number[]}
ROT.Color.interpolate(color1, color2, factor)
Interpolate (blend) two colors with a given factor
- Parameters:
- {number[]} color1
- {number[]} color2
- {float} factor Optional, Default: 0.5
- 0..1
- Returns:
- {number[]}
<static>
{number[]}
ROT.Color.interpolateHSL(color1, color2, factor)
Interpolate (blend) two colors with a given factor in HSL mode
- Parameters:
- {number[]} color1
- {number[]} color2
- {float} factor Optional, Default: 0.5
- 0..1
- Returns:
- {number[]}
<static>
{number[]}
ROT.Color.multiply(color1, color2)
Multiply (mix) two or more colors
- Parameters:
- {number[]} color1
- {number[]} color2
- Returns:
- {number[]}
<static>
{number[]}
ROT.Color.multiply_(color1, color2)
Multiply (mix) two or more colors, MODIFIES FIRST ARGUMENT
- Parameters:
- {number[]} color1
- {number[]} color2
- Returns:
- {number[]}
<static>
{number[]}
ROT.Color.randomize(color, diff)
Create a new random color based on this one
- Parameters:
- {number[]} color
- {number[]} diff
- Set of standard deviations
- Returns:
- {number[]}
<static>
{number[]}
ROT.Color.rgb2hsl(color)
Converts an RGB color value to HSL. Expects 0..255 inputs, produces 0..1 outputs.
- Parameters:
- {number[]} color
- Returns:
- {number[]}
<static>
ROT.Color.toHex(color)
- Parameters:
- color
<static>
ROT.Color.toRGB(color)
- Parameters:
- color