Difference between revisions of "Noise:setColorLookup"

From GiderosMobile
Line 15: Line 15:
 
'''first value''': height (number) <translate>must be in range [0..1]</translate><br/>
 
'''first value''': height (number) <translate>must be in range [0..1]</translate><br/>
 
'''second value''': color (number) <translate>in hex format</translate><br/>
 
'''second value''': color (number) <translate>in hex format</translate><br/>
'''third value'':' alpha (number, default = 1) <translate>must be in range [0..1] (optional)</translate><br/>
+
'''third value''': alpha (number, default = 1) <translate>must be in range [0..1] (optional)</translate><br/>
 
<br/>
 
<br/>
 
<br/>
 
<br/>

Revision as of 11:41, 3 July 2020


Available since: Gideros 2020.5
Class: Noise

Description


Set a color table used by texture generator functions: "getTexture" and "getTileTexture"

Noise:setColorLookup(t)

Parameters

t: (table) color table
Values:
first value: height (number) must be in range [0..1]
second value: color (number) in hex format
third value: alpha (number, default = 1) must be in range [0..1] (optional)


Example

require "FastNoise"

local n = Noise.new()
n:setColorLookup{
	{0.3, 0x4b3c37, 1},
	{0.4, 0xffffff, 1},
	{0.45, 0x5c443d, 1},
	{0.55, 0x3f6a14, 1},
	{0.6, 0x589718, 1},
	{0.7, 0x3666c6, 1},
	{0.9, 0xd1d080, 1},
	{1, 0x3463c3, 1},
}