Add Color conversion options (add hsla -> hex)
This commit is contained in:
@@ -63,7 +63,11 @@ class Color(value: String) : CssProperty(value) {
|
||||
}
|
||||
}
|
||||
|
||||
fun toHex(): String = toRGBA().asHex()
|
||||
fun toHex(): String = if (isHsla() || isHsl()) {
|
||||
fromHSLANotation().asRGBA().asHex()
|
||||
} else {
|
||||
toRGBA().asHex()
|
||||
}
|
||||
|
||||
fun isHsla(): Boolean {
|
||||
val v = rgb ?: value
|
||||
|
||||
Reference in New Issue
Block a user