1 Reply Latest reply on Oct 15, 2015 7:29 AM by RenoMcK

    Trouble with adding a swatch (script)

    RenoMcK Level 1

      So Im able to add a color swatch however it always turns out black. The documentation is rather rough so I thought I would ask the community after an hour or so of struggling. Funny enough, the swatch does get named and it complains if I dont give swatch.color a object... so I feel I am on the right track. Ideas?

       

      My script is to take a series of hex values, convert them to RGB and make 4 swatches.

      Illustrator Swatch - Pastebin.com

      ps: you can enter "http:// colorhunt.co/#00c3ffb463a65c49783b475e" into the text field.

       

      Thanks for looking!

        • 1. Re: Trouble with adding a swatch (script)
          RenoMcK Level 1

          I ended up using this for debugging:

           

          //debugging

            var output = '';

            for (var property in swatch) {

             output += property + ': ' + swatch[property]+'; ';

            }

            alert(output);

           

          I was able to determine that it is colorswatch.cyan instead of colorswatch.c. Not only that but I couldn't get RGB to work correctly. Upon examination, even after declaring the object from RGBColor(), it came out as a CMYK based object. Possibly as a fallback?

           

          So im marking this as solved . I just wanted to post in here for others who amy find this in google.