ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   AddOn Search/Requests (https://www.esoui.com/forums/forumdisplay.php?f=165)
-   -   Hex Colour Picker (https://www.esoui.com/forums/showthread.php?t=10128)

MarcusUK 03/30/22 06:08 AM

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. ;)

Baertram 03/30/22 09:00 AM

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).


ExoY 03/30/22 11:04 AM

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)

MarcusUK 03/30/22 12:18 PM

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.

MarcusUK 03/30/22 01:00 PM

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

Sharlikran 03/30/22 02:45 PM

Quote:

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.

MarcusUK 04/10/22 05:47 PM

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. :mad:




Baertram 04/11/22 01:57 AM

THIS is a question you should ask ZOs and not esoui :D
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/


All times are GMT -6. The time now is 03:18 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI