LoginSignup
7
6

More than 5 years have passed since last update.

uint型に入ったRGB値の乗算

Posted at

RGBに掛ける値が同じ場合
RBとGに分解してビット演算で合成する

var src:uint = 0x70e080; // base color
var mul:uint = 0x60; // factor

var dst:uint = (src & 0xff00ff) * mul >>> 8 & 0xff00ff | (src & 0xff00) * mul >> 8 & 0xff00; // multipled color
7
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
6