Package-level declarations

Types

Link copied to clipboard

The twenty accents Windows Phone 8 shipped.

Link copied to clipboard
data class KvadrantColors(val accent: Color, val foreground: Color, val background: Color, val contrastForeground: Color, val contrastBackground: Color, val disabled: Color, val subtle: Color, val chrome: Color, val semitransparent: Color, val border: Color, val inactive: Color, val textBox: Color, val textBoxEditBackground: Color, val textBoxForeground: Color, val checkBoxPressed: Color, val checkBoxPressedBorder: Color, val isDark: Boolean)

The Windows Phone theme palette: thirteen tokens and one accent, transcribed from the SDK's ThemeResources.xaml.

Link copied to clipboard

Metro's timing, from the WinJS animation library and the Windows Phone Toolkit.

Link copied to clipboard

Windows Phone sized text in points. Metro's own resource dictionary annotates every size with its point value, and the ratio is 0.75 in all seventeen of them, so this is Microsoft's conversion rather than a convention chosen here.

Link copied to clipboard
data class KvadrantMetrics(val scale: Float = 1.0f, val margin: Dp = 9.dp, val borderThickness: Dp = 2.25.dp, val focusRingThickness: Dp = 1.667.dp, val touchTargetOverhang: Dp = 9.dp, val touchTargetVisual: Dp = 25.5.dp, val touchTargetMin: Dp = 48.dp, val pivotItemMargin: Dp = 9.dp, val pivotItemTopMargin: Dp = 21.dp, val pivotHeaderGap: Dp = 15.75.dp, val tiltDepression: Dp = 18.75.dp, val buttonPaddingHorizontal: Dp = 7.5.dp, val buttonPaddingTop: Dp = 2.25.dp, val buttonPaddingBottom: Dp = 3.75.dp, val progressThickness: Dp = 3.dp, val sliderThickness: Dp = 9.dp, val tileSmall: Dp = 74.25.dp, val tileMedium: Dp = 157.5.dp, val tileWide: Dp = 324.dp, val tileGap: Dp = 9.dp)

Page and control measurements, in dp at the canonical 0.75 of Metro's pixels.

Link copied to clipboard

The current theme.

Link copied to clipboard
data class KvadrantTypography(val normal: TextStyle, val subtle: TextStyle, val title: TextStyle, val mediumLarge: TextStyle, val large: TextStyle, val extraLarge: TextStyle, val pageTitle: TextStyle, val pivotHeader: TextStyle, val panoramaTitle: TextStyle, val panoramaSectionHeader: TextStyle)

The named text styles of a Windows Phone page.

Link copied to clipboard

Metro chooses weight by picking a family, not by setting a number. Selawik ships exactly the five Segoe WP had, and these are the four the phone's own styles use.

Properties

Link copied to clipboard
const val WCAG_AA: Float = 4.5f

WCAG AA for body text.

Functions

Link copied to clipboard

The theme with every colour that carries text raised to WCAG AA.

Link copied to clipboard
fun accessibleAccent(accent: Color, target: Float = WCAG_AA): Color

The nearest colour to accent that reaches target against the text colour Metro would put on it, found by walking towards black or white.

Link copied to clipboard
fun contrastOn(background: Color): Color

Which of black or white to put on a colour, by the rule Windows Phone used: light accents take black text, dark ones take white.

Link copied to clipboard

WCAG's contrast ratio between two opaque colours.

Link copied to clipboard
fun KvadrantTheme(colors: KvadrantColors = KvadrantColors.dark(), typography: KvadrantTypography = LocalKvadrantTypography.current, metrics: KvadrantMetrics = KvadrantMetrics(), remastered: Boolean = false, content: @Composable () -> Unit)

Wraps content in a Metro theme, and replaces the press indication with TiltIndication — the plane leaning towards the finger is Metro's ripple, and it is the default rather than something a caller remembers to apply.

Link copied to clipboard

The same measurements, every one of them multiplied by factor.

The same ramp, every size multiplied by factor.

Link copied to clipboard

The metric set scaled so that one row of the Start screen — margin, wide tile, margin — is exactly width across.