View Single Post
01/02/21, 06:20 PM   #3
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,989
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.
  Reply With Quote