Skip to content

Commit

Permalink
Color fix
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown-gd committed Feb 26, 2024
1 parent 360447c commit e708fac
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion lua/autorun/!!!random-patches.yue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ CurTime = CurTime
SERVER = SERVER
pairs = pairs

addonName = "Random Patches v5.13.0"
addonName = "Random Patches v5.13.1"

getHookName = ( patchName, hookName ) ->
return addonName .. "::" .. patchName .. ( hookName or "" )
Expand Down Expand Up @@ -390,8 +390,13 @@ do
do

setmetatable = setmetatable
isnumber = isnumber
tonumber = tonumber

global Color = ( r, g, b, a ) ->
unless isnumber( r )
r = tonumber( r )

if r
if r > 255
r = 255
Expand All @@ -400,6 +405,9 @@ do
else
r = 255

unless isnumber( g )
g = tonumber( g )

if g
if g > 255
g = 255
Expand All @@ -408,6 +416,9 @@ do
else
g = 255

unless isnumber( b )
b = tonumber( b )

if b
if b > 255
b = 255
Expand All @@ -416,6 +427,9 @@ do
else
b = 255

unless isnumber( a )
a = tonumber( a )

if a
if a > 255
a = 255
Expand Down

0 comments on commit e708fac

Please sign in to comment.