Changeset 586


Ignore:
Timestamp:
08/18/16 22:01:16 (8 years ago)
Author:
konrad
Message:

Tiny refactoring of tree-genealogy.py

File:
1 edited

Legend:

Unmodified
Added
Removed
  • mds-and-trees/tree-genealogy.py

    r585 r586  
    2929
    3030def hex_to_style(hex):
     31    default_style = ' stroke="black" stroke-opacity="0.5" '
     32
    3133    if hex[0] == "#":
    3234        hex = hex[1:]
     
    3739        except:
    3840            print("Wrong characters in the color's hex #" + hex + "! Assuming black.")
    39             return ' stroke="black" stroke-opacity="0.5" '
     41            return default_style
    4042        red = 100*int(hex[0:2], 16)/255
    4143        green = 100*int(hex[2:4], 16)/255
     
    4749    else:
    4850        print("Wrong number of digits in the color's hex #" + hex + "! Assuming black.")
    49         return ' stroke="black" stroke-opacity="0.5" '
     51        return default_style
    5052
    5153def svg_add_line(from_pos, to_pos, style=svg_line_style):
Note: See TracChangeset for help on using the changeset viewer.