Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new wasm-based website #58

Merged
merged 9 commits into from
Mar 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ jobs:
- name: Dokka
uses: gradle/actions/setup-gradle@v3
with:
arguments: dokkaHtml jsBrowserDistribution
arguments: dokkaHtml :website:wasmJsBrowserDistribution
- run: ./prepare_docs.sh
- name: Build mkdocs
run: |
pip install mkdocs-material
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ captures/
.externalNativeBuild
out/
docs/api/
docs/tryit/
docs/changelog.md
docs/index.md
site/
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@
## Unreleased
### Added
- Publish artifacts for the `JS` and `wasmJs` targets for the jetpack-compose extensions.
- Added support to `formatCssString` and `Color.parse` for color spaces added in recent updates to the CSS color spec: `oklab`, `oklch`, `srgb-linear`, `xyz-d50` and `xyz-d65`.
- Added `customColorSpaces` for `Color.parse` and `Color.formatCssString` to allow non-standard color spaces to be used in color strings.

### Changed
- `Color.parse` now parses `lch()` and `lab()` functions with the with D50 white points instead of D65 in order to comply with the CSS color spec.

### Fixed
- `ColorSpace.equals` will now properly return true when comparing color companions with the space they represent e.g. `XYZ == XYZ65`
- Support the CSS "none" keyword for `NaN` values in `Color.parse` and `Color.formatCssString`

## 3.4.0
### Added
Expand Down
8 changes: 3 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,23 @@ plugins {
alias(libs.plugins.android.library).apply(false)
alias(libs.plugins.dokka).apply(false)
alias(libs.plugins.publish).apply(false)
alias(libs.plugins.compose).apply(false)
alias(libs.plugins.jetbrainsCompose).apply(false)
alias(libs.plugins.kotlinBinaryCompatibilityValidator)
}

apiValidation {
// https://github.com/Kotlin/binary-compatibility-validator/issues/3
project("scripts").subprojects.mapTo(ignoredProjects) { it.name }
project("test").subprojects.mapTo(ignoredProjects) { it.name }
project("website").subprojects.mapTo(ignoredProjects) { it.name }
ignoredProjects.add("website")
}


