Results 1 to 2 of 2

Thread: Adding gradient of colors

  1. #1
    Join Date
    Apr 2011
    Posts
    58
    Thanks
    1

    Default Adding gradient of colors

    Hi.

    I've a square canvas.
    I like to draw circles in it.
    Each circle is filled with gradient color (e.g. centre is red and becomes more blue as it reaches the edge of the circle. Some may start with green and end as yellow etc.)

    My question is, how do I add the colors together when the circles overlap? I like to have a way to "add up" the colors that overlap. Is there a way to do that instead of having to count pixels by pixels the color value and add them (I'm not even sure if this will work)?

    Any help? Thanks!

  2. #2
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    3
    Thanked 453 Times in 435 Posts
    Wiki edits
    15

    Default Re: Adding gradient of colors

    You can draw the circles with a gradient QBrush, and image composition, Refer this Example for Composition

Similar Threads

  1. Add a QGraphicsTextItem with a gradient
    By harmodrew in forum Newbie
    Replies: 5
    Last Post: 16th November 2010, 18:50
  2. getting gradient colors
    By venkat.godavarthi in forum Qt Programming
    Replies: 1
    Last Post: 30th October 2009, 14:36
  3. Changing form colors and adding skins
    By srohit24 in forum Qt Programming
    Replies: 9
    Last Post: 28th October 2009, 16:35
  4. QPainter Gradient
    By ^NyAw^ in forum Qt Programming
    Replies: 1
    Last Post: 15th February 2008, 13:53
  5. gradient background
    By drkbkr in forum Qt Programming
    Replies: 4
    Last Post: 30th March 2006, 17:10

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.