public void setVoltageColor(Graphics g, double volts) {
        if (needsHighlight()) {
            g.setColor(selectColor);
            return;
        }
        if (!sim.isShowingVoltage()) {
            if (!sim.isShowingPowerDissipation()) // && !conductanceCheckItem.getState())
            {
                g.setColor(whiteColor);
            }
            return;
        }
        int c = (int) ((volts + sim.getVoltageRange()) * (colorScaleCount - 1)
                / (sim.getVoltageRange() * 2));
        if (c < 0) {
            c = 0;
        }
        if (c >= colorScaleCount) {
            c = colorScaleCount - 1;
        }
        if (sim.isStopped()) {
            g.setColor(Color.decode("#3E80BD"));//blue
            g.setColor(Color.white);//blue
        } else {
            g.setColor(colorScale[c]);
        }
    }