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
open class ColorSerializer : KSerializer<SerializableColor>

A KSerializer for SerializableColor

Link copied to clipboard

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.

Default implementation of a FontLoader.

Link copied to clipboard

Default implementation of an ImageLoader.

Default implementation of an ImageLoader.

Default implementation of an ImageLoader.

Link copied to clipboard

Default implementation of a StringLoader.

Default implementation of a StringLoader.

Default implementation of a StringLoader.

Link copied to clipboard
interface FontLoader

Loads a KalugaFont based on a provided identifier.

Link copied to clipboard

Style of the system font

Link copied to clipboard

Trait to add to a system font

Link copied to clipboard

Font weights as defined by W3

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
interface ImageLoader

Loads a KalugaImage based on a provided identifier.

Link copied to clipboard
actual sealed class KalugaColor

Class describing a color

expect sealed class KalugaColor

Class describing a color

actual sealed class KalugaColor

Class describing a color

Link copied to clipboard

Loads a KalugaColor based on a provided identifier.

Link copied to clipboard
actual typealias KalugaFont = Typeface
typealias KalugaFont = Typeface

Class describing a font

expect class KalugaFont

Class describing a font

actual typealias KalugaFont = UIFont
typealias KalugaFont = UIFont

Class describing a font

Link copied to clipboard
actual data class KalugaImage(val drawable: Drawable)

Class describing an image.

expect class KalugaImage

Class describing an image.

actual typealias KalugaImage = UIImage
typealias KalugaImage = UIImage

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
open class RGBColorSerializer : KSerializer<SerializableRGBColor>

A KSerializer for SerializableRGBColor

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
@Serializable(with = RGBColorSerializer::class)
data class SerializableRGBColor(val color: KalugaColor.RGBColor)

A wrapper for KalugaColor.RGBColor 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

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

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

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

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

Link copied to clipboard

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

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

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

Link copied to clipboard

Gets the blue 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

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

Link copied to clipboard
Link copied to clipboard

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

Link copied to clipboard

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

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

Creates a KalugaColor.DarkLightColor from another by using the KalugaColor.DarkLightColor.darkColor as the default color and vice versa.

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

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 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
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.

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

Link copied to clipboard

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

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

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

Link copied to clipboard

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

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

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

Link copied to clipboard
Link copied to clipboard
val TintedImage.uiImage: UIImage

Gets the tinted UIImage of a TintedImage

Functions

Link copied to clipboard

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

Link copied to clipboard

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

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
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

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

Link copied to clipboard

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

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.RGBColor

Creates a KalugaColor.RGBColor 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.RGBColor

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

Attempts to parse a given String into a KalugaColor.RGBColor. 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.RGBColor

Creates a KalugaColor.RGBColor 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.RGBColor

Creates a KalugaColor.RGBColor 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.RGBColor

Creates a KalugaColor.RGBColor 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.RGBColor

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

Link copied to clipboard
actual fun createDefaultFont(weight: Int, style: FontStyle, traits: Set<FontTrait>): KalugaFont

Creates a system font with a given weight, FontStyle and FontTrait

fun createDefaultFont(weight: FontWeight, style: FontStyle = FontStyle.DEFAULT, traits: Set<FontTrait> = emptySet()): KalugaFont

Creates a system font with a given FontWeight, FontStyle and FontTrait

expect fun createDefaultFont(weight: Int, style: FontStyle = FontStyle.DEFAULT, traits: Set<FontTrait> = emptySet()): KalugaFont

Creates a system font with a given weight, FontStyle and FontTrait

actual fun createDefaultFont(weight: Int, style: FontStyle, traits: Set<FontTrait>): KalugaFont

Creates a system font with a given weight, FontStyle and FontTrait

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. If this is a KalugaColor.DarkLightColor each component wll be darkened individually.

Decreases the lightness of a KalugaColor.RGBColor 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

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

Link copied to clipboard

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

Link copied to clipboard

Blends a KalugaColor with another color using BlendMode.HardLight

Link copied to clipboard

Gets the hex string representing the color forDarkMode

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. If this is a KalugaColor.DarkLightColor each component wll be lightened individually.

Increases the lightness of a KalugaColor.RGBColor 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

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

Link copied to clipboard

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

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

Link copied to clipboard

Creates a KalugaColor.DarkLightColor that uses darkModeColor when isInDarkMode and this color otherwise. If this color has a dark mode already it will be overwritten. If darkModeColor has a dark mode, it will be used.

Creates a KalugaColor.DarkLightColor that uses darkModeColor when isInDarkMode and this color otherwise. If this color has a dark mode already it will be overwritten. If darkModeColor has a dark mode, it will be used.

Creates a KalugaColor.DarkLightColor that uses darkModeColor when isInDarkMode and this color otherwise. If this color has a dark mode already it will be overwritten. If darkModeColor has a dark mode, it will be used.