- don't let random colors be too dark (or fully white either for dark backgrounds which use white lines)

Mon, 28 Apr 2014 18:20:51 +0300

author
Santeri Piippo <crimsondusk64@gmail.com>
date
Mon, 28 Apr 2014 18:20:51 +0300
changeset 751
49d4eb8edcd8
parent 750
cade0d78da97
child 752
b80ccc2a24e4

- don't let random colors be too dark (or fully white either for dark backgrounds which use white lines)

src/ldObject.cc file | annotate | diff | comparison | revisions
--- a/src/ldObject.cc	Mon Apr 28 18:13:20 2014 +0300
+++ b/src/ldObject.cc	Mon Apr 28 18:20:51 2014 +0300
@@ -47,7 +47,7 @@
 	memset (m_coords, 0, sizeof m_coords);
 	chooseID();
 	g_LDObjects << this;
-	setRandomColor (QColor::fromRgb (rand()));
+	setRandomColor (QColor::fromHsv (rand() % 360, rand() % 256, rand() % 96 + 128));
 }
 
 // =============================================================================

mercurial