@tool
extends Control

@export var image: Texture:
	set(value):
		image = value
		if is_inside_tree() and has_node("%Texture"):
			$%Texture.texture = image

@onready var color: Color

func _ready():
	if image != null and has_node("%Texture"):
		$%Texture.texture = image
	if $%Texture.texture != null:
		var img = $%Texture.texture.get_image()
		color = img.get_pixel(0, 0)
	else: 
		color = Color.BLACK
