removed painter.end() function (no longer needed as per documentation). Set a default pen color in class function