Adding Colours (Colors) Together like Paint (Blue + Yellow = Green, etc)

前端 未结 5 1714
挽巷
挽巷 2021-01-05 14:32

I\'m making an iOS game using cocos2d libraries.

Lets say you have two objects that have two separate colours - defined in RGB as

Blue:    0,0,255
Ye         


        
5条回答
  •  说谎
    说谎 (楼主)
    2021-01-05 15:19

    Check the formulas on this site: http://www.easyrgb.com/index.php?X=MATH I've been doing similar thing, and it can be achieved by converting RGB->XYZ->Lab. However the computation is quite expensive(if you doing it for a lot of pixels).

    And forget about RGB math when trying to mix colors if you want to obtain results similar to human eye

提交回复
热议问题