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. How to create a gradient between 3 points
Forum Updated to NodeBB v4.3 + New Features

How to create a gradient between 3 points

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 503 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.
  • C Offline
    C Offline
    Cyrille de Brebisson
    wrote on last edited by
    #1

    Hello,

    I am trying to draw filled a triangle with a QPainter where the filled color will be an interpolation between colors assigned to each of the 3 points of the triangle.

    How to do this in Qt? I found linear gradients, but no tri color gradients.

    I am looking for something like this:
    http://cs.wellesley.edu/~cs307/readings/ColorInterpolation.png

    Thanks,
    Cyrille

    kshegunovK 1 Reply Last reply
    0
    • C Cyrille de Brebisson

      Hello,

      I am trying to draw filled a triangle with a QPainter where the filled color will be an interpolation between colors assigned to each of the 3 points of the triangle.

      How to do this in Qt? I found linear gradients, but no tri color gradients.

      I am looking for something like this:
      http://cs.wellesley.edu/~cs307/readings/ColorInterpolation.png

      Thanks,
      Cyrille

      kshegunovK Offline
      kshegunovK Offline
      kshegunov
      Moderators
      wrote on last edited by
      #2

      @Cyrille-de-Brebisson said in How to create a gradient between 3 points:

      How to do this in Qt? I found linear gradients, but no tri color gradients.

      As far as I know you'd need to calculate it yourself.

      Read and abide by the Qt Code of Conduct

      1 Reply Last reply
      2

      • Login

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