forked from zzerexx/scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMoreColor3.lua
More file actions
31 lines (27 loc) · 822 Bytes
/
MoreColor3.lua
File metadata and controls
31 lines (27 loc) · 822 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
setreadonly(Color3,false)
function Color3.fromValue(c)
return Color3.fromRGB(c.R,c.G,c.B)
end
function Color3.toValue(c)
return {R = math.floor(c.R * 255),G = math.floor(c.G * 255),B = math.floor(c.B * 255)}
end
function Color3.toRGB(c)
return math.floor(c.R * 255), math.floor(c.G * 255), math.floor(c.B * 255)
end
getgenv().COLOR3LOADED = true
--[[
Value Tables
{
R = 255,
G = 0,
B = 0
}
This table is equivalent to Color3.fromRGB(255,0,0)
With value tables, you can encode color values in JSON format.
Color3.fromValue(Value Table)
Converts a Value Table to Color3.fromRGB
Color3.toValue(Color3.fromRGB)
Converts a Color3.fromRGB value to a Value Table
Color3.toRGB(Color3.new)
Converts a Color3.new value to a Color3.fromRGB value
]]