All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.nemerosa.ontrack.model.labels.Label.kt Maven / Gradle / Ivy

There is a newer version: 4.4.5
Show newest version
package net.nemerosa.ontrack.model.labels

import net.nemerosa.ontrack.common.toRGBColor

open class Label(
        val id: Int,
        val category: String?,
        val name: String,
        val description: String?,
        val color: String,
        val computedBy: LabelProviderDescription?
) {
    /**
     * Foreground colour
     */
    val foregroundColor: String get() = color.toRGBColor().toBlackOrWhite().toString()

    /**
     * Representation
     */
    fun getDisplay() = if (category != null) {
        "$category:$name"
    } else {
        name
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy