Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal

LeshaInc

Members
  • Content Count

    3
  • Joined

  • Last visited

Posts posted by LeshaInc

  1. HE0meKY.png
     
    Rainbow
     
    Sometimes you need to write colored strings in terminal. It isn't easy in some cases, so i wrote library for colored output.
     
    Download
    You can download this library using this command: pastebin get J9nAzYai

    Also this library can be found in my oppm repository, just navigate to rainbow folder.

     

    Example

    local color = require("rainbow")
     
    local buf = color.buffer{
      colors_ext = {
        foreground = {
          cool = 0x735184
        }
      },
      patterns = {
        progress = function (self, info, now, max)
          return self.fg_white(info) .. "  " .. 
                 self.fg_red("[" .. now .. "/" .. max .. "]") .. "\n" ..
                 self.bg_black(self.fg_white(""))
        end
      }
    }
     
    local mycoolcolor = buf.colorize(0xDEAD00, true)
    buf(true, "progress", mycoolcolor("i am progress"), buf.fg_red(30), buf.fg_cool(100))
    buf("i am text\n")
    color.core(
      "i am ", 
      color.core.bg_red("core"), 
      color.core.fg_white(color.core.bg_black(" text\n"))
    )
    

     

    Documentation

    ... will be here soon. Just wait. ;)

     

    Enjoy!

     

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.