Re: [android-developers] Same color specified in xml file and png appear differently?

2012-10-01 Thread Jakob Sachse
Thats it! Thanks Dianne.

Am Sonntag, 19. September 2010 01:51:15 UTC+2 schrieb Dianne Hackborn:

 One thing that could be happening is if your image is entirely opaque then 
 it may be loaded as 16bpp for memory/performance reasons.

 2010/9/18 Mark Wyszomierski mar...@gmail.com javascript:

 Hi Kostya, I'll probably end up doing that, I was just curious as to what 
 is going on with this since everything seems to look ok - I'll make that 
 test app and post back if I find anything,

 Thanks

 2010/9/18 Kostya Vasilyev kman...@gmail.com javascript:

 Perhaps you can use a small PNG drawable for the view where you currently 
 specify a color constant?

 --
 Kostya Vasilyev -- http://kmansoft.wordpress.com

 18.09.2010 19:35 пользователь Mark Wyszomierski 
 mar...@gmail.comjavascript: 
 написал:


 Yeah I guess that's why I'm confused, the alpha of my png is 100%. So 
 when I set the background color in the xml file to explicitly have alpha = 
 ff, then the layout editor shows the two colors matching. It's just that 
 when I run the app, the emulator (and n1 at least) show the background 
 color (not the png) as the different grey, same as when I was previously 
 *not* setting the alpha = ff. To sum it up:

before:
   background=#ebebeb
   drawable in photoshop (100% alpha, ebebeb)
   layout editor and emulator show background as a purplish-grey.

now
   background=#ffebebeb
   drawable (unchanged from before)
   layout editor shows background now matching my drawable,
   but at runtime it looks like the purplish grey from before.

 I'm not modifying the color at runtime (which could explain the 
 difference), I'll make a separate test app to try and demo it,

 Thanks



 On Sat, Sep 18, 2010 at 11:21 AM, Mark Murphy 
 mmu...@commonsware.comjavascript: 
 wrote:
 
  On Sat, Sep 18,...

 -- 
 You received this message because you are subscribed to the Google
 Groups Android Developers g...

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


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




 -- 
 Dianne Hackborn
 Android framework engineer
 hac...@android.com javascript:

 Note: please don't send private questions to me, as I don't have time to 
 provide private support, and so won't reply to such e-mails.  All such 
 questions should be posted on public forums, where I and others can see and 
 answer them.



-- 
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

Re: [android-developers] Same color specified in xml file and png appear differently?

2010-09-18 Thread Mark Wyszomierski
I'm not quite sure what's going on - if I specify the color in my layout xml
like so with alpha = FF:

   #ffebebeb

