Hi guys,
i'm trying to make a color map for plotting and want to use hsl colors. was trying to figure out how to properly use it but been stuck on it for a while now
Code:
//make color QColor testColor; //check conversion testColor = testColor.toHsl(); testColor = testColor.fromHsl(120,50,50,255); qDebug() << testColor.isValid(); qDebug() << testColor.spec(); //set lable colors ui->label_1->setText("hi"); //palette->setColor(QPalette::WindowText, Qt::blue); <- works ui->label_1->setPalette(*palette);
i made a quick gui with a lable which i want to apply the hsl color to. but it seems to be not working. am i making a basic syntax/logic mistake here? the output from the debug statments is:
true
4 //= HSL
thx for the help!
PS: this is what i actually want to achieve. A list of colors to save in a vector and use it for different data types
Code:
QVector<QColor> colorvec; colorvec.resize(particlemass_len); for (int i=0;i<particlemass_len;i++) { int hue = i * 359/particlemass_len; int saturation = 80; int lightness = 50; int alpha = 255; }