Refactor: move some out of place functions.

This commit is contained in:
Filippo Scognamiglio
2014-12-12 21:31:19 +01:00
parent 64fb980ae4
commit fd73afb66b
3 changed files with 20 additions and 18 deletions

14
app/qml/utils.js Normal file
View File

@@ -0,0 +1,14 @@
.pragma library
function mix(c1, c2, alpha){
return Qt.rgba(c1.r * alpha + c2.r * (1-alpha),
c1.g * alpha + c2.g * (1-alpha),
c1.b * alpha + c2.b * (1-alpha),
c1.a * alpha + c2.a * (1-alpha))
}
function strToColor(s){
var r = parseInt(s.substring(1,3), 16) / 256;
var g = parseInt(s.substring(3,5), 16) / 256;
var b = parseInt(s.substring(5,7), 16) / 256;
return Qt.rgba(r, g, b, 1.0);
}