Previewing colorpicker colors can be done via LibAddonMenu-2.0 -> Colorpicker control e.g.
use the setFunc of the colorpicker to colorize your addon's texture/control/etc.
Or add a description LAM 2.0 control, add the reference so that it will get a unique controlName and then use this controlName.title:SetColor(yourLAMColorPickerSavedSetting.r,yourLAMColorPickerSavedSetting.g,yourLAMColorPickerSavedSetting.b,yourLAMColorPickerSavedSetting.a) in the setFunc
This way you are able to preview the color in the LAM settings panel already, and later you can apply the same saved color to your text wherever you want to use it.
To format it into hex values use the ZO_ColorDef class, function :ToHex(), :ToARGBHexadecimal() + the From* functions etc.
Last edited by Baertram : 01/02/21 at 06:26 PM.
|