def css_bar(start, end, color):
    '\n            Generate CSS code to draw a bar from start to end.\n            '
    css = 'width: 10em; height: 80%;'
    if (end > start):
        css += 'background: linear-gradient(90deg,'
        if (start > 0):
            css += ' transparent {s:.1f}%, {c} {s:.1f}%, '.format(s=start, c=color)
        css += '{c} {e:.1f}%, transparent {e:.1f}%)'.format(e=min(end, width), c=color)
    return css
Generate CSS code to draw a bar from start to end.
def css_bar(start, end, color):
    '\n            \n            '
    css = 'width: 10em; height: 80%;'
    if (end > start):
        css += 'background: linear-gradient(90deg,'
        if (start > 0):
            css += ' transparent {s:.1f}%, {c} {s:.1f}%, '.format(s=start, c=color)
        css += '{c} {e:.1f}%, transparent {e:.1f}%)'.format(e=min(end, width), c=color)
    return css