diff options
author | Thomas Jourdan <b.vehikel@googlemail.com> | 2009-12-06 12:40:41 (GMT) |
---|---|---|
committer | Thomas Jourdan <b.vehikel@googlemail.com> | 2009-12-06 12:40:41 (GMT) |
commit | 7ce7155dead3893e572006588fc342fb3af7ec60 (patch) | |
tree | 2bb234d6d159aa797767bf1ceccea53117dc773a /ep_colorconstraint_gray.py | |
parent | bcde11455168a07de8a3b17f2a4d77ce8931e75d (diff) |
Layers are now arranged as a tree data structure.
Diffstat (limited to 'ep_colorconstraint_gray.py')
-rw-r--r-- | ep_colorconstraint_gray.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/ep_colorconstraint_gray.py b/ep_colorconstraint_gray.py index c9ec8c6..bacb87c 100644 --- a/ep_colorconstraint_gray.py +++ b/ep_colorconstraint_gray.py @@ -16,7 +16,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA import random -import ka_random +import model_random import model_locus class GrayColorConstraint(model_locus.Locus): @@ -48,15 +48,15 @@ class GrayColorConstraint(model_locus.Locus): post: len(__return__) == 4 """ gray = (rgba[0] + rgba[1] + rgba[2]) / 3.0 - gray = ka_random.limitate(gray + 0.1 * (random.random() - 0.5)) - alpha = ka_random.limitate(rgba[3] + 0.1 * (random.random() - 0.5)) + gray = model_random.limit(gray + 0.1 * (random.random() - 0.5)) + alpha = model_random.limit(rgba[3] + 0.1 * (random.random() - 0.5)) return (gray, gray, gray, alpha) - def explain(self, rgba, alfa=True): + def explain(self, rgba, alpha=True): """ pre: len(rgba) == 4 """ - if alfa: + if alpha: return '%d%% gray, %d%% opaque' % (100*rgba[0], 100*rgba[3]) else: return '%d%% gray' % (100*rgba[0]) |