Difference between revisions of "Noise:setColorLookup"
m (→Description) |
m (Text replacement - "<source" to "<syntaxhighlight") |
||
Line 7: | Line 7: | ||
Set a color table used by texture generator functions: [[Special:MyLanguage/Noise:getTexture|Noise:getTexture]] and [[Special:MyLanguage/Noise:getTileTexture|Noise:getTileTexture]]<br /> | Set a color table used by texture generator functions: [[Special:MyLanguage/Noise:getTexture|Noise:getTexture]] and [[Special:MyLanguage/Noise:getTileTexture|Noise:getTileTexture]]<br /> | ||
<br /></translate> | <br /></translate> | ||
− | < | + | <syntaxhighlight lang="lua"> |
Noise:setColorLookup(colors) | Noise:setColorLookup(colors) | ||
</source> | </source> | ||
Line 16: | Line 16: | ||
<br/> | <br/> | ||
'''Example''' | '''Example''' | ||
− | < | + | <syntaxhighlight lang="lua"> |
require "FastNoise" | require "FastNoise" | ||
-- color table is a table of tables, each containing up to 3 values... | -- color table is a table of tables, each containing up to 3 values... |
Revision as of 14:30, 13 July 2023
Available since: Gideros 2020.5
Class: Noise
Description
Set a color table used by texture generator functions: Noise:getTexture and Noise:getTileTexture
<syntaxhighlight lang="lua">
Noise:setColorLookup(colors)
</source>
Parameters
colors: (table) color table (see example for details)
Example
<syntaxhighlight lang="lua">
require "FastNoise"
-- color table is a table of tables, each containing up to 3 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)
local n = Noise.new() n:setColorLookup{ {0.3, 0x4b3c37}, {0.4, 0xffffff, 0.8}, {0.45, 0x5c443d}, {0.55, 0x3f6a14, 0.9}, {0.6, 0x589718}, {0.7, 0x3666c6}, {0.9, 0xd1d080}, {1, 0x3463c3}, }</source>
- Noise:getCellularDistanceFunction
- Noise:getCellularJitter
- Noise:getCellularNoiseLookup
- Noise:getCellularReturnType
- Noise:getFractalGain
- Noise:getFractalLacunarity
- Noise:getFractalOctaves
- Noise:getFractalType
- Noise:getFrequency
- Noise:getGradientPerturbAmp
- Noise:getInterp
- Noise:getNoiseType
- Noise:getSeed
- Noise:getTexture
- Noise:getTileTexture
- Noise:gradientPerturb2D
- Noise:gradientPerturb3D
- Noise:gradientPerturbFractal2D
- Noise:gradientPerturbFractal3D
- Noise:noise
- Noise:noise2D
- Noise:noise3D
- Noise:reset
- Noise:setCellularDistance2Indices
- Noise:setCellularDistanceFunction
- Noise:setCellularJitter
- Noise:setCellularNoiseLookup
- Noise:setCellularReturnType
- Noise:setColorLookup
- Noise:setFractalGain
- Noise:setFractalLacunarity
- Noise:setFractalOctaves
- Noise:setFractalType
- Noise:setFrequency
- Noise:setGradientPerturbAmp
- Noise:setInterp
- Noise:setNoiseType
- Noise:setSeed
- Noise:simplex4D
- Noise:whiteNoise2DInt
- Noise:whiteNoise3DInt
- Noise:whiteNoise4D
- Noise:whiteNoise4DInt
- Noise.BILLOW
- Noise.CELLULAR
- Noise.CELL VALUE
- Noise.CUBIC
- Noise.CUBIC FRACTAL
- Noise.DISTANCE
- Noise.DISTANCE 2
- Noise.DISTANCE 2 ADD
- Noise.DISTANCE 2 DIV
- Noise.DISTANCE 2 MUL
- Noise.DISTANCE 2 SUB
- Noise.EUCLIDEAN
- Noise.FBM
- Noise.HERMITE
- Noise.LINEAR
- Noise.MANHATTAN
- Noise.NATURAL
- Noise.NOISE LOOKUP
- Noise.PERLIN
- Noise.PERLIN FRACTAL
- Noise.QUINTIC
- Noise.RIGID MULTI
- Noise.SIMPLEX
- Noise.SIMPLEX FRACTAL
- Noise.VALUE
- Noise.VALUE FRACTAL
- Noise.WHITE NOISE
- Noise.new