From b1ca817e3879bc070df1d1750ac6499421cb99d7 Mon Sep 17 00:00:00 2001 From: cheapie Date: Thu, 19 May 2016 14:24:13 -0500 Subject: Add 64-color mode --- init.lua | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'init.lua') 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 -- cgit v1.2.3