From 17a31085fad2788e0998f9e253ab7c1b4c7a3918 Mon Sep 17 00:00:00 2001 From: scorbett123 <50634068+scorbett123@users.noreply.github.com> Date: Wed, 7 Apr 2021 11:54:19 +0100 Subject: [PATCH] bug: Fix color picker preview (#2193) by scorbett123 closes #2190 and #2189 --- .../org/kamiblue/client/gui/rgui/windows/ColorPicker.kt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/org/kamiblue/client/gui/rgui/windows/ColorPicker.kt b/src/main/kotlin/org/kamiblue/client/gui/rgui/windows/ColorPicker.kt index 24a63e3c..979973c1 100644 --- a/src/main/kotlin/org/kamiblue/client/gui/rgui/windows/ColorPicker.kt +++ b/src/main/kotlin/org/kamiblue/client/gui/rgui/windows/ColorPicker.kt @@ -271,14 +271,12 @@ object ColorPicker : TitledWindow("Color Picker", 0.0f, 0.0f, 200.0f, 200.0f, Se private fun drawColorPreview(vertexHelper: VertexHelper) { RenderUtils2D.prepareGl() - // Previous color - val prevColor = setting?.value?.clone()?.apply { a = 255 } - RenderUtils2D.drawRectFilled(vertexHelper, prevColorPos.first.toVec2d(), prevColorPos.second.toVec2d(), prevColor + RenderUtils2D.drawRectFilled(vertexHelper, prevColorPos.first.toVec2d(), prevColorPos.second.toVec2d(), originalColor ?: ColorHolder()) RenderUtils2D.drawRectOutline(vertexHelper, prevColorPos.first.toVec2d(), prevColorPos.second.toVec2d(), 1.5f, GuiColors.outline) // Current color - val currentColor = ColorHolder(r.value, g.value, b.value) + val currentColor = setting?.value ?: ColorHolder() RenderUtils2D.drawRectFilled(vertexHelper, currentColorPos.first.toVec2d(), currentColorPos.second.toVec2d(), currentColor) RenderUtils2D.drawRectOutline(vertexHelper, currentColorPos.first.toVec2d(), currentColorPos.second.toVec2d(), 1.5f, GuiColors.outline)