def colors(self, n=<NUM_LIT:10>, d=<NUM_LIT>):
s = sum([w for clr, rng, w in self.ranges])<EOL>colors = colorlist()<EOL>for i in _range(n):<EOL><INDENT>r = random()<EOL>for clr, rng, weight in self.ranges:<EOL><INDENT>if weight / s >= r: break<EOL>r -= weight / s<EOL><DEDENT>colors.append(rng(clr, d))<EOL><DEDENT>return colors<EOL>
Returns a number of random colors from the theme.