Theme

sealed class Theme

Represents the available theme modes for the application.

This sealed class defines three theme modes: Light, Dark, and System. Each theme mode provides specific behavior for determining its opposite theme and maintaining persistence through ordinal values.

Inheritors

Types

Link copied to clipboard
object Companion
Link copied to clipboard
object Dark : Theme

Dark theme mode that forces the application to use dark colors.

Link copied to clipboard
object Light : Theme

Light theme mode that forces the application to use light colors.

Link copied to clipboard
object System : Theme

System theme mode that follows the system's theme preference.

Properties

Link copied to clipboard
abstract val ordinal: Int

The unique ordinal identifier for this theme mode.

Functions

Link copied to clipboard

Determines if this theme resolves to a dark appearance.

Link copied to clipboard
abstract fun opposite(isSystemInDarkTheme: Boolean): Theme

Returns the opposite theme based on the current theme and system settings.