Closed CoryCharlton closed 5 months ago
As usual I'm more that willing to send over a PR just want to confirm which direction we want to go.
The original Color.cs imported from .Net Microframework was much simpler and did not have these functions. This is a much-improved class, and it looks like @Ellerbach has created this new one from code (maybe from Microsoft). Hopefully, he can assist. Terry
As usual, we should favor alignment with the full .NET API (despite we all occasionally disagree on some bits). Let's wait for @Ellerbach take on this. And, yes please, @CoryCharlton do take of this. 👍🏻
@CoryCharlton and @josesimoes yes, code is mainly coming from Microframework and .NET and the existing functions in the nano Graphics. Those explains as well disconnection on some of the names for the function and as some were used also in the IoT repo. If there are names to align, go for it! If there are maths to align, go for it as well! Just be careful with renaming quite a lot of functions are used in the nano Graphic libs and in the IoT repo.
Sounds good. I sent over a PR to fix the math involved in Color.GetHue()
, Color.GetSaturation()
, and Color.GetBrightness()
. I used the implementation from .NET Core 8.0.
Library/API/IoT binding
nanoFramework.Graphics.Core
Visual Studio version
No response
.NET nanoFramework extension version
No response
Target name(s)
No response
Firmware version
No response
Device capabilities
No response
Description
The documentation for
Color.GetHue()
,Color.GetSaturation()
, andColor.GetBrightness()
(and the .NET full implementation) say they should return HSL values but they actually return HSV values.How to reproduce
nanoFramework output:
.NET Core 8.0 output:
Expected behaviour
Either HSL values should be returned or the documentation should be updated to note they are HSV values (I prefer the latter but it differs from .NET full 🤷 )
Screenshots
No response
Sample project or code
No response
Aditional information
https://www.rapidtables.com/convert/color/rgb-to-hsv.html https://www.rapidtables.com/convert/color/rgb-to-hsl.html