Package-level declarations

Types

Link copied to clipboard
sealed class BlendMode

Blend Modes as defined by https://helpx.adobe.com/photoshop/using/blending-modes.html

Link copied to clipboard
typealias Color = KalugaColor
Link copied to clipboard
open class ColorSerializer : KSerializer<SerializableColor>

A KSerializer for SerializableColor

Link copied to clipboard

Default implementation of a KalugaColorLoader.

Default implementation of a KalugaColorLoader.

actual class DefaultColorLoader

Default implementation of a KalugaColorLoader.

Default implementation of a KalugaColorLoader.

Default implementation of a KalugaColorLoader.

Link copied to clipboard

All HTML supported colors https://htmlcolorcodes.com/color-names/

Link copied to clipboard

Default implementation of a FontLoader.

Default implementation of a FontLoader.

actual class DefaultFontLoader

Default implementation of a FontLoader.

Default implementation of a FontLoader.

Default implementation of a FontLoader.

Link copied to clipboard

Default implementation of an ImageLoader.

Default implementation of an ImageLoader.

actual class DefaultImageLoader

Default implementation of an ImageLoader.

Default implementation of a ImageLoader.

Default implementation of a ImageLoader.

Link copied to clipboard

Default implementation of a StringLoader.

Default implementation of a StringLoader.

actual class DefaultStringLoader

Default implementation of a StringLoader.

Default implementation of a StringLoader.

Default implementation of a StringLoader.

Link copied to clipboard
typealias Font = KalugaFont
Link copied to clipboard
interface FontLoader

Loads a KalugaFont based on a provided identifier.

Link copied to clipboard
@Serializable
data class HSLColor(val hue: Double, val saturation: Double, val lightness: Double, val alpha: Double = 1.0)

A color using hue, saturation, and lightness color spaces

Link copied to clipboard
typealias Image = KalugaImage
Link copied to clipboard
interface ImageLoader

Loads a KalugaImage based on a provided identifier.

Link copied to clipboard
actual typealias KalugaColor = Int

Class describing a color

expect class KalugaColor

Class describing a color

actual data class KalugaColor(val uiColor: <Error class: unknown class>)

Class describing a color

actual typealias KalugaColor = Int

Class describing a color

actual typealias KalugaColor = Int

Class describing a color

Link copied to clipboard

Loads a KalugaColor based on a provided identifier.

Link copied to clipboard
actual typealias KalugaFont = Typeface

Class describing a font

expect class KalugaFont

Class describing a font

actual typealias KalugaFont = <Error class: unknown class>

Class describing a font

actual class KalugaFont

Class describing a font

actual class KalugaFont

Class describing a font

Link copied to clipboard
actual data class KalugaImage

Class describing an image.

expect class KalugaImage

Class describing an image.

actual typealias KalugaImage = <Error class: unknown class>

Class describing an image.

actual class KalugaImage

Class describing an image.

actual class KalugaImage

Class describing an image.

Link copied to clipboard
data class LinkStyle(val color: KalugaColor, val isUnderlined: Boolean)

A style to apply to a StyledString when StringStyleAttribute.Link is applied

Link copied to clipboard
@Serializable(with = ColorSerializer::class)
data class SerializableColor(val color: KalugaColor)

A wrapper for KalugaColor that allows it to be serialized

Link copied to clipboard
interface StringLoader

Loads a String based on a provided identifier.

Link copied to clipboard

A style attribute that can be applied to a StyledString

Link copied to clipboard
actual class StyledString

A text configured with StringStyleAttribute

expect class StyledString

A text configured with StringStyleAttribute

actual data class StyledString

A text configured with StringStyleAttribute

actual data class StyledString

A text configured with StringStyleAttribute

actual data class StyledString

A text configured with StringStyleAttribute

Link copied to clipboard
actual class StyledStringBuilder

Builder for creating a StyledString

expect class StyledStringBuilder

Builder for creating a StyledString

actual class StyledStringBuilder

Builder for creating a StyledString

actual class StyledStringBuilder

Builder for creating a StyledString

actual class StyledStringBuilder

Builder for creating a StyledString

Link copied to clipboard
data class TintedImage(val image: KalugaImage, val tint: KalugaColor)

A KalugaImage tinted with a given KalugaColor

Properties

Link copied to clipboard

Gets the alpha value of the color in a range between 0.0 and 1.0

Gets the alpha value of the color in a range between 0.0 and 1.0

Link copied to clipboard

Gets the alpha value of the color in a range between 0 and 255

Gets the alpha value of the color in a range between 0 and 255

Link copied to clipboard
expect val KalugaColor.blue: Double

Gets the blue value of the color in a range between 0.0 and 1.0

actual val KalugaColor.blue: Double

Gets the blue value of the color in a range between 0.0 and 1.0

Link copied to clipboard
expect val KalugaColor.blueInt: Int

