Logo Search packages:      
Sourcecode: ktechlab version File versions

QColor Component::voltageColor ( double  v  )  [static, inherited]

Converts the voltage level to a colour - this is used in drawing wires and pins.

Definition at line 1124 of file component.cpp.

References Component::voltageLength().

Referenced by PinNode::drawShape(), and JunctionNode::drawShape().

{
    double prop = voltageLength( v );

    if ( v >= 0 )
        return QColor( int(255*prop), int(166*prop), 0 );
    else
        return QColor( 0, int(136*prop), int(255*prop) );
}


Generated by  Doxygen 1.6.0   Back to index