From 910fce821941ccf0671d5ec9508b6a5df4922277 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Thu, 12 Oct 2017 10:43:19 -0400 Subject: Add some color to the "Warp" starfield. --- .../extrafiles/screensavers/qml_scripts/Warp.qml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src-qt5') 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 -- cgit