Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hex and rgb values according to standards #1

Closed
Sandstedt opened this issue Dec 10, 2019 · 2 comments
Closed

Hex and rgb values according to standards #1

Sandstedt opened this issue Dec 10, 2019 · 2 comments

Comments

@Sandstedt
Copy link

Sandstedt commented Dec 10, 2019

Nice script, but would be good to format the hex and rgb values according to web standards.

Ex hex is always written #ff00ff not ff00ff. So in convert.lua:4, your could instead write:

local hash,redColor,greenColor,blueColor=hex:match('(.)(..)(..)(..)')

And rgb value doesn't take alpha, but rgba does. But the alpha goes from 0 to 1 instead of 0 to 100, so on row 18-21:

if alpha == nil then
  return redColor, greenColor, blueColor
end
return redColor, greenColor, blueColor, alpha

Can write a PR if you want :)

@dmoa
Copy link

dmoa commented Apr 13, 2020

Agreed, there should be an option for this though

@andrewyavors
Copy link
Owner

Thank you, fixed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants