Unsolved Want to get each color of QColorDialog in hexrgb format and store into a const char
-
I have following code and I have to convert each QColor returned from getColor of QColorDialog into to hexrgb for example #ff0000 and store into a buf
char buf[128]
for(int i =0 ; i < 1000 ;i++) {
QColor c = QColorDialg::getColor(i);
buf should store the rgb format
}Can someone guide for this
-
QColor::name() returns the RGB string describing the color. I guess that's all you need :)
-
Hi
QColorDialog cannot give you colors like that.Also, there are millions of colors so what 1000 are you after?
you can create colors using QColor col(R,G,B);
where R;G;B are variablesand you can get hex format with
http://doc.qt.io/qt-5/qcolor.html#name