Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: blending of sf::color functionality  (Read 4000 times)

0 Members and 1 Guest are viewing this topic.

kingnobody8

  • Newbie
  • *
  • Posts: 1
    • View Profile
blending of sf::color functionality
« on: December 30, 2018, 02:39:22 am »
Hello!

Recently I watched this video on computer color blending

I went ahead and added proper blending functionality to my local copy of sfml. Would anyone be opposed to getting this functionality integrated into the mainline?

To clarify, the functionality is a static function in sf::color whose definition looks like this:

static Color Blend(const Color& c1, const Color& c2, float lerp);
 

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: blending of sf::color functionality
« Reply #1 on: December 30, 2018, 10:23:37 am »
Color blending is such a complex subject. I found myself needing either interpolation in RGB space, or in HSV space, depending on the project and what I wanted to achieve. I don't know what your video explains (didn't watch it), but you'll always find someone who needs a formula that is not the one you programmed into your library.
Laurent Gomila - SFML developer

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: blending of sf::color functionality
« Reply #2 on: December 30, 2018, 11:17:00 am »
The video describes how an image stored digitally is "gamma-affected" and manipulating on that data before its transformation back to normal (the colour transformation by colour scheme and monitor adjustments) is "incorrect".

Its suggestion appears to be "apply the gamma-correction/colour-scheme first, make modifications, then undo the gamma-correction/colour scheme so that when it is finally displayed using the colour scheme, it appears correct."

Is this the sort of thing that you have implemented?
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*