A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/AlmasB/FXGL/commit/ddc489daf below:

added randomColorHSB() · AlmasB/FXGL@ddc489d · GitHub

File tree Expand file treeCollapse file tree 1 file changed

+10

-0

lines changed

Filter options

Expand file treeCollapse file tree 1 file changed

+10

-0

lines changed Original file line number Diff line number Diff line change

@@ -309,10 +309,20 @@ public static Vec2 randomVec2() {

309 309

return new Vec2(random(-1.0, 1.0), random(-1.0, 1.0)).normalizeLocal();

310 310

}

311 311 312 +

/**

313 +

* @return random color using RGB color model

314 +

*/

312 315

public static Color randomColor() {

313 316

return Color.color(randomDouble(), randomDouble(), randomDouble());

314 317

}

315 318 319 +

/**

320 +

* @return random color using HSB color model

321 +

*/

322 +

public static Color randomColorHSB(double saturation, double brightness) {

323 +

return Color.hsb(random(0, 360), saturation, brightness);

324 +

}

325 + 316 326

/**

317 327

* @return random element of the given array or Optional.empty() if empty

318 328

*/

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4