mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-02-13 01:03: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 not color.is_equal_approx(TRANSPARENT):
|
||||||
if palette.has(color):
|
if palette.has(color):
|
||||||
color_index = palette.find(color)
|
color_index = palette.find(color)
|
||||||
## If the color selected in the palette is the same then it should take prioity.
|
# 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(
|
var selected_index = Palettes.current_palette_get_selected_color_index(
|
||||||
#Tools.active_button
|
Tools.active_button
|
||||||
#)
|
)
|
||||||
#if selected_index != -1:
|
if selected_index != -1:
|
||||||
#if Palettes.current_palette_get_color(selected_index) == color:
|
if palette[selected_index].is_equal_approx(color):
|
||||||
#color_index = selected_index
|
color_index = selected_index
|
||||||
else: # Find the most similar color
|
else: # Find the most similar color
|
||||||
var smaller_distance := color_distance(color, palette[0])
|
var smaller_distance := color_distance(color, palette[0])
|
||||||
for i in palette.size():
|
for i in palette.size():
|
||||||
|
|
Loading…
Reference in a new issue