mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-11-15 17:33:56 +00:00
1 parent
5d5a0cc511
commit
5657b5f924
1 file changed
+10
@@ -96,6 +96,16 @@ function math.torgba(input)
|
||||
return math.tovector(input, 0, 255, true)
|
||||
end
|
||||
|
||||
---Takes a hexidecimal string and returns three integers.
|
||||
---@param input string
|
||||
---@return integer
|
||||
---@return integer
|
||||
---@return integer
|
||||
function math.hextorgb(input)
|
||||
local r, g, b = string.match(input, '([^#]+.)(..)(..)')
|
||||
return tonumber(r, 16), tonumber(g, 16), tonumber(b, 16)
|
||||
end
|
||||
|
||||
---Formats a number as a hexadecimal string.
|
||||
---@param n number | string
|
||||
---@param upper? boolean
|
||||
|
||||
Reference in new issue
Block a user