Changeset 140 for trunk/pycha/color.py

Show
Ignore:
Timestamp:
02/03/09 16:08:23 (3 years ago)
Author:
lgs
Message:

Change the copyright range and make all code pep8 compatible

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/pycha/color.py

    r96 r140  
    1 # Copyright (c) 2007-2008 by Lorenzo Gil Sanchez <lorenzo.gil.sanchez@gmail.com> 
     1# Copyright(c) 2007-2009 by Lorenzo Gil Sanchez <lorenzo.gil.sanchez@gmail.com> 
    22# 
    33# This file is part of PyCha. 
     
    1818DEFAULT_COLOR = '#3c581a' 
    1919 
     20 
    2021def clamp(minValue, maxValue, value): 
    2122    """Make sure value is between minValue and maxValue""" 
     
    2526        return maxValue 
    2627    return value 
     28 
    2729 
    2830def hex2rgb(hexstring, digits=2): 
     
    4345    return r / top, g / top, b / top 
    4446 
     47 
    4548def lighten(r, g, b, amount): 
    4649    """Return a lighter version of the color (r, g, b)""" 
     
    4851            clamp(0.0, 1.0, g + amount), 
    4952            clamp(0.0, 1.0, b + amount)) 
     53 
    5054 
    5155def generateColorscheme(masterColor, keys): 
     
    6367                 for i, key in enumerate(keys)]) 
    6468 
     69 
    6570def defaultColorscheme(keys): 
    6671    """Return the default color scheme (derived from a dark green)""" 
    6772    return generateColorscheme(DEFAULT_COLOR, keys) 
     73 
    6874 
    6975def getColorscheme(color, keys): 
     
    7278    """ 
    7379    return generateColorscheme(colorSchemes.get(color, color), keys) 
     80 
    7481 
    7582# default colors for color schemes 
     
    8087    grey='#444444', 
    8188    black='#000000', 
    82     darkcyan='#305755' 
     89    darkcyan='#305755', 
    8390    )