def monochrome(clr):
def _wrap(x, min, threshold, plus):<EOL><INDENT>if x - min < threshold:<EOL><INDENT>return x + plus<EOL><DEDENT>else:<EOL><INDENT>return x - min<EOL><DEDENT><DEDENT>colors = colorlist(clr)<EOL>c = clr.copy()<EOL>c.brightness = _wrap(clr.brightness, <NUM_LIT:0.5>, <NUM_LIT>, <NUM_LIT>)<EOL>c.saturation = _wrap(clr.saturation, <NUM_LIT>, <NUM_LIT:0.1>, <NUM_LIT>)<EOL>colors.append(c)<EOL>c = clr.copy()<EOL>c.brightness = _wrap(clr.brightness, <NUM_LIT>, <NUM_LIT>, <NUM_LIT>)<EOL>colors.append(c)<EOL>c = clr.copy()<EOL>c.brightness = max(<NUM_LIT>, clr.brightness + (<NUM_LIT:1> - clr.brightness) * <NUM_LIT>)<EOL>c.saturation = _wrap(clr.saturation, <NUM_LIT>, <NUM_LIT:0.1>, <NUM_LIT>)<EOL>colors.append(c)<EOL>c = clr.copy()<EOL>c.brightness = _wrap(clr.brightness, <NUM_LIT:0.5>, <NUM_LIT>, <NUM_LIT>)<EOL>colors.append(c)<EOL>return colors<EOL>
Returns colors in the same hue with varying brightness/saturation.