then at least in the layout editor it now matches the color of my png
(created in photoshop, with the same #ebebeb specification). When I run the
app though, the emulator is showing it as a different type of grey. Did I
miss what you meant by alpha channel difference, Mark?

Thanks

On Thu, Sep 16, 2010 at 9:59 AM, Mark Murphy mmur...@commonsware.comwrote:

 Might be an alpha channel difference.

 On Thu, Sep 16, 2010 at 9:51 AM, Mark Wyszomierski mar...@gmail.com
 wrote:
  Hi,
 
  I have a 9 png which is used as the background of a view, the
  stretchable region has a color of:
 
#ebebeb
 
  I have a view next to it, and I've set its background color like so:
 
   LinearLayout

android:background=#ebebeb 
 
  when the two views are beside one another, you can clearly tell that
  the colors are not the same, they're different shades of grey. I'm
  seeing this on the emulators, haven't had a chance to try it on a
  device. Is this expected, or is there something I'm doing wrong in the
  color declaration?
 
  Thanks
 
  --
  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.comandroid-developers%2bunsubscr...@googlegroups.com
  For more options, visit this group at
  http://groups.google.com/group/android-developers?hl=en
 



 --
 Mark Murphy (a Commons Guy)
 http://commonsware.com | http://github.com/commonsguy
 http://commonsware.com/blog | http://twitter.com/commonsguy

 --
 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.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

-- 
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

Re: [android-developers] Same color specified in xml file and png appear differently?

2010-09-18 Thread Mark Murphy
On Sat, Sep 18, 2010 at 11:17 AM, Mark Wyszomierski mar...@gmail.com wrote:
 I'm not quite sure what's going on - if I specify the color in my layout xml
 like so with alpha = FF:
    #ffebebeb
 then at least in the layout editor it now matches the color of my png
 (created in photoshop, with the same #ebebeb specification). When I run the
 app though, the emulator is showing it as a different type of grey. Did I
 miss what you meant by alpha channel difference, Mark?

Well, you are halfway there.

For starters, you need the alpha value of your background color to be
the same as the alpha value of your PNG file. You know what the alpha
value of your background color is, because you are setting it. Now,
you need to determine the alpha value that Photoshop used with your
PNG file.

Also, if you choose a non-opaque (i.e., less than FF) alpha, things
get more complicated, as you have to take into account the stuff the
alpha channel is blending from behind the respective widgets.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_The Busy Coder's Guide to *Advanced* Android Development_ Version 1.9
Available!

-- 
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


Re: [android-developers] Same color specified in xml file and png appear differently?

2010-09-18 Thread Mark Wyszomierski
Yeah I guess that's why I'm confused, the alpha of my png is 100%. So when I
set the background color in the xml file to explicitly have alpha = ff, then
the layout editor shows the two colors matching. It's just that when I run
the app, the emulator (and n1 at least) show the background color (not the
png) as the different grey, same as when I was previously *not* setting the
alpha = ff. To sum it up:

   before:
  background=#ebebeb
  drawable in photoshop (100% alpha, ebebeb)
  layout editor and emulator show background as a purplish-grey.

   now
  background=#ffebebeb
  drawable (unchanged from before)
  layout editor shows background now matching my drawable,
  but at runtime it looks like the purplish grey from before.

I'm not modifying the color at runtime (which could explain the difference),
I'll make a separate test app to try and demo it,

Thanks

On Sat, Sep 18, 2010 at 11:21 AM, Mark Murphy mmur...@commonsware.comwrote:

 On Sat, Sep 18, 2010 at 11:17 AM, Mark Wyszomierski mar...@gmail.com
 wrote:
  I'm not quite sure what's going on - if I specify the color in my layout
 xml
  like so with alpha = FF:
 #ffebebeb
  then at least in the layout editor it now matches the color of my png
  (created in photoshop, with the same #ebebeb specification). When I run
 the
  app though, the emulator is showing it as a different type of grey. Did I
  miss what you meant by alpha channel difference, Mark?

 Well, you are halfway there.

 For starters, you need the alpha value of your background color to be
 the same as the alpha value of your PNG file. You know what the alpha
 value of your background color is, because you are setting it. Now,
 you need to determine the alpha value that Photoshop used with your
 PNG file.

 Also, if you choose a non-opaque (i.e., less than FF) alpha, things
 get more complicated, as you have to take into account the stuff the
 alpha channel is blending from behind the respective widgets.

 --
 Mark Murphy (a Commons Guy)
 http://commonsware.com | http://github.com/commonsguy
 http://commonsware.com/blog | http://twitter.com/commonsguy

 _The Busy Coder's Guide to *Advanced* Android Development_ Version 1.9
 Available!

 --
 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.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en


-- 
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

Re: [android-developers] Same color specified in xml file and png appear differently?

2010-09-18 Thread Kostya Vasilyev
Perhaps you can use a small PNG drawable for the view where you currently
specify a color constant?

--
Kostya Vasilyev -- http://kmansoft.wordpress.com

18.09.2010 19:35 пользователь Mark Wyszomierski mar...@gmail.com
написал:

Yeah I guess that's why I'm confused, the alpha of my png is 100%. So when I
set the background color in the xml file to explicitly have alpha = ff, then
the layout editor shows the two colors matching. It's just that when I run
the app, the emulator (and n1 at least) show the background color (not the
png) as the different grey, same as when I was previously *not* setting the
alpha = ff. To sum it up:

   before:
  background=#ebebeb
  drawable in photoshop (100% alpha, ebebeb)
  layout editor and emulator show background as a purplish-grey.

   now
  background=#ffebebeb
  drawable (unchanged from before)
  layout editor shows background now matching my drawable,
  but at runtime it looks like the purplish grey from before.

I'm not modifying the color at runtime (which could explain the difference),
I'll make a separate test app to try and demo it,

Thanks



On Sat, Sep 18, 2010 at 11:21 AM, Mark Murphy mmur...@commonsware.com
wrote:

 On Sat, Sep 18,...

-- 
You received this message because you are subscribed to the Google
Groups Android Developers g...

-- 
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

Re: [android-developers] Same color specified in xml file and png appear differently?

2010-09-18 Thread Mark Wyszomierski
Hi Kostya, I'll probably end up doing that, I was just curious as to what is
going on with this since everything seems to look ok - I'll make that test
app and post back if I find anything,

Thanks

2010/9/18 Kostya Vasilyev kmans...@gmail.com

 Perhaps you can use a small PNG drawable for the view where you currently
 specify a color constant?

 --
 Kostya Vasilyev -- http://kmansoft.wordpress.com

 18.09.2010 19:35 пользователь Mark Wyszomierski mar...@gmail.com
 написал:


 Yeah I guess that's why I'm confused, the alpha of my png is 100%. So when
 I set the background color in the xml file to explicitly have alpha = ff,
 then the layout editor shows the two colors matching. It's just that when I
 run the app, the emulator (and n1 at least) show the background color (not
 the png) as the different grey, same as when I was previously *not* setting
 the alpha = ff. To sum it up:

before:
   background=#ebebeb
   drawable in photoshop (100% alpha, ebebeb)
   layout editor and emulator show background as a purplish-grey.

now
   background=#ffebebeb
   drawable (unchanged from before)
   layout editor shows background now matching my drawable,
   but at runtime it looks like the purplish grey from before.

 I'm not modifying the color at runtime (which could explain the
 difference), I'll make a separate test app to try and demo it,

 Thanks



 On Sat, Sep 18, 2010 at 11:21 AM, Mark Murphy mmur...@commonsware.com
 wrote:
 
  On Sat, Sep 18,...

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers g...

  --
 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.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en


-- 
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

Re: [android-developers] Same color specified in xml file and png appear differently?

2010-09-18 Thread Dianne Hackborn
One thing that could be happening is if your image is entirely opaque then
it may be loaded as 16bpp for memory/performance reasons.

2010/9/18 Mark Wyszomierski mar...@gmail.com

 Hi Kostya, I'll probably end up doing that, I was just curious as to what
 is going on with this since everything seems to look ok - I'll make that
 test app and post back if I find anything,

 Thanks

 2010/9/18 Kostya Vasilyev kmans...@gmail.com

 Perhaps you can use a small PNG drawable for the view where you currently
 specify a color constant?

 --
 Kostya Vasilyev -- http://kmansoft.wordpress.com

 18.09.2010 19:35 пользователь Mark Wyszomierski mar...@gmail.com
 написал:


 Yeah I guess that's why I'm confused, the alpha of my png is 100%. So when
 I set the background color in the xml file to explicitly have alpha = ff,
 then the layout editor shows the two colors matching. It's just that when I
 run the app, the emulator (and n1 at least) show the background color (not
 the png) as the different grey, same as when I was previously *not* setting
 the alpha = ff. To sum it up:

before:
   background=#ebebeb
   drawable in photoshop (100% alpha, ebebeb)
   layout editor and emulator show background as a purplish-grey.

now
   background=#ffebebeb
   drawable (unchanged from before)
   layout editor shows background now matching my drawable,
   but at runtime it looks like the purplish grey from before.

 I'm not modifying the color at runtime (which could explain the
 difference), I'll make a separate test app to try and demo it,

 Thanks



 On Sat, Sep 18, 2010 at 11:21 AM, Mark Murphy mmur...@commonsware.com
 wrote:
 
  On Sat, Sep 18,...

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers g...

  --
 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.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en


  --
 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.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en




-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

-- 
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

Re: [android-developers] Same color specified in xml file and png appear differently?

2010-09-16 Thread Mark Murphy
Might be an alpha channel difference.

On Thu, Sep 16, 2010 at 9:51 AM, Mark Wyszomierski mar...@gmail.com wrote:
 Hi,

 I have a 9 png which is used as the background of a view, the
 stretchable region has a color of:

   #ebebeb

 I have a view next to it, and I've set its background color like so:

  LinearLayout
       
       android:background=#ebebeb 

 when the two views are beside one another, you can clearly tell that
 the colors are not the same, they're different shades of grey. I'm
 seeing this on the emulators, haven't had a chance to try it on a
 device. Is this expected, or is there something I'm doing wrong in the
 color declaration?

 Thanks

 --
 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




-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

-- 
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