def rect_to_mobject(self, rect_element):
    fill_color = rect_element.getAttribute('fill')
    stroke_color = rect_element.getAttribute('stroke')
    stroke_width = rect_element.getAttribute('stroke-width')
    corner_radius = rect_element.getAttribute('rx')
    if ((fill_color in ['', 'none', '#FFF', '#FFFFFF']) or (Color(fill_color) == Color(WHITE))):
        opacity = 0
        fill_color = BLACK
    if (fill_color in ['#000', '#000000']):
        fill_color = WHITE
    if ((stroke_color in ['', 'none', '#FFF', '#FFFFFF']) or (Color(stroke_color) == Color(WHITE))):
        stroke_width = 0
        stroke_color = BLACK
    if (stroke_color in ['#000', '#000000']):
        stroke_color = WHITE
    if (stroke_width in ['', 'none', '0']):
        stroke_width = 0
    if (corner_radius in ['', '0', 'none']):
        corner_radius = 0
    corner_radius = float(corner_radius)
    if (corner_radius == 0):
        mob = Rectangle(width=self.attribute_to_float(rect_element.getAttribute('width')), height=self.attribute_to_float(rect_element.getAttribute('height')), stroke_width=stroke_width, stroke_color=stroke_color, fill_color=fill_color, fill_opacity=opacity)
    else:
        mob = RoundedRectangle(width=self.attribute_to_float(rect_element.getAttribute('width')), height=self.attribute_to_float(rect_element.getAttribute('height')), stroke_width=stroke_width, stroke_color=stroke_color, fill_color=fill_color, fill_opacity=opacity, corner_radius=corner_radius)
    mob.shift((mob.get_center() - mob.get_corner((UP + LEFT))))
    return mob
def rect_to_mobject(self, rect_element):
    fill_color = rect_element.getAttribute('fill')
    stroke_color = rect_element.getAttribute('stroke')
    stroke_width = rect_element.getAttribute('stroke-width')
    corner_radius = rect_element.getAttribute('rx')
    if ((fill_color in [, 'none', '#FFF', '#FFFFFF']) or (Color(fill_color) == Color(WHITE))):
        opacity = 0
        fill_color = BLACK
    if (fill_color in ['#000', '#000000']):
        fill_color = WHITE
    if ((stroke_color in [, 'none', '#FFF', '#FFFFFF']) or (Color(stroke_color) == Color(WHITE))):
        stroke_width = 0
        stroke_color = BLACK
    if (stroke_color in ['#000', '#000000']):
        stroke_color = WHITE
    if (stroke_width in [, 'none', '0']):
        stroke_width = 0
    if (corner_radius in [, '0', 'none']):
        corner_radius = 0
    corner_radius = float(corner_radius)
    if (corner_radius == 0):
        mob = Rectangle(width=self.attribute_to_float(rect_element.getAttribute('width')), height=self.attribute_to_float(rect_element.getAttribute('height')), stroke_width=stroke_width, stroke_color=stroke_color, fill_color=fill_color, fill_opacity=opacity)
    else:
        mob = RoundedRectangle(width=self.attribute_to_float(rect_element.getAttribute('width')), height=self.attribute_to_float(rect_element.getAttribute('height')), stroke_width=stroke_width, stroke_color=stroke_color, fill_color=fill_color, fill_opacity=opacity, corner_radius=corner_radius)
    mob.shift((mob.get_center() - mob.get_corner((UP + LEFT))))
    return mob