Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8592577
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T23:47:02+00:00 2026-06-11T23:47:02+00:00

I have objects where the border color has already been determined. Now I want

  • 0

I have objects where the border color has already been determined.

Now I want the user to be able to set at least the opacity of the fill pattern. E.g., the border is blue. The user sets the opacity to 128, so the fill pattern is also drawn in blue, but half-transparent.

The next step would be to allow the user to also slightly adjust the color of the pattern. E.g.: “Use the border color, but make it half-transparent (alpha=128) and a little bit yellow-ish.”.

Is there a (useful) way to combine two colors where one does not have an alpha value set? Or would it make more sense to set an alpha value on the original color and combine it with an “overlay color” that also has an alpha value set?

And is there a function (or otherwise, can someone give a short code snippet) to combine the two QColor objects?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T23:47:03+00:00Added an answer on June 11, 2026 at 11:47 pm

    I would look at existing color pickers that are out there (Gimp, Photoshop, Paint, wwWidgets). Most of them deal with a few different ways of picking your color:

    Saturation, Hue, Value, Brightness, Contrast, RGB, CMYK, HSV, Alpha/Opacity.

    Qt handles a bunch of these right out of the box:

    QColor

    In order to combine two colors, I would probably average their different components together:

    // Rough pseudocode
    
    Color1 RGBA, Color 2 RGBA, Color 3 = combination
    
    Color3.R = (Color1.R + Color2.R)/2
    Color3.G = (Color1.G + Color2.G)/2
    Color3.B = (Color1.B + Color2.B)/2
    Color3.A = (Color1.A + Color2.A)/2
    

    I hope that helps.

    PS: Understanding Color Space can be helpful, too.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have objects that we want to represent in stacks (think of stacking items
I have objects that has a DateTime property, how can i query for the
I have beans which have Objects which can contain different types. Now when I
I have this Markup: <GroupBox BorderThickness=2> <GroupBox.BorderBrush> <SolidColorBrush x:Name=Border> <SolidColorBrush.Color> <MultiBinding Converter={StaticResource ConnectionAndLoggedInToBorderBrush}> <Binding
I have a itemscontrol with the item template set to a border, then i
I have objects of a class Choice which are in a list. Choice looks
I have objects with many variables that I declare and explain in the comments.
I have objects with location data stored in Core Data, I would like to
I have objects in a tree structure, I would like to aggregate status information
I have objects which create other child objects within their constructors, passing 'this' so

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.