Over a million developers have joined DZone.

XNA Windows Phone Theme Library

· Mobile Zone

If you've spent time developing games for Windows Phone using XNA, you've probably noticed it can be a bit of a pain to get the phone's theme color, particularly in comparison to how easy this task is with Silverlight.  Tired of dealing with this problem, Daniel Brown set out to correct this problem by creating a simple and easy to use library.

Here's the list of features from Daniel's site:

  • Get the following resources delivered to your XNA game code as an XNA colour
    • Phone Background Colour (Dark / Light)
    • Phone Accent Colour (Tile Colour)
    • Phone Border Colour
    • Phone Chrome Colour
    • Phone Contrast Background Colour (i.e. The opposite of the current background colour)
    • Phone Contrast Foreground Colour

  • Get the colour of any tile type. Don't want to have to remember the RGB values for all the possible colours? Now you don't have to.
    • WindowsPhoneTheme.blue will return you blue
    • Here are the other colours
      • blue
      • red
      • green
      • mango (orange)
      • pink
      • brown
      • lime
      • teal
      • purple
      • magenta

  • Simple Syntax
    • Just want the tile colour?

      getTileColour();


      Simple as that
    • Use intellisense for the other methods



The library and source file are available for download here, along with some simple instructions.

Topics:

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}