-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #113 from ReneeVandervelde/scenes
Add Scene Structures
- Loading branch information
Showing
15 changed files
with
784 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
lights/src/commonMain/kotlin/inkapplications/shade/lights/structures/ColorPalette.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package inkapplications.shade.lights.structures | ||
|
||
import kotlinx.serialization.Serializable | ||
|
||
/** | ||
* Color/brightness pair reference. | ||
*/ | ||
@Serializable | ||
data class ColorPalette( | ||
val color: ColorValue, | ||
val dimming: DimmingValue, | ||
) |
14 changes: 14 additions & 0 deletions
14
.../src/commonMain/kotlin/inkapplications/shade/lights/structures/ColorTemperaturePalette.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package inkapplications.shade.lights.structures | ||
|
||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
/** | ||
* Color temperature/brightness pair reference. | ||
*/ | ||
@Serializable | ||
data class ColorTemperaturePalette( | ||
@SerialName("color_temperature") | ||
val colorTemperature: ColorTemperatureValue, | ||
val dimming: DimmingValue, | ||
) |
17 changes: 17 additions & 0 deletions
17
lights/src/commonMain/kotlin/inkapplications/shade/lights/structures/GradientMode.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package inkapplications.shade.lights.structures | ||
|
||
import kotlinx.serialization.Serializable | ||
import kotlin.jvm.JvmInline | ||
|
||
/** | ||
* Mode in which gradient points are currently being deployed. | ||
*/ | ||
@JvmInline | ||
@Serializable | ||
value class GradientMode(val key: String) { | ||
companion object { | ||
val InterpolatedPalette = GradientMode("interpolated_palette") | ||
val InterpolatedPaletteMirrored = GradientMode("interpolated_palette_mirrored") | ||
val RandomPixelated = GradientMode("random_pixelated") | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
lights/src/commonMain/kotlin/inkapplications/shade/lights/structures/GradientValue.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package inkapplications.shade.lights.structures | ||
|
||
import kotlinx.serialization.Serializable | ||
|
||
/** | ||
* Basic feature containing gradient properties. | ||
*/ | ||
@Serializable | ||
data class GradientValue( | ||
/** | ||
* Collection of gradients points. | ||
*/ | ||
val points: List<GradientPoint>, | ||
|
||
/** | ||
* Mode in which the points are currently being deployed. | ||
*/ | ||
val mode: GradientMode, | ||
) { | ||
init { | ||
if (points.size > 5) throw IllegalArgumentException("Gradient cannot contain more than 5 points") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,3 +26,4 @@ value class LightEffect(val key: String) { | |
fun valueOf(key: String) = values().single { it.key == key } | ||
} | ||
} | ||
|
Oops, something went wrong.