Thread Tools Display Modes
03/30/22, 06:08 AM   #1
MarcusUK
Join Date: Jun 2021
Posts: 15
Hex Colour Picker

There are a lot of addons which use the ZOS colour picker to allow customisation of text in lists and things. Would be good if someone could create a library that authors could use that allows players to not only use the colour picker, but fine-tune the colours using a HEX code, so that picking colours is less "guess work" on the colour palette, trying to match a colour you use already as closely as possible when you can just tweak 3 values and get it exactly. There is an addon here that shows the Hex value of any picked colour, and allows tuning via +/- controls, for Guild owners colouring their MOTDs, ranks, etc. To be able to do this with addons too would be great, and I think if there was a library that gave authors an easy way of incorporating the colour picker with HEX options would be popular.

https://www.esoui.com/downloads/info...olorToHex.html

Not a request as such, just throwing this idea out to anyone looking for suggestions for new addons to code.
  Reply With Quote
03/30/22, 09:00 AM   #2
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,966
http://hex2rgba.devoth.com/

I'm using this to get the hex code's RGBA values for the ESO color picker.
Maybe one could integrate that kind of stuff into the color picker UI of the game directly somehow, but unsure if this is possible. I guess one would need to replace/overwrite the official one.
Writing a lib would not help here imo as the functions should exist in ZOs color ZO_ColorDef etc. already, and you'd only need an extra edit field at the color picker UI to input the #hex code, press return, and get the calculated RGBA values at the existing input fields for R(ed) G(reen) B(lue) and at the slider for A(lpha / opacity).


Last edited by Baertram : 03/30/22 at 09:07 AM.
  Reply With Quote
03/30/22, 11:04 AM   #3
ExoY
 
ExoY's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2020
Posts: 88
If I understand your idea correctly, those functions are already provided by zos to convert rgb and hex values.

I use
Lua Code:
  1. ZO_ColorDef.FloatsToHex()
to get the hex string based on the rgb values
and I am pretty sure there is also a function for the conversion in the other direction.
(I just dont know its exact name because I have not used it so far)

Last edited by ExoY : 03/30/22 at 11:13 AM.
  Reply With Quote
03/30/22, 12:18 PM   #4
MarcusUK
Join Date: Jun 2021
Posts: 15
Well, from looking at the ColorToHex adddon, that is a tool which displays the RGB values of a selected colour on the colour wheel and can be adjusted to refine the colour as it's not easy to get a pixel-perfect choice using a mouse cursor to select from the palette. All that needs to happen from there is that the resulting value be put into the field in the addon setting that is currently being colourised, just as only selecting from the wheel does now. I mean, there must be a value being determined already just by clicking anywhere on the colour wheel, so be altering the RGB values manually to tweak the colour the same value will be altered, so the RBG values are little more than sliders, like you might use to change a font size, but in this case they go from 0 to 255 and alter the hex value.
  Reply With Quote
03/30/22, 01:00 PM   #5
MarcusUK
Join Date: Jun 2021
Posts: 15
Baertram has a post from 2021 listing a ton of ZO_ColorDef functions, that I found with Google.

https://www.esoui.com/forums/showpos...09&postcount=4
  Reply With Quote
03/30/22, 02:45 PM   #6
Sharlikran
 
Sharlikran's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 642
of a selected colour on the colour wheel and can be adjusted to refine the colour as it's not easy to get a pixel-perfect choice using a mouse cursor to select from the palette. All that needs to happen from there is that the resulting value be put into the field in the addon setting that is currently being colourised
For text color yes it is '|cFFFFFF' .. text .. '|r' to make the text white. However, that's for text when you display it to chat or to mail for example.

Otherwise the color is not stored that way in saved variables. That uses 0 to 1. Unless you want to convert it with something else. 0 is black and 1 is white. The docs at the link you posted will mention ZO_ColorDef:SetRGBA(r, g, b, a) but that is because the values are keyed. Meaning { r = 0, g = 0.5, b = 1, a = 1 } and when you pass that to the function then it knows what to do.

Code:
["QuestMap_daily"] = 
{
    [r] = 0.1725490242,
    [g] = 0.9333333373,
    [b] = 0.1725490242,
    [a] = 1,
},
So while your request is simple and yes someone could probably make it use Hex instead of 0 to 255, in the end the color picker saves it in the proper ZOS format which is 0 to 1. Someone could make the UI to use Hex rather then decimal but we can't change the ZOS standard of 0 to 1.

Which is why it's better to say, "Okay thanks for the information I will use the web links it's just a pain. Thanks guys." Because in the end it is easy enough to use web links, convert the hex to decimal, and put it in. Then accept that if you put in 254, 153, 15 that because that is converted to 0 to 1, the math may not work out to be the same the next time you look at the color. So you may see it come out to be 253, 152, 14 and that's just how it is.

Last edited by Sharlikran : 03/31/22 at 03:45 PM.
  Reply With Quote
04/10/22, 05:47 PM   #7
MarcusUK
Join Date: Jun 2021
Posts: 15
Okay, I've just learned something which just... irritates me... here are two screenshots of changing text colour in the USPF addon... seen in Gamepad mode then in Keyboard/Mouse mode.

Someone please explain to me why ZOS cannot be arsed to give Gamepad users the HEX-refining functionality? We have a sodding D-pad, we can easily select elements with the left/right on a UI if they are tabulated and up/down to alter values. So what I'd like to see, per my OP here, already exists... only ZOS never bothered to make it available to us Gamepad users.



  Reply With Quote
04/11/22, 01:57 AM   #8
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,966
THIS is a question you should ask ZOs and not esoui
There is a WishList forum here where you could post this to bring it to their attention.
+ /bug ingame, or the official forums of eso
https://forums.elderscrollsonline.com/
  Reply With Quote

ESOUI » AddOns » AddOn Search/Requests » Hex Colour Picker


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off