mirror of
https://github.com/wichtounet/thor-os.git
synced 2025-09-16 07:57:13 -04:00
Generate window color randomly
This commit is contained in:
parent
89997be334
commit
96cb067608
@ -4,6 +4,9 @@
|
|||||||
// (See accompanying file LICENSE or copy at
|
// (See accompanying file LICENSE or copy at
|
||||||
// http://www.opensource.org/licenses/MIT)
|
// http://www.opensource.org/licenses/MIT)
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
|
#include <random.hpp>
|
||||||
|
|
||||||
#include <tlib/system.hpp>
|
#include <tlib/system.hpp>
|
||||||
#include <tlib/graphics.hpp>
|
#include <tlib/graphics.hpp>
|
||||||
#include <tlib/print.hpp>
|
#include <tlib/print.hpp>
|
||||||
@ -146,9 +149,11 @@ public:
|
|||||||
window(){}
|
window(){}
|
||||||
|
|
||||||
window(size_t x, size_t y, size_t width, size_t height) : x(x), y(y), width(width), height(height) {
|
window(size_t x, size_t y, size_t width, size_t height) : x(x), y(y), width(width), height(height) {
|
||||||
//TODO This shit does not work
|
std::default_random_engine eng(tlib::ms_time());
|
||||||
color = make_color(51, 51, 51);
|
std::uniform_int_distribution<> color_dist(0, 255);
|
||||||
border_color = make_color(250, 250, 250);
|
|
||||||
|
color = make_color(color_dist(eng), color_dist(eng), color_dist(eng));
|
||||||
|
border_color = make_color(color_dist(eng), color_dist(eng), color_dist(eng));
|
||||||
}
|
}
|
||||||
|
|
||||||
window(const window& rhs) = default;
|
window(const window& rhs) = default;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user