Fluid 1.3.0
Material Design for QtQuick and Qml
Loading...
Searching...
No Matches
Utils.qml
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2026 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
2// SPDX-License-Identifier: MPL-2.0
3
4pragma Singleton
5
6import QtQml
7import QtQuick
8
17QtObject {
18 function scale(percent: real, start: real, end: real): real {
19 return start + ((end - start) * (percent / 100));
20 }
21
22 function transparent(c: color, alpha: real): color {
23 return Qt.rgba(c.r, c.g, c.b, alpha);
24 }
25
26 function epsilonEqual(x: real, y: real): real {
27 return Math.abs(x - y) < Number.EPSILON;
28 }
29}