mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-02-12 16:53:07 +00:00
If the color selected in the palette is the same then it should take prioity.
This commit is contained in:
parent
1b8301ae72
commit
7b6530021f
|
@ -147,13 +147,13 @@ func set_pixelv_custom(point: Vector2i, color: Color) -> void:
|
|||
if not color.is_equal_approx(TRANSPARENT):
|
||||
if palette.has(color):
|
||||
color_index = palette.find(color)
|
||||
## If the color selected in the palette is the same then it should take prioity.
|
||||
#var selected_index = Palettes.current_palette_get_selected_color_index(
|
||||
#Tools.active_button
|
||||
#)
|
||||
#if selected_index != -1:
|
||||
#if Palettes.current_palette_get_color(selected_index) == color:
|
||||
#color_index = selected_index
|
||||
# If the color selected in the palette is the same then it should take prioity.
|
||||
var selected_index = Palettes.current_palette_get_selected_color_index(
|
||||
Tools.active_button
|
||||
)
|
||||
if selected_index != -1:
|
||||
if palette[selected_index].is_equal_approx(color):
|
||||
color_index = selected_index
|
||||
else: # Find the most similar color
|
||||
var smaller_distance := color_distance(color, palette[0])
|
||||
for i in palette.size():
|
||||
|
|
Loading…
Reference in a new issue