From 3a2a85db5e18c027c84ec6a40dfe0babfa9dae98 Mon Sep 17 00:00:00 2001 From: horchi Date: Thu, 29 Nov 2012 07:05:54 +0100 Subject: added rainbow fader --- common.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'common.c') diff --git a/common.c b/common.c index 524e614..d457a6a 100644 --- a/common.c +++ b/common.c @@ -78,3 +78,19 @@ MsTime msNow() return tv.tv_sec * 1000 + tv.tv_usec / 1000; } + +//*************************************************************************** +// +//*************************************************************************** + +int minMax(int x, int min, int max) +{ + if (x < min) + return min; + + if (max < x) + return max; + + return x; +} + -- cgit v1.2.3