def chair(self, party): style = 'stroke:black;stroke-width:4.0;fill:%s;' head = ShapeBuilder().createCircle(30, 25, 16) head.set_class('head') head.set_style(style % party.head_color) body = ShapeBuilder().createPolygon('12,50,47,50,30,15') body.set_class('body') body.set_style(style % party.body_color) group = g() group.set_id(party.initials) group.addElement(body) group.addElement(head) return group
def chair(self, id_attr, color_1, color_2): head = ShapeBuilder().createCircle(30, 25, 20, stroke='black', strokewidth=5.0, fill=color_1) head.set_class('head') body = path(pathData="M 19.264266,38.267870 C 12.892238,41.659428 9.0221978,48.396703 6.6126745,55.405840 L 51.476471,55.405840 C 49.270169,48.545436 45.682644,41.911786 39.811885,38.267870 C 33.901416,38.010889 26.459633,38.267870 19.264266,38.267870 z ") body.set_style('stroke-width:5.0;stroke:black;fill:%s;' % color_2) body.set_class('body') th = TransformBuilder() th.setScaling('0.8', '0.8') group = g() group.addElement(body) group.addElement(head) group.set_id(id_attr) group.set_transform(th.getTransform()) return group