Skip to content
Snippets Groups Projects
Commit 424921f9 authored by Janne Mareike Koschinski's avatar Janne Mareike Koschinski
Browse files

Allows sending hex background colors

parent 394de033
Branches
Tags
No related merge requests found
......@@ -97,10 +97,14 @@ class IrcFormatSerializer internal constructor(private val context: Context) {
writeColor(foreground, background)
}
fun writeHexColor(foreground: Int?) {
fun writeHexColor(foreground: Int?, background: Int?) {
out.append(CODE_HEXCOLOR)
if (foreground != null) {
out.append(String.format(Locale.US, "%06x", foreground and 0x00FFFFFF))
if (background != null) {
out.append(',')
out.append(String.format(Locale.US, "%06x", background and 0x00FFFFFF))
}
}
}
......@@ -184,7 +188,7 @@ class IrcFormatSerializer internal constructor(private val context: Context) {
writeColor(afterForegroundCode, afterBackgroundCode)
}
} else {
writeHexColor(afterForeground)
writeHexColor(afterForeground, afterBackground)
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment