fun build()

in kotlin-css/src/commonMain/kotlin/kotlinx/css/properties/Gradient.kt [42:62]


    fun build(start: String?, repeat: Boolean): Image {
        return Image(
            buildString {
                if (repeat) {
                    append("repeating-linear-gradient(")
                } else {
                    append("linear-gradient(")
                }
                if (start != null) {
                    append(start).append(", ")
                }
                stops.forEachIndexed { index, colorStop ->
                    if (index > 0) {
                        append(", ")
                    }
                    appendColorStop(colorStop)
                }
                append(")")
            }
        )
    }