how to use the LightingColorFilter to make the image form dark to light

前端 未结 2 1788
长发绾君心
长发绾君心 2020-12-13 16:16

I want to add light of the image, I want to use LightingColorFilter

LightingColorFilter lcf = new LightingColorFilter( mul, add); 
imageView.set         


        
2条回答
  •  孤街浪徒
    2020-12-13 16:49

    The integer values are colours (you may want to have a closer look here http://developer.android.com/reference/android/graphics/Color.html)
    4 Bytes are used, one for alpha, one for red, one for green, one for blue range - every single from 0 to 255 (hex 0 to FF)

    so the colour in hex looks like

    0 x 00     00   00    00
        alpha  red  green blue
    

    If you want to set for example red to zero, use

    mul: 0xFF00FFFF
    add: 0x00000000
    

    If you want to force blue to be full-on, use

    mul: 0xFFFFFFFF
    add: 0x000000FF 
    

提交回复
热议问题