Skip to content

Commit

Permalink
Generated updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
chRyNaN committed Feb 26, 2022
1 parent eed7f90 commit 9a2204b
Show file tree
Hide file tree
Showing 63 changed files with 329 additions and 106 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
//[colors-compose-web](../../../index.md)/[com.chrynan.colors.compose.web](../index.md)/[ComposeColor](index.md)

# ComposeColor

[common]\
expect class [ComposeColor](index.md)

[js]\
actual typealias [ComposeColor](index.md) = CSSColorValue
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//[colors-compose-web](../../index.md)/[com.chrynan.colors.compose.web](index.md)/[LocalColors](-local-colors.md)

# LocalColors

[common]\
val [LocalColors](-local-colors.md): ProvidableCompositionLocal<[Colors](../../../colors-theme/colors-theme/com.chrynan.colors.theme/-colors/index.md)>

A ProvidableCompositionLocal of the [Colors](../../../colors-theme/colors-theme/com.chrynan.colors.theme/-colors/index.md) interface.

To access this value in a Composable function, simply access the current value:

LocalColors.current

To provide a new local color value, simply use the CompositionLocalProvider function:

CompositionLocalProvider(LocalColors provides colors) {\
LocalColors.current\
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//[colors-compose-web](../../index.md)/[com.chrynan.colors.compose.web](index.md)

# Package com.chrynan.colors.compose.web

## Types

| Name | Summary |
|---|---|
| [ComposeColor](-compose-color/index.md) | [common, js]<br>[common]<br>expect class [ComposeColor](-compose-color/index.md)<br>[js]<br>actual typealias [ComposeColor](-compose-color/index.md) = CSSColorValue |

## Functions

| Name | Summary |
|---|---|
| [isSystemInDarkTheme](is-system-in-dark-theme.md) | [common]<br>@Composable<br>@ReadOnlyComposable<br>fun [isSystemInDarkTheme](is-system-in-dark-theme.md)(): [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)<br>Determines whether the current system theme is set to dark mode. |
| [systemBasedColors](system-based-colors.md) | [common]<br>@Composable<br>fun [LightDarkColorTheme](../../../colors-theme/colors-theme/com.chrynan.colors.theme/-light-dark-color-theme/index.md).[systemBasedColors](system-based-colors.md)(): [Colors](../../../colors-theme/colors-theme/com.chrynan.colors.theme/-colors/index.md)<br>Obtains the appropriate [Colors](../../../colors-theme/colors-theme/com.chrynan.colors.theme/-colors/index.md) instance of this [LightDarkColorTheme](../../../colors-theme/colors-theme/com.chrynan.colors.theme/-light-dark-color-theme/index.md) depending on the result of the [isSystemInDarkTheme](is-system-in-dark-theme.md) function. If [isSystemInDarkTheme](is-system-in-dark-theme.md) returns true, then the [LightDarkColorTheme.dark](../../../colors-theme/colors-theme/com.chrynan.colors.theme/-colors/index.md) will be returned. Otherwise, the [LightDarkColorTheme.light](../../../colors-theme/colors-theme/com.chrynan.colors.theme/-colors/index.md) will be returned. |
| [toComposeColor](to-compose-color.md) | [common, js]<br>[common]<br>expect fun [Color](../../../colors-core/colors-core/com.chrynan.colors/-color/index.md).[toComposeColor](to-compose-color.md)(): [ComposeColor](-compose-color/index.md)<br>[js]<br>actual fun [Color](../../../colors-core/colors-core/com.chrynan.colors/-color/index.md).[toComposeColor](to-compose-color.md)(): [ComposeColor](-compose-color/index.md) |
| [toCSSColorValue](to-c-s-s-color-value.md) | [js]<br>fun [Color](../../../colors-core/colors-core/com.chrynan.colors/-color/index.md).[toCSSColorValue](to-c-s-s-color-value.md)(destinationColorSpace: [ColorSpace](../../../colors-core/colors-core/com.chrynan.colors.space/-color-space/index.md) = ColorSpaces.SRGB, renderIntent: [RenderIntent](../../../colors-core/colors-core/com.chrynan.colors.space/-render-intent/index.md) = RenderIntent.PERCEPTUAL): CSSColorValue<br>Converts this [Color](../../../colors-core/colors-core/com.chrynan.colors/-color/index.md) to a CSSColorValue so that it can be used with compose-web components. |

## Properties

| Name | Summary |
|---|---|
| [LocalColors](-local-colors.md) | [common]<br>val [LocalColors](-local-colors.md): ProvidableCompositionLocal&lt;[Colors](../../../colors-theme/colors-theme/com.chrynan.colors.theme/-colors/index.md)&gt;<br>A ProvidableCompositionLocal of the [Colors](../../../colors-theme/colors-theme/com.chrynan.colors.theme/-colors/index.md) interface. |
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//[colors-compose-web](../../index.md)/[com.chrynan.colors.compose.web](index.md)/[isSystemInDarkTheme](is-system-in-dark-theme.md)

# isSystemInDarkTheme

[common]\

@Composable

@ReadOnlyComposable

fun [isSystemInDarkTheme](is-system-in-dark-theme.md)(): [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)

Determines whether the current system theme is set to dark mode.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//[colors-compose-web](../../index.md)/[com.chrynan.colors.compose.web](index.md)/[systemBasedColors](system-based-colors.md)

# systemBasedColors

[common]\

@Composable

fun [LightDarkColorTheme](../../../colors-theme/colors-theme/com.chrynan.colors.theme/-light-dark-color-theme/index.md).[systemBasedColors](system-based-colors.md)(): [Colors](../../../colors-theme/colors-theme/com.chrynan.colors.theme/-colors/index.md)

Obtains the appropriate [Colors](../../../colors-theme/colors-theme/com.chrynan.colors.theme/-colors/index.md) instance of this [LightDarkColorTheme](../../../colors-theme/colors-theme/com.chrynan.colors.theme/-light-dark-color-theme/index.md) depending on the result of the [isSystemInDarkTheme](is-system-in-dark-theme.md) function. If [isSystemInDarkTheme](is-system-in-dark-theme.md) returns true, then the [LightDarkColorTheme.dark](../../../colors-theme/colors-theme/com.chrynan.colors.theme/-colors/index.md) will be returned. Otherwise, the [LightDarkColorTheme.light](../../../colors-theme/colors-theme/com.chrynan.colors.theme/-colors/index.md) will be returned.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//[colors-compose-web](../../index.md)/[com.chrynan.colors.compose.web](index.md)/[toCSSColorValue](to-c-s-s-color-value.md)

# toCSSColorValue

[js]\
fun [Color](../../../colors-core/colors-core/com.chrynan.colors/-color/index.md).[toCSSColorValue](to-c-s-s-color-value.md)(destinationColorSpace: [ColorSpace](../../../colors-core/colors-core/com.chrynan.colors.space/-color-space/index.md) = ColorSpaces.SRGB, renderIntent: [RenderIntent](../../../colors-core/colors-core/com.chrynan.colors.space/-render-intent/index.md) = RenderIntent.PERCEPTUAL): CSSColorValue

Converts this [Color](../../../colors-core/colors-core/com.chrynan.colors/-color/index.md) to a CSSColorValue so that it can be used with compose-web components.

Note that this [Color](../../../colors-core/colors-core/com.chrynan.colors/-color/index.md) will first be converted to an [RgbaColor](../../../colors-core/colors-core/com.chrynan.colors/-rgba-color/index.md) so that it can be easily converted to a CSSColorValue.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//[colors-compose-web](../../index.md)/[com.chrynan.colors.compose.web](index.md)/[toComposeColor](to-compose-color.md)

# toComposeColor

[common, js]\
[common]\
expect fun [Color](../../../colors-core/colors-core/com.chrynan.colors/-color/index.md).[toComposeColor](to-compose-color.md)(): [ComposeColor](-compose-color/index.md)

[js]\
actual fun [Color](../../../colors-core/colors-core/com.chrynan.colors/-color/index.md).[toComposeColor](to-compose-color.md)(): [ComposeColor](-compose-color/index.md)
2 changes: 1 addition & 1 deletion docs/colors-compose-web/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@

| Name |
|---|
| [com.chrynan.compose.web](colors-compose-web/com.chrynan.compose.web/index.md) |
| [com.chrynan.colors.compose.web](colors-compose-web/com.chrynan.colors.compose.web/index.md) |
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
# BRADFORD

[common]\
[BRADFORD](index.md)(transform, floatArrayOf(
[BRADFORD](index.md)(floatArrayOf(
0.8951f, -0.7502f, 0.0389f,
0.2664f, 1.7135f, -0.0685f,
-0.1614f, 0.0367f, 1.0296f
), typeName, "bradford")
), "bradford")

Bradford chromatic adaptation transform, as defined in the CIECAM97s color appearance model.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
# CIECAT02

[common]\
[CIECAT02](index.md)(transform, floatArrayOf(
[CIECAT02](index.md)(floatArrayOf(
0.7328f, -0.7036f, 0.0030f,
0.4296f, 1.6975f, 0.0136f,
-0.1624f, 0.0061f, 0.9834f
), typeName, "ciecat02")
), "ciecat02")

CIECAT02 chromatic adaption transform, as defined in the CIECAM02 color appearance model.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
# VON_KRIES

[common]\
[VON_KRIES](index.md)(transform, floatArrayOf(
[VON_KRIES](index.md)(floatArrayOf(
0.40024f, -0.22630f, 0.00000f,
0.70760f, 1.16532f, 0.00000f,
-0.08081f, 0.04570f, 0.91822f
), typeName, "von_kries")
), "von_kries")

von Kries chromatic adaptation transform.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ common

| | |
|---|---|
| [CIECAT02](-c-i-e-c-a-t02/index.md) | [common]<br>[CIECAT02](-c-i-e-c-a-t02/index.md)(transform, floatArrayOf( 0.7328f, -0.7036f, 0.0030f, 0.4296f, 1.6975f, 0.0136f, -0.1624f, 0.0061f, 0.9834f ), typeName, "ciecat02")<br>CIECAT02 chromatic adaption transform, as defined in the CIECAM02 color appearance model. |
| [VON_KRIES](-v-o-n_-k-r-i-e-s/index.md) | [common]<br>[VON_KRIES](-v-o-n_-k-r-i-e-s/index.md)(transform, floatArrayOf( 0.40024f, -0.22630f, 0.00000f, 0.70760f, 1.16532f, 0.00000f, -0.08081f, 0.04570f, 0.91822f ), typeName, "von_kries")<br>von Kries chromatic adaptation transform. |
| [BRADFORD](-b-r-a-d-f-o-r-d/index.md) | [common]<br>[BRADFORD](-b-r-a-d-f-o-r-d/index.md)(transform, floatArrayOf( 0.8951f, -0.7502f, 0.0389f, 0.2664f, 1.7135f, -0.0685f, -0.1614f, 0.0367f, 1.0296f ), typeName, "bradford")<br>Bradford chromatic adaptation transform, as defined in the CIECAM97s color appearance model. |
| [CIECAT02](-c-i-e-c-a-t02/index.md) | [common]<br>[CIECAT02](-c-i-e-c-a-t02/index.md)(floatArrayOf( 0.7328f, -0.7036f, 0.0030f, 0.4296f, 1.6975f, 0.0136f, -0.1624f, 0.0061f, 0.9834f ), "ciecat02")<br>CIECAT02 chromatic adaption transform, as defined in the CIECAM02 color appearance model. |
| [VON_KRIES](-v-o-n_-k-r-i-e-s/index.md) | [common]<br>[VON_KRIES](-v-o-n_-k-r-i-e-s/index.md)(floatArrayOf( 0.40024f, -0.22630f, 0.00000f, 0.70760f, 1.16532f, 0.00000f, -0.08081f, 0.04570f, 0.91822f ), "von_kries")<br>von Kries chromatic adaptation transform. |
| [BRADFORD](-b-r-a-d-f-o-r-d/index.md) | [common]<br>[BRADFORD](-b-r-a-d-f-o-r-d/index.md)(floatArrayOf( 0.8951f, -0.7502f, 0.0389f, 0.2664f, 1.7135f, -0.0685f, -0.1614f, 0.0367f, 1.0296f ), "bradford")<br>Bradford chromatic adaptation transform, as defined in the CIECAM97s color appearance model. |

## Types

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# CMYK

[common]\
[CMYK](index.md)(componentCount, 4, typeName, "cmyk")
[CMYK](index.md)(4, "cmyk")

The CMYK model is a color model with 4 components that refer to four inks used in color printing: cyan, magenta, yellow and black (or key). CMYK is a subtractive color model.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# LAB

[common]\
[LAB](index.md)(componentCount, 3, typeName, "lab")
[LAB](index.md)(3, "lab")

The Lab model is a color model with 3 components used to describe a color space that is more perceptually uniform than XYZ.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# RGB

[common]\
[RGB](index.md)(componentCount, 3, typeName, "rgb")
[RGB](index.md)(3, "rgb")

The RGB model is a color model with 3 components that refer to the three additive primiaries: red, green and blue.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# XYZ

[common]\
[XYZ](index.md)(componentCount, 3, typeName, "xyz")
[XYZ](index.md)(3, "xyz")

The XYZ model is a color model with 3 components that are used to model human color vision on a basic sensory level.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ A color model is required by a [ColorSpace](../-color-space/index.md) to describ

| | |
|---|---|
| [CMYK](-c-m-y-k/index.md) | [common]<br>[CMYK](-c-m-y-k/index.md)(componentCount, 4, typeName, "cmyk")<br>The CMYK model is a color model with 4 components that refer to four inks used in color printing: cyan, magenta, yellow and black (or key). CMYK is a subtractive color model. |
| [LAB](-l-a-b/index.md) | [common]<br>[LAB](-l-a-b/index.md)(componentCount, 3, typeName, "lab")<br>The Lab model is a color model with 3 components used to describe a color space that is more perceptually uniform than XYZ. |
| [XYZ](-x-y-z/index.md) | [common]<br>[XYZ](-x-y-z/index.md)(componentCount, 3, typeName, "xyz")<br>The XYZ model is a color model with 3 components that are used to model human color vision on a basic sensory level. |
| [RGB](-r-g-b/index.md) | [common]<br>[RGB](-r-g-b/index.md)(componentCount, 3, typeName, "rgb")<br>The RGB model is a color model with 3 components that refer to the three additive primiaries: red, green and blue. |
| [CMYK](-c-m-y-k/index.md) | [common]<br>[CMYK](-c-m-y-k/index.md)(4, "cmyk")<br>The CMYK model is a color model with 4 components that refer to four inks used in color printing: cyan, magenta, yellow and black (or key). CMYK is a subtractive color model. |
| [LAB](-l-a-b/index.md) | [common]<br>[LAB](-l-a-b/index.md)(3, "lab")<br>The Lab model is a color model with 3 components used to describe a color space that is more perceptually uniform than XYZ. |
| [XYZ](-x-y-z/index.md) | [common]<br>[XYZ](-x-y-z/index.md)(3, "xyz")<br>The XYZ model is a color model with 3 components that are used to model human color vision on a basic sensory level. |
| [RGB](-r-g-b/index.md) | [common]<br>[RGB](-r-g-b/index.md)(3, "rgb")<br>The RGB model is a color model with 3 components that refer to the three additive primiaries: red, green and blue. |

## Types

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,24 @@ Indicates whether this color space is the sRGB color space or equivalent to the

A color space is considered sRGB if it meets all the following conditions:

<ul><li>Its color model is [ColorModel.RGB](../-color-model/-r-g-b/index.md).</li><li></li></ul>
-
Its color model is [ColorModel.RGB](../-color-model/-r-g-b/index.md).
-

Its primaries are within 1e-3 of the true [sRGB](../-color-spaces/-s-r-g-b.md) primaries.

<ul><li></li></ul>
-

Its white point is within 1e-3 of the CIE standard illuminant [D65](../-illuminant/-d65.md).

<ul><li>Its opto-electronic transfer function is not linear.</li><li>Its electro-optical transfer function is not linear.</li><li>Its transfer functions yield values within 1e-3 of [ColorSpaces.SRGB](../-color-spaces/-s-r-g-b.md).</li><li>Its range is [0..1].</li></ul>
-
Its opto-electronic transfer function is not linear.
-
Its electro-optical transfer function is not linear.
-
Its transfer functions yield values within 1e-3 of [ColorSpaces.SRGB](../-color-spaces/-s-r-g-b.md).
-
Its range is [0..1].

This method always returns true for [ColorSpaces.SRGB](../-color-spaces/-s-r-g-b.md).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# ABSOLUTE

[common]\
[ABSOLUTE](index.md)(typeName, "absolute")
[ABSOLUTE](index.md)("absolute")

Colors that are in the destination gamut are left unchanged. Colors that fall outside of the destination gamut are mapped to the closest possible color within the gamut of the destination color space (they are clipped).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# PERCEPTUAL

[common]\
[PERCEPTUAL](index.md)(typeName, "perceptual")
[PERCEPTUAL](index.md)("perceptual")

Compresses the source gamut into the destination gamut. This render intent affects all colors, inside and outside of destination gamut. The goal of this render intent is to preserve the visual relationship between colors.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# RELATIVE

[common]\
[RELATIVE](index.md)(typeName, "relative")
[RELATIVE](index.md)("relative")

Similar to the [ABSOLUTE](../-a-b-s-o-l-u-t-e/index.md) render intent, this render intent matches the closest color in the destination gamut but makes adjustments for the destination white point.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# SATURATION

[common]\
[SATURATION](index.md)(typeName, "saturation")
[SATURATION](index.md)("saturation")

Attempts to maintain the relative saturation of colors from the source gamut to the destination gamut, to keep highly saturated colors as saturated as possible.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ common

| | |
|---|---|
| [ABSOLUTE](-a-b-s-o-l-u-t-e/index.md) | [common]<br>[ABSOLUTE](-a-b-s-o-l-u-t-e/index.md)(typeName, "absolute")<br>Colors that are in the destination gamut are left unchanged. Colors that fall outside of the destination gamut are mapped to the closest possible color within the gamut of the destination color space (they are clipped). |
| [SATURATION](-s-a-t-u-r-a-t-i-o-n/index.md) | [common]<br>[SATURATION](-s-a-t-u-r-a-t-i-o-n/index.md)(typeName, "saturation")<br>Attempts to maintain the relative saturation of colors from the source gamut to the destination gamut, to keep highly saturated colors as saturated as possible. |
| [RELATIVE](-r-e-l-a-t-i-v-e/index.md) | [common]<br>[RELATIVE](-r-e-l-a-t-i-v-e/index.md)(typeName, "relative")<br>Similar to the [ABSOLUTE](-a-b-s-o-l-u-t-e/index.md) render intent, this render intent matches the closest color in the destination gamut but makes adjustments for the destination white point. |
| [PERCEPTUAL](-p-e-r-c-e-p-t-u-a-l/index.md) | [common]<br>[PERCEPTUAL](-p-e-r-c-e-p-t-u-a-l/index.md)(typeName, "perceptual")<br>Compresses the source gamut into the destination gamut. This render intent affects all colors, inside and outside of destination gamut. The goal of this render intent is to preserve the visual relationship between colors. |
| [ABSOLUTE](-a-b-s-o-l-u-t-e/index.md) | [common]<br>[ABSOLUTE](-a-b-s-o-l-u-t-e/index.md)("absolute")<br>Colors that are in the destination gamut are left unchanged. Colors that fall outside of the destination gamut are mapped to the closest possible color within the gamut of the destination color space (they are clipped). |
| [SATURATION](-s-a-t-u-r-a-t-i-o-n/index.md) | [common]<br>[SATURATION](-s-a-t-u-r-a-t-i-o-n/index.md)("saturation")<br>Attempts to maintain the relative saturation of colors from the source gamut to the destination gamut, to keep highly saturated colors as saturated as possible. |
| [RELATIVE](-r-e-l-a-t-i-v-e/index.md) | [common]<br>[RELATIVE](-r-e-l-a-t-i-v-e/index.md)("relative")<br>Similar to the [ABSOLUTE](-a-b-s-o-l-u-t-e/index.md) render intent, this render intent matches the closest color in the destination gamut but makes adjustments for the destination white point. |
| [PERCEPTUAL](-p-e-r-c-e-p-t-u-a-l/index.md) | [common]<br>[PERCEPTUAL](-p-e-r-c-e-p-t-u-a-l/index.md)("perceptual")<br>Compresses the source gamut into the destination gamut. This render intent affects all colors, inside and outside of destination gamut. The goal of this render intent is to preserve the visual relationship between colors. |

## Types

Expand Down
Loading

0 comments on commit 9a2204b

Please sign in to comment.