def METHOD_NAME(tool):
    global color_panel
    if color_panel is not None:
        print('remove color panel')
        color_panel.parent.remove(color_panel)
        color_panel = None
        return
    else:
        print('create color panel')
    color_panel = html.DIV(Class="color_panel")
    container <= color_panel
    color_panel.top = zwidth//10
    color_panel.left = zwidth//10
    color_panel.style.width = int(0.9*zwidth)
    color_panel.style.height = int(0.9*zwidth)
    color = getattr(panel, tool)
    print(color)
    for i, base_color in enumerate(['#ff0000', '#00ff00', '#0000ff']):
        div = html.DIV('&nbsp;', style=dict(position="absolute",
            left = int(0.05*zwidth),
            top = int((i+1)*0.2*zwidth),
            width = int(0.8*zwidth),
            backgroundColor = base_color,
            lineHeight = int(0.01*zwidth)
            )
        )
        div.num = i
        div.bind('click', lambda ev: pick_rgb(ev, tool))
        color_panel <= div
        slider = html.DIV('&nbsp;', Class='slider')
        slider.width = zwidth//50
        rgb = int(color[1:][2*i:2*i+2], 16)
        slider.left = int(div.width*rgb/256)
        div <= slider