'theme'에 해당되는 글 2건

  1. 2010.11.20 [WP7] Theme(Dark/Light) 구분하기
  2. 2010.11.20 [WP7] Theme & Accent Color 정보
Windows Phone 7에는 현재 Dark/Light 이렇게 2개의 테마가 있는데 아래 코드는 이 2개의 테마를 구분하는 다양한 코드입니다.
// Use PhoneDarkThemeVisibility
Visibility visibilityDark = (Visibility)Application.Current.Resources["PhoneDarkThemeVisibility"];
if (visibilityDark == Visibility.Visible)
{
    // Dark theme
}
else if (visibilityDark == Visibility.Collapsed)
{
    // Light theme
}

// Use PhoneLightThemeVisibility
Visibility visibilityLight = (Visibility)Application.Current.Resources["PhoneLightThemeVisibility"];
if (visibilityLight == Visibility.Collapsed)
{
    // Dark theme
}
else if (visibilityLight == Visibility.Visible)
{
    // Light theme
}

// Use PhoneLightThemeOpacity
double opacityDark = (double)Application.Current.Resources["PhoneDarkThemeOpacity"];
if (opacityDark == 1.0)
{
    // Dark theme
}
else if (opacityDark == 0.0)
{
    // Light theme
}

// Use PhoneLightThemeOpacity
double opacityLight = (double)Application.Current.Resources["PhoneLightThemeOpacity"];
if (opacityLight == 0.0)
{
    // Dark theme
}
else if (opacityLight == 1.0)
{
    // Light theme
}

// Use PhoneForegroundColor
Color colorForeground = (Color)Application.Current.Resources["PhoneForegroundColor"];
if (colorForeground.ToString() == "#FFFFFFFF")
{
    // Dark theme
}
else if (colorForeground.ToString() == "#DE000000")
{
    // Light theme
}

// Use PhoneBackgroundColor
Color colorBackground = (Color)Application.Current.Resources["PhoneBackgroundColor"];
if (colorBackground.ToString() == "#FF000000")
{
    // Dark theme
}
else if (colorBackground.ToString() == "#FFFFFFFF")
{
    // Light theme
}

Posted by Gungume
,
Windows Phone 7의 Theme는 Dark/Light 2개의 Background를 설정할 수 있고, 10개의 Accent color를 설정할 수 있습니다.

아래는 위의 값들을 얻어오는 방법과 각 값의 ARGB 색상정보입니다.

//Get background color
Color themeBackColor = (Color)Application.Current.Resources["PhoneBackgroundColor"];

//Get foreground color
Color themeForeColor = (Color)Application.Current.Resources["PhoneForegroundColor"];

//Get accent color
Color accentColor = (Color)Application.Current.Resources["PhoneAccentColor"];

Dark/Light theme에 따른 Background/Foreground 색상 정보
 Theme 종류  Background ARGB  Foreground ARGB
 Dark  #FF000000  #FFFFFFFF
 Light  #FFFFFFFF  #DE000000

Accent 색상 정보
 Accent color  ARGB
 magenta  #FFFF0097
 purple  #FFA200FF
 teal  #FF00ABA9
 lime  #FF8CBF26
 brown  #FFA05000
 pink  #FFE671B8
 orange  #FFF09609
 blue  #FF1BA1E2
 red  #FFE51400
 green  #FF339933


Posted by Gungume
,