Fix pre-defined colors in bgr format being treated as rgb

This commit is contained in:
DBotThePony 2024-05-31 16:43:32 +07:00
parent cea53ec35e
commit 415267586d
Signed by: DBot
GPG Key ID: DCC23B5715498507
2 changed files with 12 additions and 12 deletions

View File

@ -4,7 +4,7 @@ kotlin.code.style=official
specifyKotlinAsDependency=false specifyKotlinAsDependency=false
projectGroup=ru.dbotthepony.kommons projectGroup=ru.dbotthepony.kommons
projectVersion=3.0.1 projectVersion=3.0.2
guavaDepVersion=33.0.0 guavaDepVersion=33.0.0
gsonDepVersion=2.8.9 gsonDepVersion=2.8.9

View File

@ -229,17 +229,17 @@ class RGBAColor(red: Float, green: Float, blue: Float, alpha: Float = 1f) : IStr
@JvmField val HALF_TRANSPARENT = RGBAColor(1f, 1f, 1f, 0.5f) @JvmField val HALF_TRANSPARENT = RGBAColor(1f, 1f, 1f, 0.5f)
@JvmField val REDDISH = RGBAColor(1f, 0.4f, 0.4f) @JvmField val REDDISH = RGBAColor(1f, 0.4f, 0.4f)
@JvmField val DARK_BLUE = rgb(170) @JvmField val DARK_BLUE = bgr(170)
@JvmField val DARK_GREEN = rgb(43520) @JvmField val DARK_GREEN = bgr(43520)
@JvmField val DARK_AQUA = rgb(43690) @JvmField val DARK_AQUA = bgr(43690)
@JvmField val DARK_RED = rgb(11141120) @JvmField val DARK_RED = bgr(11141120)
@JvmField val DARK_PURPLE = rgb(11141290) @JvmField val DARK_PURPLE = bgr(11141290)
@JvmField val GOLD = rgb(16755200) @JvmField val GOLD = bgr(16755200)
@JvmField val DARK_GRAY = rgb(5592405) @JvmField val DARK_GRAY = bgr(5592405)
@JvmField val BLUE = rgb(5592575) @JvmField val BLUE = bgr(5592575)
@JvmField val AQUA = rgb(5636095) @JvmField val AQUA = bgr(5636095)
@JvmField val LIGHT_PURPLE = rgb(16733695) @JvmField val LIGHT_PURPLE = bgr(16733695)
@JvmField val YELLOW = rgb(16777045) @JvmField val YELLOW = bgr(16777045)
fun bgr(color: Int): RGBAColor { fun bgr(color: Int): RGBAColor {
val r = (color and 0xFF0000 ushr 16) / 255f val r = (color and 0xFF0000 ushr 16) / 255f