Changeset - bd1d03349b9a
[Not reviewed]
default
0 2 0
drewp@bigasterisk.com - 9 years ago 2016-06-12 01:57:00
drewp@bigasterisk.com
noise(t) function for effects
Ignore-this: c8a38134f7bbda0d625326cdd1647e1f
2 files changed with 4 insertions and 0 deletions:
0 comments (0 inline, 0 general)
light9/effect/effecteval.py
Show inline comments
 
@@ -4,6 +4,7 @@ from light9.namespaces import L9, RDF
 
from webcolors import rgb_to_hex, hex_to_rgb
 
from decimal import Decimal
 
import math
 
from noise import pnoise1
 

	
 
def literalColor(rnorm, gnorm, bnorm):
 
    return Literal(rgb_to_hex([rnorm * 255, gnorm * 255, bnorm * 255]))
 
@@ -14,6 +15,8 @@ def nsquare(t, on=.5):
 
    return (t % 1.0) < on
 
def lerp(a, b, t):
 
    return a + (b - a) * t
 
def noise(t):
 
    return pnoise1(t, 2)
 

	
 
def scale(value, strength):
 
    if isinstance(value, Literal):
requirements.txt
Show inline comments
 
@@ -33,3 +33,4 @@ coverage==4.1
 
klein==15.3.1
 
git+http://github.com/drewp/scales.git@448d59fb491b7631877528e7695a93553bfaaa93#egg=scales
 
colormath==2.1.1
 
noise==1.2.2
0 comments (0 inline, 0 general)