Lua colors?

  • Brendan21
    11th Aug 2012 Member 0 Permalink

    I need a list of colors like black, red, blue, purple, etc. in a certain format for Lua scripting. The way I need it goes like this:

     

    tpt.el.bran.color=0x0004

     

    I need it in that kind of format. I will appreciate it because I am working on Obsidian :)

     

    Also, I need to know how to change ctype in Lua format, unlike the classic Python "!set ctype..." I want a tpt.el.xxxx.ctype=yyyy or something.

  • DJspiderize
    11th Aug 2012 Member 0 Permalink

    Look it up? On google? Or maybe Bing? If you're in that sort of mood?

  • jenn4
    11th Aug 2012 Member 0 Permalink
    Colorpicker is your salvation. select the color you want and copy the numeric code from top of the page. Paste it after the 0x part. Pink would be 0xFF0066
  • Brendan21
    11th Aug 2012 Member 0 Permalink

    @DJspiderize Lol, I tried that...

     

    @jenn4 Didn't find that result... Your a hero :)

  • babay
    11th Aug 2012 Member 0 Permalink

    it's a hexademical representation (hex) of red, green, blue and alpha values (rgba)

    rgba vary from 0 (0x00) to 255 (0xff). if you use windows, you can convert numbers between decimal and hex with default calculator.

     

    tpt.set_property(string property, object value)

    tpt.set_property(string property, object value, string type)

    tpt.set_property(string property, object value, number index)

    tpt.set_property(string property, object value, number index, string type)

    tpt.set_property(string property, object value, number x, number y)

    tpt.set_property(string property, object value, number x, number y, string type)

    tpt.set_property(string property, object value, number x, number y, number width, number height)

    tpt.set_property(string property, object value, number x, number y, number width, number height, string type)

     you can find all the documentation on wiki

  • Brendan21
    11th Aug 2012 Member 0 Permalink

    @babay Cool, I will check it out :)

     

    EDIT:

    I can't seem to get the color right on Obsidian, I am using ColorPicker.com but it isn't working. I keep getting it to be a dark grey, but it either comes out as a completely hidden black or a blue. Here is the script... I don't know how to put it in to code, so I am putting it in as it is...

     

    tpt.el.bran.menu=1
    tpt.el.bran.enabled=1
    tpt.el.bran.menusection=8

    tpt.el.bran.name="OBSD"
    tpt.el.bran.description="Obsidian. Very sharp volcanic glass."
    tpt.el.bran.gravity=0
    tpt.el.bran.diffusion=0
    tpt.el.bran.advection=0
    tpt.el.bran.properties=0x0004
    tpt.el.bran.flammable=0
    tpt.el.bran.heat=295.15
    tpt.el.bran.weight=5
    tpt.el.bran.airloss=0
    tpt.el.bran.color=595959

  • babay
    11th Aug 2012 Member 0 Permalink

    "0x" is obligatory, afaik.

     

    tpt.el.bran.color=0x595959

     

    to put code, use <code > </code > html tags, w/o spaces.