From d344b9d04e48b2b4967618fcc4a969a1fc995a6b Mon Sep 17 00:00:00 2001 From: rxi Date: Sun, 2 Mar 2014 20:59:32 +0000 Subject: [PATCH] Added some more examples to README.md --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index d5c177d..6d453fc 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,9 @@ Returns `1` if `x` is 0 or above, returns `-1` when `x` is negative. ### lume.lerp(a, b, amount) Returns the linearly interpolated value between `a` and `b`, `amount` should be range of 0 - 1; if `amount` is outside of this range it is clamped. +```lua +lume.lerp(100, 200, .5) -- Returns 150 +``` ### lume.smooth(a, b, amount) Similar to `lume.lerp()` but uses cosine interpolation instead of linear @@ -49,6 +52,9 @@ between `0` and `1` is returned. ### lume.randomchoice(t) Returns a random value from array `t`. +```lua +lume.randomchoice({true, false}) -- Returns either true or false +``` ### lume.shuffle(t) Shuffles the values of array `t` in place, returns the array.