All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.woojiahao.style.Settings.kt Maven / Gradle / Ivy

There is a newer version: 0.2.3
Show newest version
package com.github.woojiahao.style

import com.github.woojiahao.style.Settings.Theme.LIGHT
import com.github.woojiahao.style.utility.FontFamily
import com.github.woojiahao.style.utility.FontFamily.BaseFontFamily.MONOSPACE
import com.github.woojiahao.style.utility.FontFamily.BaseFontFamily.SANS_SERIF
import com.github.woojiahao.style.utility.px

object Settings {
  enum class Theme { DARK, LIGHT }

  var fontSize = 16.0.px
  var theme = LIGHT
  var font = FontFamily(SANS_SERIF)
    get() = field.clone()
  var monospaceFont = FontFamily(MONOSPACE)
    get() = field.clone()

  fun reset() {
    fontSize = 16.0.px
    theme = LIGHT
    font = FontFamily(SANS_SERIF)
    monospaceFont = FontFamily(MONOSPACE)
  }
}

inline fun settings(configuration: Settings.() -> Unit) = Settings.apply(configuration)




© 2015 - 2024 Weber Informatics LLC | Privacy Policy