Gets the blue value of the color in a range between 0 and 255

actual val KalugaColor.blueInt: Int

Gets the green value of the color in a range between 0 and 255

Link copied to clipboard

Gets the KalugaColor equivalent to this HSLColor

Link copied to clipboard

The default bold system KalugaFont

The default bold system KalugaFont

The default bold system KalugaFont

The default bold system KalugaFont

The default bold system KalugaFont

Link copied to clipboard

The default system KalugaFont

The default system KalugaFont

The default system KalugaFont

The default system KalugaFont

The default system KalugaFont

Link copied to clipboard

The default italic system KalugaFont

The default italic system KalugaFont

The default italic system KalugaFont

The default italic system KalugaFont

The default italic system KalugaFont

Link copied to clipboard

The default monospace system KalugaFont

The default monospace system KalugaFont

The default monospace system KalugaFont

The default monospace system KalugaFont

The default monospace system KalugaFont

Link copied to clipboard

Gets a Drawable of a TintedImage or null if the TintedImage cannot be made into a Drawable

Link copied to clipboard

Gets the green value of the color in a range between 0.0 and 1.0

Gets the green value of the color in a range between 0.0 and 1.0

Link copied to clipboard

Gets the green value of the color in a range between 0 and 255

Gets the blue value of the color in a range between 0 and 255

Link copied to clipboard

The hex string representing this color

Link copied to clipboard

Gets the HSLColor equivalent to this KalugaColor

Link copied to clipboard
Link copied to clipboard
actual val isInDarkMode: Boolean

When true the application is in Dark Mode.

expect val isInDarkMode: Boolean

When true the application is in Dark Mode.

actual val isInDarkMode: Boolean

When true the application is in Dark Mode.

actual val isInDarkMode: Boolean = false

When true the application is in Dark Mode.

actual val isInDarkMode: Boolean = false

When true the application is in Dark Mode.

Link copied to clipboard

Gets the plain string of a StyledString

Gets the plain string of a StyledString

Gets the plain string of a StyledString

Gets the plain string of a StyledString

Gets the plain string of a StyledString

Link copied to clipboard
expect val KalugaColor.red: Double

Gets the red value of the color in a range between 0.0 and 1.0

actual val KalugaColor.red: Double

Gets the red value of the color in a range between 0.0 and 1.0

Link copied to clipboard
expect val KalugaColor.redInt: Int

Gets the red value of the color in a range between 0 and 255

actual val KalugaColor.redInt: Int

Gets the red value of the color in a range between 0 and 255

Link copied to clipboard
Link copied to clipboard
val <Error class: unknown class>.uiImage: <Error class: unknown class>

Gets the tinted UIImage of a TintedImage

Functions

Link copied to clipboard
fun String.asColor(colorLoader: KalugaColorLoader = DefaultColorLoader(), defaultValue: KalugaColor? = null): KalugaColor?

Treats this string as a resource identifier for a KalugaColor and grabs the associated KalugaColor

Link copied to clipboard
suspend fun String.asFont(fontLoader: FontLoader = DefaultFontLoader(), defaultValue: KalugaFont? = null): KalugaFont?

Treats this string as a resource identifier for a KalugaFont and grabs the associated KalugaFont

Link copied to clipboard
fun String.asImage(imageLoader: ImageLoader = DefaultImageLoader(), defaultValue: KalugaImage? = null): KalugaImage?

Treats this string as a resource identifier for a KalugaColor and grabs the associated KalugaImage

Link copied to clipboard

Looks for a substring in the String and returns a Pair or StringStyleAttribute and IntRange that should be provided to StyledStringBuilder to apply the StringStyleAttribute to the first occurrence of the substring

Link copied to clipboard

Blends a KalugaColor with another color using BlendMode.ColorBurn

Link copied to clipboard

Blends a KalugaColor with another color using BlendMode.ColorBlend

Link copied to clipboard
actual fun colorFrom(red: Double, green: Double, blue: Double, alpha: Double): KalugaColor

Creates a KalugaColor using red, green, blue, and (optional) alpha, all ranging between 0.0 and 1.0.

actual fun colorFrom(redInt: Int, greenInt: Int, blueInt: Int, alphaInt: Int): KalugaColor

Creates a KalugaColor using red, green, blue, and (optional) alpha, all ranging between 0 and 255.

fun colorFrom(hexString: String): KalugaColor?

Attempts to parse a given String into a Color. The string should be formatted as either #AARRGGBB or #RRGGBB for the parsing to succeed.

expect fun colorFrom(red: Double, green: Double, blue: Double, alpha: Double = 1.0): KalugaColor

Creates a KalugaColor using red, green, blue, and (optional) alpha, all ranging between 0.0 and 1.0.

expect fun colorFrom(redInt: Int, greenInt: Int, blueInt: Int, alphaInt: Int = 255): KalugaColor

