fun build()

in kotlin-css/src/commonMain/kotlin/kotlinx/css/properties/Gradient.kt [135:157]


    fun build(repeat: Boolean): Image {
        return Image(
            buildString {
                if (repeat) {
                    append("repeating-radial-gradient(")
                } else {
                    append("radial-gradient(")
                }
                when {
                    shape != null && at != null -> append(shape).append(" at ").append(at)
                    shape != null -> append(shape)
                    at != null -> append("at ").append(at)
                }
                stops.forEachIndexed { index, stop ->
                    if (index > 0 || shape != null || at != null) {
                        append(", ")
                    }
                    appendColorStop(stop)
                }
                append(")")
            }
        )
    }