mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2025-09-03 23:29:33 +00:00
add opportunity to create Hex from rgb
This commit is contained in:
@@ -8,7 +8,9 @@ sealed interface Color {
|
||||
value class BackgroundColor(override val value: String) : Color
|
||||
|
||||
@Serializable
|
||||
value class Hex(override val value: String) : Color
|
||||
value class Hex(override val value: String) : Color {
|
||||
constructor(r: UByte, g: UByte, b: UByte) : this("#${r.toString(16)}${g.toString(16)}${b.toString(16)}")
|
||||
}
|
||||
|
||||
companion object {
|
||||
val BackgroundColor = BackgroundColor("bg_color")
|
||||
|
Reference in New Issue
Block a user