fun getPublishVersion(): String {
val versionName = project.property("VERSION_NAME") as String

// Call gradle with -PinferVersion to set the dynamic version name.
// Call gradle with -PsnapshotVersion to set the version as a snapshot.
// Otherwise, we skip it to save time.
if (!project.hasProperty("snapshotVersion")) return versionName

val buildNumber = System.getenv("GITHUB_RUN_NUMBER") ?: "0"
return "$versionName.$buildNumber-SNAPSHOT"
}
Expand Down
31 changes: 28 additions & 3 deletions colormath/api/colormath.api
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,25 @@ public abstract interface class com/github/ajalt/colormath/ColorSpace {

public final class com/github/ajalt/colormath/CssParseKt {
public static final fun parse (Lcom/github/ajalt/colormath/Color$Companion;Ljava/lang/String;)Lcom/github/ajalt/colormath/Color;
public static final fun parse (Lcom/github/ajalt/colormath/Color$Companion;Ljava/lang/String;Ljava/util/Map;)Lcom/github/ajalt/colormath/Color;
public static synthetic fun parse$default (Lcom/github/ajalt/colormath/Color$Companion;Ljava/lang/String;Ljava/util/Map;ILjava/lang/Object;)Lcom/github/ajalt/colormath/Color;
public static final fun parseOrNull (Lcom/github/ajalt/colormath/Color$Companion;Ljava/lang/String;)Lcom/github/ajalt/colormath/Color;
public static final fun parseOrNull (Lcom/github/ajalt/colormath/Color$Companion;Ljava/lang/String;Ljava/util/Map;)Lcom/github/ajalt/colormath/Color;
public static synthetic fun parseOrNull$default (Lcom/github/ajalt/colormath/Color$Companion;Ljava/lang/String;Ljava/util/Map;ILjava/lang/Object;)Lcom/github/ajalt/colormath/Color;
}

public final class com/github/ajalt/colormath/CssRenderKt {
public static final fun formatCssString (Lcom/github/ajalt/colormath/Color;)Ljava/lang/String;
public static final fun formatCssString (Lcom/github/ajalt/colormath/Color;Lcom/github/ajalt/colormath/AngleUnit;)Ljava/lang/String;
public static final fun formatCssString (Lcom/github/ajalt/colormath/Color;Lcom/github/ajalt/colormath/AngleUnit;Lcom/github/ajalt/colormath/RenderCondition;)Ljava/lang/String;
public static final fun formatCssString (Lcom/github/ajalt/colormath/Color;Lcom/github/ajalt/colormath/AngleUnit;Lcom/github/ajalt/colormath/RenderCondition;Z)Ljava/lang/String;
public static final fun formatCssString (Lcom/github/ajalt/colormath/Color;Lcom/github/ajalt/colormath/AngleUnit;Lcom/github/ajalt/colormath/RenderCondition;ZZ)Ljava/lang/String;
public static final fun formatCssString (Lcom/github/ajalt/colormath/Color;Lcom/github/ajalt/colormath/AngleUnit;Lcom/github/ajalt/colormath/RenderCondition;ZZZ)Ljava/lang/String;
public static final fun formatCssString (Lcom/github/ajalt/colormath/Color;Lcom/github/ajalt/colormath/AngleUnit;Lcom/github/ajalt/colormath/RenderCondition;ZZZZ)Ljava/lang/String;
public static synthetic fun formatCssString$default (Lcom/github/ajalt/colormath/Color;Lcom/github/ajalt/colormath/AngleUnit;Lcom/github/ajalt/colormath/RenderCondition;ZZZZILjava/lang/Object;)Ljava/lang/String;
public static final fun formatCssStringOrNull (Lcom/github/ajalt/colormath/Color;Lcom/github/ajalt/colormath/AngleUnit;Lcom/github/ajalt/colormath/RenderCondition;ZZZZ)Ljava/lang/String;
public static synthetic fun formatCssStringOrNull$default (Lcom/github/ajalt/colormath/Color;Lcom/github/ajalt/colormath/AngleUnit;Lcom/github/ajalt/colormath/RenderCondition;ZZZZILjava/lang/Object;)Ljava/lang/String;
public static final fun formatCssString (Lcom/github/ajalt/colormath/Color;Lcom/github/ajalt/colormath/AngleUnit;Lcom/github/ajalt/colormath/RenderCondition;ZZZZLjava/util/Map;)Ljava/lang/String;
public static synthetic fun formatCssString$default (Lcom/github/ajalt/colormath/Color;Lcom/github/ajalt/colormath/AngleUnit;Lcom/github/ajalt/colormath/RenderCondition;ZZZZLjava/util/Map;ILjava/lang/Object;)Ljava/lang/String;
public static final fun formatCssStringOrNull (Lcom/github/ajalt/colormath/Color;Lcom/github/ajalt/colormath/AngleUnit;Lcom/github/ajalt/colormath/RenderCondition;ZZZZLjava/util/Map;)Ljava/lang/String;
public static synthetic fun formatCssStringOrNull$default (Lcom/github/ajalt/colormath/Color;Lcom/github/ajalt/colormath/AngleUnit;Lcom/github/ajalt/colormath/RenderCondition;ZZZZLjava/util/Map;ILjava/lang/Object;)Ljava/lang/String;
}

public abstract interface class com/github/ajalt/colormath/HueColor : com/github/ajalt/colormath/Color {
Expand Down Expand Up @@ -776,9 +787,11 @@ public final class com/github/ajalt/colormath/model/LAB$Companion : com/github/a
public fun convert (Lcom/github/ajalt/colormath/Color;)Lcom/github/ajalt/colormath/model/LAB;
public synthetic fun create ([F)Lcom/github/ajalt/colormath/Color;
public fun create ([F)Lcom/github/ajalt/colormath/model/LAB;
public fun equals (Ljava/lang/Object;)Z
public fun getComponents ()Ljava/util/List;
public fun getName ()Ljava/lang/String;
public fun getWhitePoint ()Lcom/github/ajalt/colormath/WhitePoint;
public fun hashCode ()I
public fun invoke (FFFF)Lcom/github/ajalt/colormath/model/LAB;
public fun invoke (Ljava/lang/Number;Ljava/lang/Number;Ljava/lang/Number;Ljava/lang/Number;)Lcom/github/ajalt/colormath/model/LAB;
}
Expand Down Expand Up @@ -849,9 +862,11 @@ public final class com/github/ajalt/colormath/model/LCHab$Companion : com/github
public fun convert (Lcom/github/ajalt/colormath/Color;)Lcom/github/ajalt/colormath/model/LCHab;
public synthetic fun create ([F)Lcom/github/ajalt/colormath/Color;
public fun create ([F)Lcom/github/ajalt/colormath/model/LCHab;
public fun equals (Ljava/lang/Object;)Z
public fun getComponents ()Ljava/util/List;
public fun getName ()Ljava/lang/String;
public fun getWhitePoint ()Lcom/github/ajalt/colormath/WhitePoint;
public fun hashCode ()I
public fun invoke (FFFF)Lcom/github/ajalt/colormath/model/LCHab;
public fun invoke (Ljava/lang/Number;Ljava/lang/Number;Ljava/lang/Number;Ljava/lang/Number;)Lcom/github/ajalt/colormath/model/LCHab;
}
Expand Down Expand Up @@ -922,9 +937,11 @@ public final class com/github/ajalt/colormath/model/LCHuv$Companion : com/github
public fun convert (Lcom/github/ajalt/colormath/Color;)Lcom/github/ajalt/colormath/model/LCHuv;
public synthetic fun create ([F)Lcom/github/ajalt/colormath/Color;
public fun create ([F)Lcom/github/ajalt/colormath/model/LCHuv;
public fun equals (Ljava/lang/Object;)Z
public fun getComponents ()Ljava/util/List;
public fun getName ()Ljava/lang/String;
public fun getWhitePoint ()Lcom/github/ajalt/colormath/WhitePoint;
public fun hashCode ()I
public fun invoke (FFFF)Lcom/github/ajalt/colormath/model/LCHuv;
public fun invoke (Ljava/lang/Number;Ljava/lang/Number;Ljava/lang/Number;Ljava/lang/Number;)Lcom/github/ajalt/colormath/model/LCHuv;
}
Expand Down Expand Up @@ -995,9 +1012,11 @@ public final class com/github/ajalt/colormath/model/LUV$Companion : com/github/a
public fun convert (Lcom/github/ajalt/colormath/Color;)Lcom/github/ajalt/colormath/model/LUV;
public synthetic fun create ([F)Lcom/github/ajalt/colormath/Color;
public fun create ([F)Lcom/github/ajalt/colormath/model/LUV;
public fun equals (Ljava/lang/Object;)Z
public fun getComponents ()Ljava/util/List;
public fun getName ()Ljava/lang/String;
public fun getWhitePoint ()Lcom/github/ajalt/colormath/WhitePoint;
public fun hashCode ()I
public fun invoke (FFFF)Lcom/github/ajalt/colormath/model/LUV;
public fun invoke (Ljava/lang/Number;Ljava/lang/Number;Ljava/lang/Number;Ljava/lang/Number;)Lcom/github/ajalt/colormath/model/LUV;
}
Expand Down Expand Up @@ -1179,6 +1198,7 @@ public final class com/github/ajalt/colormath/model/RGB$Companion : com/github/a
public fun convert (Lcom/github/ajalt/colormath/Color;)Lcom/github/ajalt/colormath/model/RGB;
public synthetic fun create ([F)Lcom/github/ajalt/colormath/Color;
public fun create ([F)Lcom/github/ajalt/colormath/model/RGB;
public fun equals (Ljava/lang/Object;)Z
public fun from255 (IIII)Lcom/github/ajalt/colormath/model/RGB;
public fun getComponents ()Ljava/util/List;
public fun getMatrixFromXyz ()[F
Expand All @@ -1187,6 +1207,7 @@ public final class com/github/ajalt/colormath/model/RGB$Companion : com/github/a
public fun getTransferFunctions ()Lcom/github/ajalt/colormath/model/RGBColorSpace$TransferFunctions;
public fun getWhitePoint ()Lcom/github/ajalt/colormath/WhitePoint;
public fun grey (Ljava/lang/Number;Ljava/lang/Number;)Lcom/github/ajalt/colormath/model/RGB;
public fun hashCode ()I
public fun invoke (FFFF)Lcom/github/ajalt/colormath/model/RGB;
public fun invoke (Ljava/lang/Number;Ljava/lang/Number;Ljava/lang/Number;Ljava/lang/Number;)Lcom/github/ajalt/colormath/model/RGB;
public fun invoke (Ljava/lang/String;)Lcom/github/ajalt/colormath/model/RGB;
Expand Down Expand Up @@ -1351,6 +1372,7 @@ public final class com/github/ajalt/colormath/model/SRGB : com/github/ajalt/colo
public fun convert (Lcom/github/ajalt/colormath/Color;)Lcom/github/ajalt/colormath/model/RGB;
public synthetic fun create ([F)Lcom/github/ajalt/colormath/Color;
public fun create ([F)Lcom/github/ajalt/colormath/model/RGB;
public fun equals (Ljava/lang/Object;)Z
public fun from255 (IIII)Lcom/github/ajalt/colormath/model/RGB;
public fun getComponents ()Ljava/util/List;
public fun getMatrixFromXyz ()[F
Expand All @@ -1359,6 +1381,7 @@ public final class com/github/ajalt/colormath/model/SRGB : com/github/ajalt/colo
public fun getTransferFunctions ()Lcom/github/ajalt/colormath/model/RGBColorSpace$TransferFunctions;
public fun getWhitePoint ()Lcom/github/ajalt/colormath/WhitePoint;
public fun grey (Ljava/lang/Number;Ljava/lang/Number;)Lcom/github/ajalt/colormath/model/RGB;
public fun hashCode ()I
public fun invoke (FFFF)Lcom/github/ajalt/colormath/model/RGB;
public fun invoke (Ljava/lang/Number;Ljava/lang/Number;Ljava/lang/Number;Ljava/lang/Number;)Lcom/github/ajalt/colormath/model/RGB;
public fun invoke (Ljava/lang/String;)Lcom/github/ajalt/colormath/model/RGB;
Expand Down Expand Up @@ -1415,9 +1438,11 @@ public final class com/github/ajalt/colormath/model/XYZ$Companion : com/github/a
public fun convert (Lcom/github/ajalt/colormath/Color;)Lcom/github/ajalt/colormath/model/XYZ;
public synthetic fun create ([F)Lcom/github/ajalt/colormath/Color;
public fun create ([F)Lcom/github/ajalt/colormath/model/XYZ;
public fun equals (Ljava/lang/Object;)Z
public fun getComponents ()Ljava/util/List;
public fun getName ()Ljava/lang/String;
public fun getWhitePoint ()Lcom/github/ajalt/colormath/WhitePoint;
public fun hashCode ()I
public fun invoke (FFFF)Lcom/github/ajalt/colormath/model/XYZ;
public fun invoke (Ljava/lang/Number;Ljava/lang/Number;Ljava/lang/Number;Ljava/lang/Number;)Lcom/github/ajalt/colormath/model/XYZ;
}
Expand Down
Loading