Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local args = {...}
- local pick = args[1]
- if pick == nil then
- print("Options:")
- print("- default")
- print("- inverted")
- print("- rgb")
- print("- retro")
- print("- hacker")
- print("- random")
- return
- end
- -- Start of presets
- local presets = {}
- presets["default"] = {
- {colors.white, 0xf0f0f0},
- {colors.orange, 0xf2b233},
- {colors.magenta, 0xe57fd8},
- {colors.lightBlue, 0x99b2f2},
- {colors.yellow, 0xdede6c},
- {colors.lime, 0x7fcc19},
- {colors.pink, 0xf2b2cc},
- {colors.gray, 0x4c4c4c},
- {colors.lightGray, 0x999999},
- {colors.cyan, 0x4c99b2},
- {colors.purple, 0xb266e5},
- {colors.blue, 0x3366cc},
- {colors.brown, 0x7f664c},
- {colors.green, 0x57a64e},
- {colors.red, 0xcc4c4c},
- {colors.black, 0x111111}
- }
- presets["inverted"] = {
- {colors.white, 0x111111},
- {colors.black, 0xf0f0f0},
- {colors.gray, 0x999999},
- {colors.lightGray, 0x4c4c4c},
- {colors.orange, 0xf2b233},
- {colors.magenta, 0xe57fd8},
- {colors.lightBlue, 0x99b2f2},
- {colors.yellow, 0xdede6c},
- {colors.lime, 0x7fcc19},
- {colors.pink, 0xf2b2cc},
- {colors.cyan, 0x4c99b2},
- {colors.purple, 0xb266e5},
- {colors.blue, 0x3366cc},
- {colors.brown, 0x7f664c},
- {colors.green, 0x57a64e},
- {colors.red, 0xcc4c4c}
- }
- presets["rgb"] = {
- {colors.white, 0xffffff},
- {colors.orange, 0xff7f00},
- {colors.magenta, 0xbe00ff},
- {colors.lightBlue, 0x7f7fff},
- {colors.yellow, 0xffff00},
- {colors.lime, 0x00ff00},
- {colors.pink, 0xff00ff},
- {colors.gray, 0x555555},
- {colors.lightGray, 0xbebebe},
- {colors.cyan, 0x007fff},
- {colors.purple, 0x5500ff},
- {colors.blue, 0x0000ff},
- {colors.brown, 0x7f4000},
- {colors.green, 0x007f00},
- {colors.red, 0xff0000},
- {colors.black, 0x000000}
- }
- presets["retro"] = {
- {colors.white, 0xf4f4f4},
- {colors.orange, 0xef7d57},
- {colors.magenta, 0x566c86},
- {colors.lightBlue, 0x41a6f6},
- {colors.yellow, 0xffcd75},
- {colors.lime, 0xa7f070},
- {colors.pink, 0x94b0c2},
- {colors.gray, 0x505050},
- {colors.lightGray, 0xb0b0b0},
- {colors.cyan, 0x3e82e0},
- {colors.purple, 0x333c57},
- {colors.blue, 0x3b5dc9},
- {colors.brown, 0x7f664c},
- {colors.green, 0x38b764},
- {colors.red, 0xb13e53},
- {colors.black, 0x151515}
- }
- presets["hacker"] = {
- {colors.white, 0x00ff00},
- {colors.orange, 0x00ff00},
- {colors.magenta, 0x00ec05},
- {colors.lightBlue, 0x00da09},
- {colors.yellow, 0x00ff00},
- {colors.lime, 0x00c70e},
- {colors.pink, 0x00b513},
- {colors.gray, 0x006000},
- {colors.lightGray, 0x00b000},
- {colors.cyan, 0x00a217},
- {colors.purple, 0x00901c},
- {colors.blue, 0x003333},
- {colors.brown, 0x007d20},
- {colors.green, 0x006b25},
- {colors.red, 0x00582a},
- {colors.black, 0x001100}
- }
- -- Generate random colors
- if pick == "random" then
- presets["random"] = {}
- local colorKeys = {
- colors.white, colors.orange, colors.magenta, colors.lightBlue,
- colors.yellow, colors.lime, colors.pink, colors.gray,
- colors.lightGray, colors.cyan, colors.purple, colors.blue,
- colors.brown, colors.green, colors.red, colors.black
- }
- for _, color in ipairs(colorKeys) do
- table.insert(presets["random"], {color, math.random(0, 0xFFFFFF)})
- end
- end
- -- End of presets
- -- Delete old palette file
- if fs.exists("/startup/paletteSetter.lua") then
- fs.delete("/startup/paletteSetter.lua")
- end
- -- Write new palette file
- local file = fs.open("/startup/paletteSetter.lua", "w")
- for i = 1, #presets[pick] do
- local color, hex = table.unpack(presets[pick][i])
- file.writeLine("term.setPaletteColor("..color..", "..hex..")")
- end
- file.close()
- -- Run it
- shell.run("/startup/paletteSetter.lua")
- term.blit(" ", "ffffffffffffffff", "087fe145d39b62ac")
- print("")
- -- Delete if default to restore original colors next reboot
- if pick == "default" then
- fs.delete("/startup/paletteSetter.lua")
- end
Advertisement
Add Comment
Please, Sign In to add comment