If you want to set a component (e.g. RED) to zero, use these

mul: 0xFF00FFFF
add: 0

If you want to force a component to be full-on (e.g. BLUE), use these

mul: 0xFFFFFFFF
add: 0x000000FF

If you want to slightly darken RED and GREEN, use

mul: 0xFFCCCCFF
add: 0

On Tue, Feb 10, 2009 at 3:41 PM, myIP <marckas...@gmail.com> wrote:
>
> Mike, thanks for the reply.  Perhaps I don't fully understand how a
> value is assigned to a color.  Forgive me, I should have said  "I am
> perplexed" rather then "I was mislead".
>
> Anyways, I am still perplexed.  Can you give an example on how to
> manipulate a red or green component?  Do I need to use
> android.graphics.Color.rgb() or Color.red(), etc., with
> LightingColorFilter?  I can't seem to get any color other then blue,
> if I don't use a neg value.
>
> On Feb 10, 7:47 am, Mike Reed <r...@google.com> wrote:
>> The int values are colors (see android.graphics.Color), and each of
>> its 4 bytes (one for each alpha, red, green, blue components) range
>> from 0..255, thus you can multiply/add each component with different
>> coefficients.
>>
>> On Mon, Feb 9, 2009 at 5:52 PM, myIP <marckas...@gmail.com> wrote:
>>
>> > It looks like the int values can range from -255 to 255.  I was
>> > mislead, the docs has a range of values of 0 to 255.
>>
>> > On Feb 9, 5:06 pm, myIP <marckas...@gmail.com> wrote:
>> >> How would I be able to adjust a channel (R,G or B) using
>> >> ImageView.setColorFilter by passing an instance of LightingColorFilter
>> >> in its construct?
>>
>> >> For an example, when I create an instance of LightingColorFilter, I
>> >> adjust the two params that are int values between 0-255.  With this
>> >> instance, I then pass it into setColorFilter.  The image always ends
>> >> up anywhere from being black to blue.  How can I adjust the Red or
>> >> Green channel?
>>
>> >> LightingColorFilter lcf = new LightingColorFilter( mul, add);
>> >> imageView.setColorFilter(lcf);
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to