Wasabi

1k Downloads

Can we support more color picker formats?

Opened this issue ยท 2 comments

commented
  • What version are you using?
    I am using the version of GitHub.

  • Can the issue be reproduced, and if so, how?
    Currently, the color picker will not accept color formats like so
    ["GoodColor"] = {75/255, 175/255, 76/255},

  • If there was an error message, please include it.

4x ...ns\KkthnxUI\Libraries\Wasabi\widgets\ColorPicker.lua:17: bad argument #1 to 'sub' (string expected, got nil)
[C]: in function `sub'
...ns\KkthnxUI\Libraries\Wasabi\widgets\ColorPicker.lua:17: in function <...ns\KkthnxUI\Libraries\Wasabi\widgets\ColorPicker.lua:16>
...ns\KkthnxUI\Libraries\Wasabi\widgets\ColorPicker.lua:24: in function `Update'
KkthnxUI\Libraries\Wasabi\Wasabi-3.lua:147: in function `refresh'
KkthnxUI\Libraries\Wasabi\Wasabi-3.lua:104: in function <KkthnxUI\Libraries\Wasabi\Wasabi.lua:82>
[C]: in function `Show'
FrameXML\InterfaceOptionsFrame.lua:28: in function `InterfaceOptionsList_DisplayPanel'
FrameXML\InterfaceOptionsFrame.lua:46: in function `InterfaceOptionsListButton_OnClick'
[string "*:OnClick"]:2: in function <[string "*:OnClick"]:1>

Locals:
(*temporary) = nil
(*temporary) = 3
(*temporary) = 4
(*temporary) = "string expected, got nil"
commented

Awesome and thank you for the info as well. Your work is always appreciated!

commented

I plan on adding support for ColorMixin, should be sufficient. HSV and/or HSL support could be added if requested.

With that, you could create a color like local GoodColor = CreateColor(75/255, 175/255, 76/255) and pass that as the color, while having complete access to the methods like GoodColor:GetRGB() or GoodColor:GenerateHexColor().