summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcheapie <no-email-for-you@example.com>2016-05-19 14:24:13 -0500
committercheapie <no-email-for-you@example.com>2016-05-19 14:24:13 -0500
commitb1ca817e3879bc070df1d1750ac6499421cb99d7 (patch)
tree46cbeae48dd3051852f05a92e059ff5bee13afbd
parentfaa909dee9ffb4cc1e594cb377e30dcbd41adde3 (diff)
downloadrgblightstone-b1ca817e3879bc070df1d1750ac6499421cb99d7.tar
rgblightstone-b1ca817e3879bc070df1d1750ac6499421cb99d7.tar.gz
rgblightstone-b1ca817e3879bc070df1d1750ac6499421cb99d7.tar.bz2
rgblightstone-b1ca817e3879bc070df1d1750ac6499421cb99d7.tar.xz
rgblightstone-b1ca817e3879bc070df1d1750ac6499421cb99d7.zip
Add 64-color mode
-rw-r--r--README7
-rw-r--r--init.lua16
2 files changed, 19 insertions, 4 deletions
diff --git a/README b/README
index 04743cc..a773489 100644
--- a/README
+++ b/README
@@ -35,10 +35,13 @@ Edit the settings at the top of init.lua to change what colors are available. Th
16 color mode:
off, black, blue, brown, cyan, darkblue, darkcyan, darkgray, darkgreen, darkmagenta, darkred, gray, green, magenta, red, white, yellow
-12-bit 4096 color mode:
+64 color mode:
+Same as 4096-color (below), but only even digits work (so "EEAA88" works but "55BBFF" doesn't).
+
+4096 color mode:
Any 6-digit hex value where the two digits for each part are the same. For example, "00FF66" and "112233" work, but "5678AC" will not.
-24-bit "True Color" mode:
+"True Color" mode:
While the code is present, engine limitations do not allow this many nodes to be registered. If this ever changes, any hex value (such as "237AF0" or "C0FFEE") will work.
Adding more colors:
diff --git a/init.lua b/init.lua
index 7a1661d..f968a1f 100644
--- a/init.lua
+++ b/init.lua
@@ -1,7 +1,8 @@
rgblightstone = {}
--If neither of the following are on, only the 16 colors listed in the readme will be available
-rgblightstone.extracolors = true -- 12-bit 4096 Color Mode
-rgblightstone.insanecolors = false -- 24-bit "True Color" Mode (DOES NOT WORK - the engine does not allow this many nodes to be registered. If it ever does, however...)
+rgblightstone.sortaextracolors = true -- 64 Color Mode
+rgblightstone.extracolors = false -- 4096 Color Mode
+rgblightstone.insanecolors = false -- "True Color" Mode (DOES NOT WORK - the engine does not allow this many nodes to be registered. If it ever does, however...)
rgblightstone.colors = {}
function rgblightstone.autofill(pos,player)
@@ -103,6 +104,17 @@ rgblightstone.add("darkgray","555555")
rgblightstone.add("white","FFFFFF")
rgblightstone.add("black","000000")
+if rgblightstone.sortaextracolors and not rgblightstone.insanecolors and not rgblightstone.extracolors then
+ for r=0x0,0xFF,0x22 do
+ for g=0x0,0xFF,0x22 do
+ for b=0x0,0xFF,0x22 do
+ local color = string.format("%02X%02X%02X",r,g,b)
+ rgblightstone.add(color,color)
+ end
+ end
+ end
+end
+
if rgblightstone.extracolors and not rgblightstone.insanecolors then
for r=0x0,0xFF,0x11 do
for g=0x0,0xFF,0x11 do