AppColour

open class AppColour(val light: Color, val dark: Color = light)

Encapsulates light and dark mode colours. If dark colour isn't provided, defaults to light in dark mode.

Access the correct colours for current app state using the current property.

Dev note: using isSystemInDarkMode() is an expensive operation, so we should do it once at top level and pass the resulting theme as composition local. This will also let us handle the scenarios where a user has selected always light/dark theme.

This class is 'open' only so we could extend it for the Unspecified data object.

Inheritors

Constructors

Link copied to clipboard
constructor(light: Color, dark: Color = light)

Types

Link copied to clipboard
data object Transparent : AppColour

Colour is transparent.

Link copied to clipboard
data object Unspecified : AppColour

Colour is not specified.

Properties

Link copied to clipboard

Provides the card colour depending on whether dark mode is active or not

Link copied to clipboard
@get:VisibleForTesting(otherwise = 2)
val dark: Color
Link copied to clipboard
@get:VisibleForTesting(otherwise = 2)
val light: Color

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int