

def createImage(self, symbol, width, height, borderWidth, url):
    result = Image(url)
    if (width < height):
        wh = width
    else:
        wh = height
    if ((2 * borderWidth) <= wh):
        cappedBW = borderWidth
    else:
        cappedBW = int((wh / 2))
    borderColor = symbol.getBorderColorCSS()
    if (cappedBW == borderWidth):
        backgroundColor = symbol.getBackgroundColorCSS()
    else:
        backgroundColor = borderColor
    if (GChartConsts.TRANSPARENT_BORDER_COLOR == borderColor):
        if (cappedBW > 0):
            height -= (2 * cappedBW)
            width -= (2 * cappedBW)
        cappedBW = 0
        borderColor = 'transparent'
        if (GChartConsts.TRANSPARENT_BORDER_COLOR == backgroundColor):
            backgroundColor = 'transparent'
    elif (cappedBW > 0):
        height -= (2 * cappedBW)
        width -= (2 * cappedBW)
    GChartUtil.setBackgroundColor(result, borderColor)
    GChartUtil.setBorderColor(result, borderColor)
    GChartUtil.setBorderStyle(result, symbol.getBorderStyle())
    GChartUtil.setBorderWidth(result, abs(cappedBW))
    result.setPixelSize(int(round(width)), int(round(height)))
    return result

dataset/ETHPy150Open anandology/pyjamas/library/gwt/chart/SymbolType.py SymbolType.createImage/VarMisuse@213/307 `backgroundColor`->`borderColor`