Example #1
0
void PaletteEditor::on_inactiveRadio_clicked()
{
    m_currentColorGroup = QPalette::Inactive;
    updatePreviewPalette();
}
Example #2
0
void PaletteEditor::on_disabledRadio_clicked()
{
    m_currentColorGroup = QPalette::Disabled;
    updatePreviewPalette();
}
Example #3
0
void ofxTLColorTrack::draw() {

    if(bounds.height == 0) {
        return;
    }

    if(viewIsDirty || shouldRecomputePreviews) {
        updatePreviewPalette();
    }

    if(keyframes.size() == 0) {
        ofPushStyle();
        ofSetColor(defaultColor);
        ofFill();
        ofRect(bounds);
        ofPopStyle();
    }
    else if(keyframes.size() == 1) {
        ofPushStyle();
        ofxTLColorSample* s = (ofxTLColorSample*)keyframes[0];
        ofSetColor(s->color);
        ofFill();
        ofRect(bounds);
        ofPopStyle();
    }
    else {
        previewPalette.draw(bounds);
    }

    for(int i = 0; i < keyframes.size(); i++) {

        if(!isKeyframeIsInBounds(keyframes[i])) {
            continue;
        }

        float screenX = millisToScreenX(keyframes[i]->time);

        ofPoint a = ofPoint(screenX-10,bounds.y);
        ofPoint b = ofPoint(screenX+10,bounds.y);
        ofPoint c = ofPoint(screenX,bounds.y+10);

        ofPushStyle();
        ofFill();
        ofxTLColorSample* s = (ofxTLColorSample*)keyframes[i];
        ofSetColor(s->color);
        ofTriangle(a,b,c);
        ofNoFill();
        ofSetColor(s->color.getInverted());
        ofSetLineWidth(1);
        ofTriangle(a,b,c);

        if(keyframes[i] == hoverKeyframe) {
            ofSetColor(timeline->getColors().highlightColor);
            ofSetLineWidth(3);
        }
        else if(isKeyframeSelected(keyframes[i])) {
            ofSetColor(timeline->getColors().textColor);
            ofSetLineWidth(2);
        }
        else {
            ofSetColor(s->color.getInverted());
        }
        ofLine(c, ofVec2f(screenX, bounds.getMaxY()));
        ofPopStyle();
    }
}