HISE Logo Forum
    • Categories
    • Register
    • Login

    JSON file with Hex values....wont load.

    Scheduled Pinned Locked Moved General Questions
    3 Posts 2 Posters 302 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • LindonL
      Lindon
      last edited by

      So I'm trying to implement a skin file approach for a product. I have a json array that I can use, and now I'd like it to sit on disk so end users can alter it.

      here's my JSON:

      {
      		"highlight": 0xFF33BCE0,
      		"panelLight":0xFF5C5C5C,
      		"panelDark":0xFF484747,
      		"panelHeader": 0xFF3B3B3B,
      		"darkHighlight":0xFF3B3B3B,
      		"knobColour": 0x55FFFFFF,
      		"dropShadow": 0x3D333333,
      		"OnOffOuter": 0xFF1F1F1F,
      		"OnOffDotOn": 0xFF1F1F1F,
      		"OnOffDotOff": 0xFF1F1F1F,
      		"comboBack": 0xFF3B3B3B,
      		"comboDropText": 0xFFA3A3A3,
      		"comboDropHighlightText": 0xFF333333,
      		"textEdge" : 0x55FFFFFF,
      		"textColour": 0xFF333333,
      		"textAltColour": 0xFFA3A3A3,
      		"buttonStdColour": 0xFFA3A3A3
      }
      

      but when I try and load this with :

      var thisAppData = FileSystem.getFolder(FileSystem.AppData);
      var sfile = thisAppData.getChildFile("Player.skin");
      reg skin = sfile.loadAsObject();
      

      I get an error in my JSON file:

      LAF.js (56): 2:17: error: Syntax error in number

      so it seems the load doesn't like the use of Hex values, any clue how to implement this?

      HISE Development for hire.
      www.channelrobot.com

      1 Reply Last reply Reply Quote 0
      • d.healeyD
        d.healey
        last edited by d.healey

        What about putting the hex value within quotes?

        Another option is to use the integer representation.

        Libre Wave - Freedom respecting instruments and effects
        My Patreon - HISE tutorials
        YouTube Channel - Public HISE tutorials

        LindonL 1 Reply Last reply Reply Quote 0
        • LindonL
          Lindon @d.healey
          last edited by

          @d-healey Yeah putting the h3x values in quotes seems to have worked...I should have tried that earlier - t-shirt time...

          HISE Development for hire.
          www.channelrobot.com

          1 Reply Last reply Reply Quote 1
          • First post
            Last post

          43

          Online

          1.8k

          Users

          12.0k

          Topics

          104.4k

          Posts