diff options
Diffstat (limited to 'Pb_Api/Param/Color.py')
| -rw-r--r-- | Pb_Api/Param/Color.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Pb_Api/Param/Color.py b/Pb_Api/Param/Color.py index 88bd9bd..1c14c8d 100644 --- a/Pb_Api/Param/Color.py +++ b/Pb_Api/Param/Color.py @@ -8,6 +8,7 @@ class Pb_Api_Param_Color(Pb_Api_Param_MultiSelect): def from_rgb(cls, r,g,b): return cls(value="rgb({},{},{})".format(r,g,b)) + def randomize(self): weights_total = sum(map(lambda x: x["weight"], self.options()) + (255 * 255 * 255) choice = random.randint(0, weights_total) |
