Skip to content

Commit

Permalink
Change default amplitude of variation for parametric style depending …
Browse files Browse the repository at this point in the history
…on operation
  • Loading branch information
paradoxxxzero committed Jun 19, 2013
1 parent ba01a56 commit 95eef05
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions pygal/style.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,12 +257,19 @@ def to_dict(self):
for op in ('lighten', 'darken', 'saturate', 'desaturate', 'rotate'):
name = op.capitalize() + 'Style'

def get_style_for(op_):
operation = getattr(colors, op_)
def get_style_for(op_name):
operation = getattr(colors, op_name)

def parametric_style(color, step=10, max_=None, **kwargs):
if max_ is None:
max__ = 50 if op_ != 'rotate' else 360
violency = {
'darken': 50,
'lighten': 50,
'saturate': 100,
'desaturate': 100,
'rotate': 360
}
max__ = violency[op_name]
else:
max__ = max_

Expand Down

0 comments on commit 95eef05

Please sign in to comment.