Creates a KalugaColor using red, green, blue, and (optional) alpha, all ranging between 0 and 255.

actual fun colorFrom(red: Double, green: Double, blue: Double, alpha: Double): KalugaColor

Creates a KalugaColor using red, green, blue, and (optional) alpha, all ranging between 0.0 and 1.0.

actual fun colorFrom(redInt: Int, greenInt: Int, blueInt: Int, alphaInt: Int): KalugaColor

Creates a KalugaColor using red, green, blue, and (optional) alpha, all ranging between 0 and 255.

actual fun colorFrom(red: Double, green: Double, blue: Double, alpha: Double): KalugaColor

Creates a KalugaColor using red, green, blue, and (optional) alpha, all ranging between 0.0 and 1.0.

actual fun colorFrom(redInt: Int, greenInt: Int, blueInt: Int, alphaInt: Int): KalugaColor

Creates a KalugaColor using red, green, blue, and (optional) alpha, all ranging between 0 and 255.

actual fun colorFrom(red: Double, green: Double, blue: Double, alpha: Double): KalugaColor

Creates a KalugaColor using red, green, blue, and (optional) alpha, all ranging between 0.0 and 1.0.

actual fun colorFrom(redInt: Int, greenInt: Int, blueInt: Int, alphaInt: Int): KalugaColor

Creates a KalugaColor using red, green, blue, and (optional) alpha, all ranging between 0 and 255.

Link copied to clipboard

Blends a KalugaColor with another color using BlendMode.Darken

Link copied to clipboard

Decreases the lightness of a KalugaColor by this factor.

Link copied to clipboard

Blends a KalugaColor with another color using BlendMode.Difference

Link copied to clipboard

Blends a KalugaColor with another color using BlendMode.ColorDodge

Link copied to clipboard
fun Float.dpToPixel(context: Context): Float

Gets the pixel value for a Float in Device Independent Pixels

Link copied to clipboard

Blends a KalugaColor with another color using BlendMode.Exclusion

Link copied to clipboard

Blends a KalugaColor with another color using BlendMode.HardLight

Link copied to clipboard

Blends a KalugaColor with another color using BlendMode.Hue

Link copied to clipboard

Blends a KalugaColor with another color using BlendMode.Lighten

Link copied to clipboard

Increases the lightness of a KalugaColor by this factor.

Link copied to clipboard
fun String.localized(stringLoader: StringLoader = DefaultStringLoader(), defaultValue: String = this): String

Treats this string as a resource identifier for a String and grabs the associated String

Link copied to clipboard

Blends a KalugaColor with another color using BlendMode.Luminosity

Link copied to clipboard

Blends a KalugaColor with another color using BlendMode.Multiply

Link copied to clipboard

Blends a KalugaColor with another color using BlendMode.Normal

Link copied to clipboard

Blends a KalugaColor with another color using BlendMode.Overlay

Link copied to clipboard
fun String.quantity(quantity: Int, stringLoader: StringLoader = DefaultStringLoader(), defaultValue: String = this): String

Treats this string as a resource identifier for a plural string format String and formats given value using associated format String

Link copied to clipboard

Blends a KalugaColor with another color using BlendMode.Saturation

Link copied to clipboard

Blends a KalugaColor with another color using BlendMode.Screen

Link copied to clipboard

Blends a KalugaColor with another color using BlendMode.SoftLight

Link copied to clipboard
fun Float.spToPixel(context: Context): Float

Gets the pixel value for a Float in Scaled Pixels

Link copied to clipboard
fun String.styled(provider: StyledStringBuilder.Provider, defaultTextStyle: KalugaTextStyle, vararg attributes: StringStyleAttribute): StyledString
fun String.styled(provider: StyledStringBuilder.Provider, defaultTextStyle: KalugaTextStyle, vararg attributes: String.() -> Pair<StringStyleAttribute, IntRange>?): StyledString
fun String.styled(provider: StyledStringBuilder.Provider, defaultTextStyle: KalugaTextStyle, linkColor: KalugaColor, vararg attributes: StringStyleAttribute): StyledString
fun String.styled(provider: StyledStringBuilder.Provider, defaultTextStyle: KalugaTextStyle, linkColor: KalugaColor, vararg attributes: String.() -> Pair<StringStyleAttribute, IntRange>?): StyledString
fun String.styled(provider: StyledStringBuilder.Provider, defaultTextStyle: KalugaTextStyle, linkStyle: LinkStyle?, vararg attributes: StringStyleAttribute): StyledString
fun String.styled(provider: StyledStringBuilder.Provider, defaultTextStyle: KalugaTextStyle, linkStyle: LinkStyle?, vararg attributes: String.() -> Pair<StringStyleAttribute, IntRange>?): StyledString

Creates a StyledString from a String

Link copied to clipboard

Attempts to create a new KalugaImage that is tinted in a given KalugaColor