Skip to content

Conversation

@zyojv
Copy link

@zyojv zyojv commented Aug 29, 2017

I wanted to use the HSVToColor() native Lua function. Then i noticed that the toHsv() function is not doing the right Operation for me so i wanted to add the HSVToColor.

@awilliamson
Copy link
Member

awilliamson commented Aug 29, 2017

@Kronos9247 The reason this wasn't added to the Colour type originally is that the colour type is expressed as RGB underlying. Having a method on the Colour Type to convert to HSV is fine, as it takes a Colour and returns a table of HSV. However, adding a function which takes HSV, and returns RGB doesn't make sense when attached to the colour Type methods. It might make sense as a library utility function, or if you were to create a HSV type ( similar to colour ) and use that as a method.

Would you be able to elaborate on your issue about it not doing the right operation for you? HSVToColor takes HSV, and produces it in RGB colour space. our toHSV() takes RGB Colour and produces a HSV Colour space representation. I hope this helps :)

EDIT: I would like to add, thank you for taking the time out to present this PR; You've clearly read, understood, and adhered to the Codestyle guidelines. Many people seem to gloss over that important document. We wish to encourage you to contribute in the future :)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants