int main() { RGBA teal(0, 127, 127); teal.print(); return 0; }
void paint(QPainter &painter){ // const T w=painter.device()->width(); // const T h=painter.device()->height(); // const T s=0.5; //QPointF origo(w2,h2); QPointF origin(bx,by); QPointF neutral(nx,ny); QPointF foot(cx-body.cx,cy-body.cy); QPointF target(tx-body.cx,ty-body.cy); QPointF old(sx-body.cx,sy-body.cy); QPen base(QBrush(Qt::NoBrush),0.02); QPen white(base); white.setWidthF(0.04); white.setColor(QColor(enabled?(lift?"white":"gray"):"darkred")); QPen green(base); green.setWidthF(0.04); green.setColor(QColor("green")); QPen purple(base); purple.setWidthF(0.01); purple.setColor(QColor("purple").darker()); QPen red(base); red.setWidthF(0.02); red.setColor(QColor(balance?"yellow":"red")); QPen teal(base); teal.setWidthF(0.01); teal.setColor(QColor("teal")); QPen blue(base); blue.setWidthF(0.01); blue.setColor(QColor("blue")); const T r=0.02; painter.setPen(teal); painter.drawEllipse(old,r,r); painter.setPen(blue); painter.drawEllipse(target,r,r); painter.setPen(purple); painter.drawEllipse(neutral,r*0.3,r*0.3); painter.setPen(red); painter.drawEllipse(foot,r,r); painter.setPen(white); painter.drawLine(origin,foot); painter.setPen(enabled?green:red); painter.drawEllipse(origin,r,r); }