[github] Dimmer issue label colors on darkula

This commit is contained in:
Ivan Semenov
2018-10-12 14:24:34 +03:00
parent 4e45040752
commit 6baa293695
@@ -42,7 +42,10 @@ object GithubUIUtil {
}
fun createIssueLabelLabel(label: GithubIssueLabel): JBLabel = JBLabel(" ${label.name} ", UIUtil.ComponentStyle.MINI).apply {
background = Color.decode("0x${label.color}")
foreground = if (ColorUtil.isDark(background)) Color.white else Color.black
val apiColor = ColorUtil.fromHex(label.color)
background = JBColor(apiColor, ColorUtil.darker(apiColor, 3))
foreground = computeForeground(background)
}.andOpaque()
private fun computeForeground(bg: Color) = if (ColorUtil.isDark(bg)) Color.white else Color.black
}