Generating random Color as RGB value.
Unsolved
Qt 6
-
How can I generate random color as RGB value in a QThread. Also, this value will be assigned into next pixel. This QImage object will go to the interface with a signal from the thread.
My goal is to obtain an image of 300x300 pixels, each pixel of which consists of random RGB values. -
@eefesafak said in Generating random Color as RGB value.:
How can I generate random color as RGB value in a QThread
In a RGB image each pixel consists of 3 numbers, so simply generate 3 random numbers and construct a pixel from those 3 numbers.
https://doc.qt.io/qt-5/qrandomgenerator.html
https://doc.qt.io/qt-5/qimage.html#setPixel-1