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

  • SEARCH
  • Home
  • 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 8086655
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T18:31:15+00:00 2026-06-05T18:31:15+00:00

With a method like glColor4f(0f, 0f, 0f, 0f); , it sets the values to

  • 0

With a method like glColor4f(0f, 0f, 0f, 0f);, it sets the values to whatever parameters one puts in. However, what I would like to do is only slightly change a color. Is there any existing OpenGL method that will add or subtract its parameters to the existing colors it has?

The only other way of doing this that I can come up with is first getting its color values, then editing those how I want to, and finally sending them back with glColor4f().

So, in closing, I would like to know if there is either a method for editing existing RGBA, or at least retrieving an existing RGBA.

  • 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-05T18:31:16+00:00Added an answer on June 5, 2026 at 6:31 pm

    Well, you can get the last value set with glColor4f by using glGet with GL_CURRENT_COLOR, but I wouldn’t recommend it; glGet operations are generally bad for your performance, so try not to do it too often.

    A better idea would be to maintain a local copy of the last value you sent to glColor4f, so that you have the data client-side instead of having to request it from the opengl driver.

    There’s no way to add or subtract from the current color that I’m aware of.

    Edit: Actually I just looked up and see this function called glSecondaryColor which may do what you want. You can supply a second RBG color, and then enable GL_COLOR_SUM, and the two colors get added together.

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

Sidebar

Related Questions

I would like to implement a method like this: boost::unique_future<int> foo() { return defer([=]
I have a method like the following in a utility class. I would like
Is there a method like isiterable ? The only solution I have found so
I have a one method like this: private void myMethod(List<?> myLists) { for (Object
Is a universal get() method like the one below a good idea function universal_get(
I would like to have a method like -(void)removeAllChildrenWithTag:(int)tag in a CCNode-subclass. How would
I would like to know if a method like touchesBegan for touches Event exists
I have a generic method like the one below. And I check that the
Does a method like this exist anywhere in the framework? public static void Swap<T>(ref
If I have a method like this: public void DoSomething(int Count, string[] Lines) {

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.