Skip to content

Instantly share code, notes, and snippets.

View gzoritchak's full-sized avatar

Gaetan Zoritchak gzoritchak

View GitHub Profile
// runs the code in the background thread pool
fun asyncOverlay() = async(CommonPool) {
// start two async operations
val original = asyncLoadImage("original")
val overlay = asyncLoadImage("overlay")
// and then apply overlay to both results
applyOverlay(original.await(), overlay.await())
}
// launches new coroutine in UI context
@gzoritchak
gzoritchak / HTMLColors.kt
Created June 28, 2017 12:05
Html colors in a subpackage.
package io.data2viz.color.htmlColors
import io.data2viz.color.colors.col
val aliceblue by lazy { 0xf0f8ff.col }
val aqua by lazy { 0x00ffff.col }
val aquamarine by lazy { 0x7fffd4.col }
val azure by lazy { 0xf0ffff.col }
val beige by lazy { 0xf5f5dc.col }
val bisque by lazy { 0xffe4c4.col }
@gzoritchak
gzoritchak / JavaFxAnimationTest.kt
Created July 5, 2017 21:32
Just a test of JavaFx animation.
package io.data2viz.svg
import javafx.animation.AnimationTimer
import javafx.application.Application
import javafx.scene.Group
import javafx.scene.Scene
import javafx.scene.paint.Color
import javafx.scene.shape.Circle
import javafx.scene.shape.Rectangle
import javafx.stage.Stage
package io.data2viz.examples.thomas
import io.data2viz.color.Colors
import io.data2viz.geom.Size
import io.data2viz.scale.Scales
import io.data2viz.viz.JFxVizRenderer
import io.data2viz.viz.Viz
import io.data2viz.viz.viz
import javafx.application.Application