From 25de593840b8bc8978cda7263478807fe14b90d1 Mon Sep 17 00:00:00 2001 From: AJ Date: Sat, 4 Jan 2025 09:59:18 -0800 Subject: [PATCH] Make all color class constructors public --- CHANGELOG.md | 3 ++- build.gradle.kts | 1 + colormath/api/colormath.api | 6 ++++++ .../com/github/ajalt/colormath/CssParse.kt | 1 - .../ajalt/colormath/internal/InternalMath.kt | 3 ++- .../github/ajalt/colormath/internal/Matrix.kt | 19 +++++++++++------ .../com/github/ajalt/colormath/model/LAB.kt | 2 +- .../com/github/ajalt/colormath/model/LCHab.kt | 2 +- .../com/github/ajalt/colormath/model/LCHuv.kt | 2 +- .../com/github/ajalt/colormath/model/LUV.kt | 2 +- .../com/github/ajalt/colormath/model/Oklch.kt | 2 +- .../com/github/ajalt/colormath/model/RGB.kt | 2 +- .../com/github/ajalt/colormath/model/XYZ.kt | 2 +- .../colormath/transform/ChromaticAdapter.kt | 13 ++++++++++-- .../colormath/transform/EasingFunctions.kt | 2 ++ .../colormath/transform/HueAdjustments.kt | 19 +++++++++-------- .../transform/InterpolationMethod.kt | 21 ++++++++++++------- .../github/ajalt/colormath/transform/Mix.kt | 6 +++++- .../colormath/transform/RGBToRGBConverter.kt | 3 ++- gradle/libs.versions.toml | 2 +- .../github/ajalt/colormath/model/LABTest.kt | 5 +---- 21 files changed, 77 insertions(+), 41 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8dfd2a0b..2a13ee15 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,8 @@ ## Unreleased ### Changed -- `HSV.toSRGB()` with NaN a hue value now returns a greyscale `RGB` color instead of a NaN color. ([#67](https://github.com/ajalt/colormath/issues/67)) +- All color class constructors are now public to avoid warning when using `copy()` ([#65](https://github.com/ajalt/colormath/issues/65)) +- `HSV.toSRGB()` with NaN a hue value now returns a greyscale `RGB` color instead of a NaN color. ([#67](https://github.com/ajalt/colormath/issues/67)) - Update Kotlin to 2.1.0 ## 3.6.0 diff --git a/build.gradle.kts b/build.gradle.kts index 0c0e1c00..d2206476 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -22,6 +22,7 @@ apiValidation { project("scripts").subprojects.mapTo(ignoredProjects) { it.name } project("test").subprojects.mapTo(ignoredProjects) { it.name } ignoredProjects.add("website") + ignoredProjects.add("test") } diff --git a/colormath/api/colormath.api b/colormath/api/colormath.api index ad2174cf..140b299b 100644 --- a/colormath/api/colormath.api +++ b/colormath/api/colormath.api @@ -769,6 +769,7 @@ public final class com/github/ajalt/colormath/model/JzCzHz$Companion : com/githu public final class com/github/ajalt/colormath/model/LAB : com/github/ajalt/colormath/Color { public static final field Companion Lcom/github/ajalt/colormath/model/LAB$Companion; + public fun (FFFFLcom/github/ajalt/colormath/model/LABColorSpace;)V public synthetic fun clamp ()Lcom/github/ajalt/colormath/Color; public fun clamp ()Lcom/github/ajalt/colormath/model/LAB; public final fun component1 ()F @@ -846,6 +847,7 @@ public final class com/github/ajalt/colormath/model/LABKt { public final class com/github/ajalt/colormath/model/LCHab : com/github/ajalt/colormath/HueColor { public static final field Companion Lcom/github/ajalt/colormath/model/LCHab$Companion; + public fun (FFFFLcom/github/ajalt/colormath/model/LCHabColorSpace;)V public synthetic fun clamp ()Lcom/github/ajalt/colormath/Color; public fun clamp ()Lcom/github/ajalt/colormath/model/LCHab; public final fun component1 ()F @@ -923,6 +925,7 @@ public final class com/github/ajalt/colormath/model/LCHabKt { public final class com/github/ajalt/colormath/model/LCHuv : com/github/ajalt/colormath/HueColor { public static final field Companion Lcom/github/ajalt/colormath/model/LCHuv$Companion; + public fun (FFFFLcom/github/ajalt/colormath/model/LCHuvColorSpace;)V public synthetic fun clamp ()Lcom/github/ajalt/colormath/Color; public fun clamp ()Lcom/github/ajalt/colormath/model/LCHuv; public final fun component1 ()F @@ -1000,6 +1003,7 @@ public final class com/github/ajalt/colormath/model/LCHuvKt { public final class com/github/ajalt/colormath/model/LUV : com/github/ajalt/colormath/Color { public static final field Companion Lcom/github/ajalt/colormath/model/LUV$Companion; + public fun (FFFFLcom/github/ajalt/colormath/model/LUVColorSpace;)V public synthetic fun clamp ()Lcom/github/ajalt/colormath/Color; public fun clamp ()Lcom/github/ajalt/colormath/model/LUV; public final fun component1 ()F @@ -1183,6 +1187,7 @@ public final class com/github/ajalt/colormath/model/Oklch$Companion : com/github public final class com/github/ajalt/colormath/model/RGB : com/github/ajalt/colormath/Color { public static final field Companion Lcom/github/ajalt/colormath/model/RGB$Companion; + public fun (FFFFLcom/github/ajalt/colormath/model/RGBColorSpace;)V public synthetic fun clamp ()Lcom/github/ajalt/colormath/Color; public fun clamp ()Lcom/github/ajalt/colormath/model/RGB; public final fun component1 ()F @@ -1431,6 +1436,7 @@ public final class com/github/ajalt/colormath/model/SRGB : com/github/ajalt/colo public final class com/github/ajalt/colormath/model/XYZ : com/github/ajalt/colormath/Color { public static final field Companion Lcom/github/ajalt/colormath/model/XYZ$Companion; + public fun (FFFFLcom/github/ajalt/colormath/model/XYZColorSpace;)V public final fun adaptTo (Lcom/github/ajalt/colormath/model/XYZColorSpace;)Lcom/github/ajalt/colormath/model/XYZ; public final fun adaptTo (Lcom/github/ajalt/colormath/model/XYZColorSpace;[F)Lcom/github/ajalt/colormath/model/XYZ; public final fun adaptTo (Lcom/github/ajalt/colormath/model/XYZColorSpace;[F[F)Lcom/github/ajalt/colormath/model/XYZ; diff --git a/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/CssParse.kt b/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/CssParse.kt index 088df1ea..852ca311 100644 --- a/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/CssParse.kt +++ b/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/CssParse.kt @@ -12,7 +12,6 @@ import com.github.ajalt.colormath.model.RGBColorSpaces.ROMM_RGB import com.github.ajalt.colormath.model.XYZColorSpaces.XYZ50 import com.github.ajalt.colormath.model.XYZColorSpaces.XYZ65 import kotlin.jvm.JvmOverloads -import kotlin.math.roundToInt /** * Parse a string representing a CSS color value. diff --git a/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/internal/InternalMath.kt b/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/internal/InternalMath.kt index 1f6a393e..8abf9dec 100644 --- a/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/internal/InternalMath.kt +++ b/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/internal/InternalMath.kt @@ -48,7 +48,8 @@ internal fun Float.spow(p: Double): Double = toDouble().spow(p) internal fun sqrtSumSq(a: Float, b: Float, c: Float): Float = sqrt(a.pow(2) + b.pow(2) + c.pow(2)) internal fun sqrtSumSq(a: Double, b: Double): Double = sqrt(a.pow(2) + b.pow(2)) -internal fun sqrtSumSq(a: Double, b: Double, c: Double): Double = sqrt(a.pow(2) + b.pow(2) + c.pow(2)) +internal fun sqrtSumSq(a: Double, b: Double, c: Double): Double = + sqrt(a.pow(2) + b.pow(2) + c.pow(2)) internal fun scaleRange(l1: Float, r1: Float, l2: Float, r2: Float, t: Float): Float { return if (r1 == l1) t else (r2 - l2) * (t - l1) / (r1 - l1) + l2 diff --git a/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/internal/Matrix.kt b/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/internal/Matrix.kt index 73ec1758..e0768505 100644 --- a/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/internal/Matrix.kt +++ b/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/internal/Matrix.kt @@ -10,11 +10,13 @@ internal value class Matrix(val rowMajor: FloatArray) { v00: Float, v10: Float, v20: Float, v01: Float, v11: Float, v21: Float, v02: Float, v12: Float, v22: Float, - ) : this(floatArrayOf( - v00, v10, v20, - v01, v11, v21, - v02, v12, v22, - )) + ) : this( + floatArrayOf( + v00, v10, v20, + v01, v11, v21, + v02, v12, v22, + ) + ) fun copy() = Matrix(rowMajor.copyOf()) @@ -66,7 +68,12 @@ internal fun Matrix.inverse(inPlace: Boolean = false): Matrix { return out } -internal inline fun Matrix.dot(v0: Float, v1: Float, v2: Float, block: (Float, Float, Float) -> T): T { +internal inline fun Matrix.dot( + v0: Float, + v1: Float, + v2: Float, + block: (Float, Float, Float) -> T, +): T { return block( get(0, 0) * v0 + get(1, 0) * v1 + get(2, 0) * v2, get(0, 1) * v0 + get(1, 1) * v1 + get(2, 1) * v2, diff --git a/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/model/LAB.kt b/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/model/LAB.kt index a5df24e0..0f0f4f0b 100644 --- a/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/model/LAB.kt +++ b/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/model/LAB.kt @@ -63,7 +63,7 @@ object LABColorSpaces { * | a* | green-red | `[-128, 128]` | * | b* | blue-yellow | `[-128, 128]` | */ -data class LAB internal constructor( +data class LAB( val l: Float, val a: Float, val b: Float, diff --git a/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/model/LCHab.kt b/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/model/LCHab.kt index 2d58fab4..bdce40c2 100644 --- a/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/model/LCHab.kt +++ b/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/model/LCHab.kt @@ -58,7 +58,7 @@ object LCHabColorSpaces { * | c | chroma | `[0, 150]` | * | h | hue, degrees, `NaN` for monochrome colors | `[0, 360)` | */ -data class LCHab internal constructor( +data class LCHab( val l: Float, val c: Float, override val h: Float, diff --git a/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/model/LCHuv.kt b/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/model/LCHuv.kt index 65eab015..aa62da09 100644 --- a/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/model/LCHuv.kt +++ b/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/model/LCHuv.kt @@ -52,7 +52,7 @@ object LCHuvColorSpaces { * | [c] | chroma | `[0, 100]` | * | [h] | hue, degrees, `NaN` for monochrome colors | `[0, 360)` | */ -data class LCHuv internal constructor( +data class LCHuv( val l: Float, val c: Float, override val h: Float, diff --git a/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/model/LUV.kt b/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/model/LUV.kt index 0c5b1733..f9d80fd7 100644 --- a/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/model/LUV.kt +++ b/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/model/LUV.kt @@ -59,7 +59,7 @@ object LUVColorSpaces { * | [u] | | `[-100, 100]` | * | [v] | | `[-100, 100]` | */ -data class LUV internal constructor( +data class LUV( val l: Float, val u: Float, val v: Float, diff --git a/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/model/Oklch.kt b/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/model/Oklch.kt index c1fbaadd..6085861c 100644 --- a/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/model/Oklch.kt +++ b/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/model/Oklch.kt @@ -4,7 +4,7 @@ import com.github.ajalt.colormath.Color import com.github.ajalt.colormath.ColorComponentInfo import com.github.ajalt.colormath.ColorSpace import com.github.ajalt.colormath.HueColor -import com.github.ajalt.colormath.internal.* +import com.github.ajalt.colormath.internal.clampTrailingHue import com.github.ajalt.colormath.internal.componentInfoList import com.github.ajalt.colormath.internal.doCreate import com.github.ajalt.colormath.internal.fromPolarModel diff --git a/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/model/RGB.kt b/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/model/RGB.kt index 2681b2c6..8e7a4b51 100644 --- a/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/model/RGB.kt +++ b/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/model/RGB.kt @@ -148,7 +148,7 @@ interface RGBColorSpace : WhitePointColorSpace { * | [g] | green | `[0, 1]` | * | [b] | blue | `[0, 1]` | */ -data class RGB internal constructor( +data class RGB( val r: Float, val g: Float, val b: Float, diff --git a/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/model/XYZ.kt b/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/model/XYZ.kt index 4428a81c..76fff113 100644 --- a/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/model/XYZ.kt +++ b/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/model/XYZ.kt @@ -57,7 +57,7 @@ object XYZColorSpaces { * | [y] | `[0, 1]` | * | [z] | `[0, 1]` | */ -data class XYZ internal constructor( +data class XYZ( val x: Float, val y: Float, val z: Float, diff --git a/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/transform/ChromaticAdapter.kt b/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/transform/ChromaticAdapter.kt index 31e67e9f..5eecd2fc 100644 --- a/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/transform/ChromaticAdapter.kt +++ b/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/transform/ChromaticAdapter.kt @@ -36,7 +36,10 @@ fun RGBInt.Companion.createChromaticAdapter(sourceWhite: xyY): ChromaticAdapterR return ChromaticAdapterRGBInt(xyzToSrgb.dot(xyzTransform).dot(srgbToXYZ)) } -class ChromaticAdapterRGB internal constructor(private val space: RGBColorSpace, private val transform: Matrix) { +class ChromaticAdapterRGB internal constructor( + private val space: RGBColorSpace, + private val transform: Matrix, +) { /** Adapt an sRGB [color] to this white point */ fun adapt(color: RGB): RGB { return doAdapt(transform, color.r, color.g, color.b) { r, g, b -> @@ -61,7 +64,13 @@ class ChromaticAdapterRGBInt internal constructor(private val transform: Matrix) } } -private inline fun doAdapt(transform: Matrix, r: Float, g: Float, b: Float, block: (Float, Float, Float) -> T): T { +private inline fun doAdapt( + transform: Matrix, + r: Float, + g: Float, + b: Float, + block: (Float, Float, Float) -> T, +): T { val f = SRGB.transferFunctions return transform.dot(f.eotf(r), f.eotf(g), f.eotf(b)) { rr, gg, bb -> block(f.oetf(rr), f.oetf(gg), f.oetf(bb)) diff --git a/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/transform/EasingFunctions.kt b/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/transform/EasingFunctions.kt index a43da3a3..0c1c8cf1 100644 --- a/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/transform/EasingFunctions.kt +++ b/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/transform/EasingFunctions.kt @@ -180,6 +180,7 @@ private class CubicBezierEasing( else -> 0.0 } } + x > 1 -> { when { x2 < 1 -> tangent(x2, y2, 1.0, 1.0, x) @@ -187,6 +188,7 @@ private class CubicBezierEasing( else -> 1.0 } } + else -> sampleCurveY(findTFromX(x)) }.toFloat() } diff --git a/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/transform/HueAdjustments.kt b/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/transform/HueAdjustments.kt index 975f2d37..db01aed0 100644 --- a/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/transform/HueAdjustments.kt +++ b/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/transform/HueAdjustments.kt @@ -31,14 +31,15 @@ object HueAdjustments { val specified: ComponentAdjustment = { it } } -private inline fun deltaAdjustment(crossinline adj: (delta: Float) -> Float): ComponentAdjustment = { hues -> - hues.toMutableList().also { h -> - h[0] = h[0].normalizeDeg() - for (i in 1..h.lastIndex) { - val hue = h[i] - val prev = h[i - 1] - if (hue.isNaN() || prev.isNaN()) continue - h[i] = prev + adj(hue.normalizeDeg() - prev.normalizeDeg()) +private inline fun deltaAdjustment(crossinline adj: (delta: Float) -> Float): ComponentAdjustment = + { hues -> + hues.toMutableList().also { h -> + h[0] = h[0].normalizeDeg() + for (i in 1..h.lastIndex) { + val hue = h[i] + val prev = h[i - 1] + if (hue.isNaN() || prev.isNaN()) continue + h[i] = prev + adj(hue.normalizeDeg() - prev.normalizeDeg()) + } } } -} diff --git a/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/transform/InterpolationMethod.kt b/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/transform/InterpolationMethod.kt index 9928c6a4..cbf12f2f 100644 --- a/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/transform/InterpolationMethod.kt +++ b/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/transform/InterpolationMethod.kt @@ -34,7 +34,8 @@ object InterpolationMethods { * Linear piecewise interpolation */ fun linear(): InterpolationMethod = object : InterpolationMethod { - override fun build(points: List): InterpolationMethod.ComponentInterpolator = LinearInterpolator(points) + override fun build(points: List): InterpolationMethod.ComponentInterpolator = + LinearInterpolator(points) } /** @@ -52,16 +53,18 @@ object InterpolationMethods { * unique parabola passing through them. By default, the boundaries are calculated by one-sided * finite differences. */ - fun monotoneSpline(parabolicEndpoints: Boolean = false): InterpolationMethod = object : InterpolationMethod { - override fun build(points: List): InterpolationMethod.ComponentInterpolator { - return if (points.size < 3) linear().build(points) - else MonotonicSplineInterpolator(points, parabolicEndpoints) + fun monotoneSpline(parabolicEndpoints: Boolean = false): InterpolationMethod = + object : InterpolationMethod { + override fun build(points: List): InterpolationMethod.ComponentInterpolator { + return if (points.size < 3) linear().build(points) + else MonotonicSplineInterpolator(points, parabolicEndpoints) + } } - } } -private class LinearInterpolator(private val points: List) : InterpolationMethod.ComponentInterpolator { +private class LinearInterpolator(private val points: List) : + InterpolationMethod.ComponentInterpolator { init { require(points.size > 1) { "At least two points are required for interpolation" } } @@ -111,8 +114,10 @@ private class MonotonicSplineInterpolator( abs(p[0]) > 2 * abs(s[0]) -> 2 * s[0] else -> p[0] } + else -> s[0] } + n -> when { parabolicEndpoints -> when { p[n] * s[n - 1] <= 0 -> 0f @@ -120,8 +125,10 @@ private class MonotonicSplineInterpolator( else -> p[n] } + else -> s[n - 1] } + else -> (sign(s[i - 1]) + sign(s[i])) * minOf(abs(s[i - 1]), abs(s[i]), abs(p[i]) / 2) } } diff --git a/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/transform/Mix.kt b/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/transform/Mix.kt index 7fe1cf4f..bc0ef0be 100644 --- a/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/transform/Mix.kt +++ b/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/transform/Mix.kt @@ -47,5 +47,9 @@ fun ColorSpace.mix( val sum = amount1.toFloat() + amount2.toFloat() require(sum != 0f) { "mix amounts cannot sum to 0" } val c = convert(color1).interpolate(color2, amount2.toFloat() / sum, true, hueAdjustment) - return if (sum < 1f) c.map { comps -> comps.also { it[it.lastIndex] = it.last().nanToOne() * sum } } else c + return if (sum < 1f) c.map { comps -> + comps.also { + it[it.lastIndex] = it.last().nanToOne() * sum + } + } else c } diff --git a/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/transform/RGBToRGBConverter.kt b/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/transform/RGBToRGBConverter.kt index 5c0e6c20..ab977271 100644 --- a/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/transform/RGBToRGBConverter.kt +++ b/colormath/src/commonMain/kotlin/com/github/ajalt/colormath/transform/RGBToRGBConverter.kt @@ -44,7 +44,8 @@ internal fun rgbToRgbMatrix(src: RGBColorSpace, dst: RGBColorSpace): Matrix { return if (src.whitePoint == dst.whitePoint) { Matrix(dst.matrixFromXyz).dot(Matrix(src.matrixToXyz)) } else { - val adaptation = XYZColorSpace(dst.whitePoint).chromaticAdaptationMatrix(src.whitePoint.chromaticity) + val adaptation = + XYZColorSpace(dst.whitePoint).chromaticAdaptationMatrix(src.whitePoint.chromaticity) Matrix(dst.matrixFromXyz).dot(adaptation).dot(Matrix(src.matrixToXyz)) } } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 3b71171a..74703af7 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -22,7 +22,7 @@ compose-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview" [plugins] dokka = "org.jetbrains.dokka:2.0.0" publish = "com.vanniktech.maven.publish:0.30.0" -kotlinBinaryCompatibilityValidator = "org.jetbrains.kotlinx.binary-compatibility-validator:0.14.0" +kotlinBinaryCompatibilityValidator = "org.jetbrains.kotlinx.binary-compatibility-validator:0.17.0" # used in extensions android-library = "com.android.library:8.7.3" diff --git a/test/src/commonTest/kotlin/com/github/ajalt/colormath/model/LABTest.kt b/test/src/commonTest/kotlin/com/github/ajalt/colormath/model/LABTest.kt index 443e0ac3..cfe1e0f2 100644 --- a/test/src/commonTest/kotlin/com/github/ajalt/colormath/model/LABTest.kt +++ b/test/src/commonTest/kotlin/com/github/ajalt/colormath/model/LABTest.kt @@ -1,13 +1,10 @@ package com.github.ajalt.colormath.model -import com.github.ajalt.colormath.companionTest -import com.github.ajalt.colormath.convertToSpaceTest +import com.github.ajalt.colormath.* import com.github.ajalt.colormath.model.LABColorSpaces.LAB50 import com.github.ajalt.colormath.model.LABColorSpaces.LAB65 import com.github.ajalt.colormath.model.LCHabColorSpaces.LCHab50 import com.github.ajalt.colormath.model.LCHabColorSpaces.LCHab65 -import com.github.ajalt.colormath.roundtripTest -import com.github.ajalt.colormath.testColorConversions import kotlin.js.JsName import kotlin.test.Test