Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QGradient ColorInterpolation
Qt 6.11 is out! See what's new in the release blog

QGradient ColorInterpolation

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 670 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    deleted28
    wrote on last edited by deleted28
    #1

    Hello,

    i have some fundamental understanding question:
    Assume i create a Lineargradient this way (not even sure this is correct)

    QLinearGradient myIRGrad;
        myIRGrad.setStart(0, 0);
        myIRGrad.setFinalStop(0, 1);
        myIRGrad.setSpread(QLinearGradient::PadSpread);
        myIRGrad.setColorAt(0, Qt::red);
        myIRGrad.setColorAt(0.5, Qt::yellow);
        myIRGrad.setColorAt(0.9, Qt::white); 
    

    How i can get the interpolated color back at point, let say 0.333 ?
    The great qt docs are rather poor here or i search not smart enough.
    I expcted something like this:

    qDebug() <<  myIRGrad.ColorAt(0.333);
    

    but this does not work of course.
    I think i 'm on a total wrong way and need soemthing like QColormap or similar

    Any help highly welcome, thank you

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved