Colour Blending/Interpolation (gradual changing)

This forum is currently in read-only mode.
From the Asset Store
Simplistic hyper-casual game with nature elements. Tap to switch between the 4 elements and reach a better score.
  • Does Construct provide a way to do colour blending? Meaning, I specify a 1st and a 2nd colour, and then I want the interpolated colours that connect these colours.

    For example, I want a sprite to gradually change from 1 colour to another as I scale it.

  • Like lerp(rgb(0,0,0),rgb(255,255,255),t)?

  • That would do for gradually changing colors, but the 'blending' is a whole other monster. You could always take 2 transparent objects and overlap them, making a new color..that's probably not the most elegant solution though :)

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I would use newt's formula, but for it to look like it was blending between colors as opposed to traveling through all colors to get to the right one, you need to lerp each component like

    rgb(lerp(0,255,t),lerp(0,50,t),lerp(78,34,t))

    You can make a pv for the value t, and increment it every tick, or you can use the math plugin to do an autointerpolation of a value "t", from 0 to 1, and give the total time, and have it automatically increment the value t which you could put there as well

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)