1
0
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:
2023-09-25 16:26:27 +06:00
parent 88f6b349ea
commit c92ed92f7c
2 changed files with 19 additions and 17 deletions

View File

@@ -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")