ColorAnimation QML Type

색상 값의 변화를 애니메이션으로 표현합니다. 더 보기...

Import Statement: import QtQuick
Inherits:

PropertyAnimation

속성

상세 설명

ColorAnimation은 색상 값이 변경될 때 적용될 애니메이션을 정의하는 특수한 PropertyAnimation 입니다.

다음은 Rectanglecolor 프로퍼티에 프로퍼티 값 소스로 적용된 ColorAnimation입니다. 이 애니메이션은 color 속성의 값을 현재 값에서 "빨간색" 값으로 1000밀리초 이상 애니메이션합니다:

import QtQuick

Rectangle {
    width: 100; height: 100
    color: "red"

    ColorAnimation on color { to: "yellow"; duration: 1000 }
}

다른 애니메이션 유형과 마찬가지로 전환, 동작 및 속성 값 소스 등 다양한 방식으로 ColorAnimation을 적용할 수 있습니다. 애니메이션 및 전환 문서( Qt Quick )에 애니메이션을 만드는 다양한 방법이 나와 있습니다.

편의를 위해 ColorAnimation을 Transition 에 사용하면 상태 변경 중에 수정된 color 프로퍼티에 애니메이션이 적용됩니다. 애니메이션에 property 또는 properties 이 명시적으로 설정되어 있으면 해당 애니메이션이 대신 사용됩니다.

Qt QuickQt Quick 예제 - 애니메이션에서애니메이션 및 전환을참조하세요 .

속성 문서

from : color

이 속성은 애니메이션이 시작되는 색상 값을 보유합니다.

예를 들어, 다음 애니메이션은 색상 값이 "#c0c0c0"에 도달할 때까지 적용되지 않습니다:

Item {
    states: [
        // States are defined here...
    ]

    transitions: Transition {
        ColorAnimation { from: "#c0c0c0"; duration: 2000 }
    }
}

ColorAnimationTransition 또는 Behavior 내에 정의된 경우 이 값은 Transition 의 시작 상태에 정의된 값 또는 Behavior 가 트리거되는 순간의 속성 현재 값으로 기본값이 지정됩니다.

Qt Quick 의 애니메이션 및 전환을참조하십시오 .


to : color

이 속성은 애니메이션이 종료되어야 하는 색상 값을 보유합니다.

ColorAnimationTransition 또는 Behavior 내에 정의된 경우 이 값은 Transition 의 종료 상태에 정의된 값 또는 Behavior 를 트리거한 속성 변경 값으로 기본값이 지정됩니다.

Qt Quick 의 애니메이션 및 전환을참조하세요 .


© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.