Lua 5.3 didn't need an x86 emulator. But now, it has one regardless.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

table_ocpalette.lua 719B

123456789101112131415161718192021222324252627282930
  1. oc_palette = {}
  2. local pc_16_colors = {
  3. 0x000000, 0x0000AA, 0x00AA00, 0x00AAAA,
  4. 0xAA0000, 0xAA00AA, 0xAA5500, 0xAAAAAA,
  5. 0x555555, 0x5555FF, 0x55FF55, 0x55FFFF,
  6. 0xFF5555, 0xFF55FF, 0xFFFF55, 0xFFFFFF
  7. }
  8. for i=0,255 do
  9. if (i < 16) then
  10. oc_palette[i] = (i * 15) << 16 | (i * 15) << 8 | (i * 15)
  11. else
  12. local j = i - 16
  13. local b = math.floor((j % 5) * 255 / 4.0)
  14. local g = math.floor((math.floor(j / 5.0) % 8) * 255 / 7.0)
  15. local r = math.floor((math.floor(j / 40.0) % 6) * 255 / 5.0)
  16. oc_palette[i] = r << 16 | g << 8 | b
  17. end
  18. end
  19. local component = require("component")
  20. local gpu = component.gpu
  21. for i=0,15 do
  22. oc_palette[i] = pc_16_colors[i+1]
  23. gpu.setPaletteColor(i, oc_palette[i])
  24. end
  25. return oc_palette