Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.x] Fix Color.v integer assignment #55963

Merged
merged 1 commit into from
Dec 15, 2021
Merged

Conversation

timothyqiu
Copy link
Member

get_v() was provided for the S parameter of set_hsv().

So assigning Color.v with an integer value would also set S to the old V:

extends SceneTree

func _init():
	var c = Color.from_hsv(0.58, 0.5, 0.79, 0.8)
	print("H:%.2f  S:%.2f  V:%.2f" % [c.h, c.s, c.v])

	c.v = 1
	print("H:%.2f  S:%.2f  V:%.2f" % [c.h, c.s, c.v])

	quit()

# Prints:
# H:0.58  S:0.50  V:0.79
# H:0.58  S:0.79  V:1.00

@akien-mga akien-mga merged commit 28713f9 into godotengine:3.x Dec 15, 2021
@akien-mga
Copy link
Member

Thanks!

@timothyqiu timothyqiu deleted the color-v-int branch December 15, 2021 16:57
@akien-mga
Copy link
Member

Cherry-picked for 3.4.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants