diff options
author | Ken Moore <ken@ixsystems.com> | 2017-10-12 10:43:19 -0400 |
---|---|---|
committer | Ken Moore <ken@ixsystems.com> | 2017-10-12 10:43:19 -0400 |
commit | 910fce821941ccf0671d5ec9508b6a5df4922277 (patch) | |
tree | ef8a642920c3fde0e486804959311c7d75b12c5d | |
parent | Add a new screensaver: Warp (diff) | |
download | lumina-910fce821941ccf0671d5ec9508b6a5df4922277.tar.gz lumina-910fce821941ccf0671d5ec9508b6a5df4922277.tar.bz2 lumina-910fce821941ccf0671d5ec9508b6a5df4922277.zip |
Add some color to the "Warp" starfield.
-rw-r--r-- | src-qt5/core/lumina-desktop-unified/extrafiles/screensavers/qml_scripts/Warp.qml | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src-qt5/core/lumina-desktop-unified/extrafiles/screensavers/qml_scripts/Warp.qml b/src-qt5/core/lumina-desktop-unified/extrafiles/screensavers/qml_scripts/Warp.qml index 4ad4378f..08ae15a0 100644 --- a/src-qt5/core/lumina-desktop-unified/extrafiles/screensavers/qml_scripts/Warp.qml +++ b/src-qt5/core/lumina-desktop-unified/extrafiles/screensavers/qml_scripts/Warp.qml @@ -5,7 +5,13 @@ Rectangle { id : canvas anchors.fill: parent color: "black" - + + function getStarColor(num){ + if(num < 0.5) { return "white" } + if(num < 1.5) { return "mistyrose" } + return "lightblue" + } + // CREATE STARFIELD Repeater { model: Math.round(Math.random()*canvas.width/10)+500 @@ -16,7 +22,8 @@ Rectangle { width: Math.round(Math.random()*3)+3 height: width radius: width/2 - color: "white" + color: getStarColor( (index%3) ) + } } //end of Repeater |