Using array to generate fill colors

I'm building a series of swatch books from an Excel file that lists the RGB values for each color (2,000+). I'm brand new to extendscript and would appreciate some help dynamically filling all those rectangles with the proper color. A model script fragment showing how to fill shapes would be great. I think I have a handle on creating and positioning the objects. Thanks!
Oh, I'm using javascript.

search the forum, you'll find a couple of scripts already made.
here's one
Colour Swatch Book Generator

Similar Messages

  • Select same fill color/stroke color but not for entire document

    As the title imply's, I am wondering if there is a way to use the "select same fill color" and/or "stroke color" for just a group of objects in a document as opposed to document-wide.
    Thanks for any help you can provide!
    Tony

    Did you make the group into an isolation group?
    ( in the Control bar.)
    Or else you can select the objects you want to change, then Select Inverse and lock or hide.
    Isolation groups are usually handy for this kind of work though.

  • Using PHP to generate images in alternate colors

    I have a PNG image of a black silhouette graphic with
    softened edges against a transparent background.
    Can I use PHP to generate this image in alternate colors
    (allowing the black graphic to be displayed in a color other than
    black)?

    AngryCloud posted in macromedia.dreamweaver:
    > I have a PNG image of a black silhouette graphic with
    softened
    > edges against a transparent background.
    >
    > Can I use PHP to generate this image in alternate colors
    > (allowing the black graphic to be displayed in a color
    other than
    > black)?
    I have no experience with this, but I was just poking around
    in the GD
    references and found a comment on imagefill() that might
    help:
    http://us.php.net/manual/en/function.imagefill.php
    Comment:
    http://us.php.net/manual/en/function.imagefill.php#81873
    Or you may need to work with some of the other alpha
    functions.
    Mark A. Boyd
    Keep-On-Learnin' :)

  • Three Numbers questions:how do you change the auto default background or fill color from white to another color to use in multiple succeeding operations?  what is the formula to express the ratio of two numbers as a percent?

    Numbers questioons:
    -how do I change the automatic default background fill color so it stays a non white color?
    -what is the formula to express the ratio of two numbers as a percentage?
    -how do I create a signal formula to be sue against an entire column of data (for example, if I wanted to multiply the each cell in the column by the number 10)?
    -I have created a spreadsheet in Numbers with header and rows labelled and it contains formulas as well.  I now want to create a new 'blank' of this template with same header and row names and formulas, but without the cell entries from my earlier exerciser so I can use again in the future. How do I do this?

    Hi Matt,
    For short columns, the easiest method is to select the cell containing the formula, then grab the fill handle (small circle at the botom right of the selected cell) and drag down.
    For long columns, use either Jerry's suggestion (copy/paste) or Insert > Fill > Fill Down.
    Copy/Paste:
    Select the cell containing the formula. Copy
    Select from the cell containing teh formula to the end of the column. Paste.
    Fill Down:
    After entering the formula, and pressing enter...
    Click on the column reference tab to select the whole column.
    Command click on each cell above the one containing the formula to remove it from the selection.
    When cell with the formula is the top cell in the selection, go Insert > Fill > Fill Down.
    Pick whichever is easiest.
    Regards,
    Barry

  • How to use AppleScript to set "character fill color" in Pages 5.2?

    For Pages 5.2 on OSX 10.9.3, what is the correct applescript for changing the "character fill" of text in pages. 
    If you highlight text, you do this via your mouse in the inspector by clicking "style," "advanced option (the gear wheel to the right of bold, italics, and underline), "character fill color (clicking on the multi-color circle, not the dropdown menu), and then choosing a color that comes up in the "colors" dialogue box.
    I've looked all over and cannot find how to use applescript to set the character fill color in pages. 
    In some examples (not directly related) I see "character fill" used. 
    In others, I see "colorfill." 
    Basically, I want to use applescript, embedded in a keyboard maestro macro, to change the background color of the text (not the text color itself) to particular colors. 
    Given the changes and updates to Pages this year, and to applescript, what's the easy way to do this?
    Thanks!
    Chuck

    Pages v5.2 still does not include selection-object, or character background color entries in its AppleScript dictionary, as does Pages ’09. Indirectly, using System Events, you can get the text selection in Pages v5.2, but then you can do nothing to change the selection. No assurances as to if or when Apple will mature the AppleScript dictionary support for Pages v5 series.

  • Graphic styles that use current fill color instead of stomping them?

    Sorry if this is a really stupid, newbie question; I am a stupid newbie.
    If I make a graphic style/appearance, it stores the colors of the fill and stroke and will then stamp that down on whatever else I apply it to (obviously). e.g. if I make a graphic style of a pale yellow fill and a bright orange dropshadow screen to make a glowing neon kind of look, and then drop that style onto a bright blue star, it will make the star pale yellow.
    Is there a way to do a graphic style that _modifies_ the existing appearance instead of stomping it - e.g. dropping that graphic style on my blue star would make a pale blue fill with a bright green dropshadow screen.
    e.g. A graphic style that said "make the new fill 110% value, 85% saturation, same hue as the existing fill color, add a 25 pt dropshadow that has the color of 90% value, 110% saturation, -3 hue of the existing fill color." And then that style dropped on a yellow star and a blue star would result in a glowing neon yellow star and a glowing neon blue star.
    The reason I ask: I have a bunch of geometric shapes of various shades of red, orange, yellow and brown, and would like to see what they would all look like with dropshadows of dark, very desaturated complementary colors (the orange shape gets a dark blue/gray dropshadow, the yellow shape gets a dark purple/gray dropshadow, etc.). Do I have to go in and modify each appearance by hand, or is there some way I can automate that?
    Thanks, and apologies if this is a really obvious question.
    Ken

    You won't get as much control as you describe (specific HSV values), but try putting a negative value in the Drop Shadow dialog's Darkness field.
    To create a Graphic Style that can apply an Effect without disturbing the existing fill/stroke of the object(s), first group the object(s), then apply the Effect (Drop Shadow, etc.) to the Group, and then drag the Group to the Graphic Styles palette.

  • Using a formula to fill a field

    Post Author: dura13
    CA Forum: Formula
    Hi
    Is there a means to use a formula to fill a field or add a filled text box.
    I have a report that shows monthly sales for a year and i'm building a EOQ report that has a variable time frame (ie 5mnths, 6mnths,1 mnth, etc) that the user chooses to generate the EOQ numbers. I want to fill the monthly totals for the timeframe selected so they are highlighted and easier to distinguish on the report.
    I've grouped the data by product and total sales for each month using whileprintingrecords. In this while printing records i'd like to fill or create a text box around the monthly total if the monthly timeframe is equal to or less than this month.
    Is this possible?

    Post Author: dura13
    CA Forum: Formula
    I finally found the solution to this. It so much easier figuring out logic than the fancy bells and whistles to make the report work.
    I used the format field and entered my formula into the background formula area.
    I prompt the user for the number of months to go back to determine the avg monthly sales.
    I then use this prompt in each months field :
    IF 1 <= {?months}  *this is the first months total field*
    then
        craqua
    else
       crnocolor
    and repeat for each of the 12 months, using  IF 2 <=, IF 3 <=, etc
    Prob will try to get this to work for the font color as well by printing the font in black if its one of the months included and grey if its not.

  • I want to use the Function Generator VI to send command signals through the NI 7344 motion controller. This will be a closed loop servo valve system. I want to be able to change from say a square wave to a sine wave on the fly. Idea's?

    I am going to run tests that require an actuator to move using various types of arbitrary waveforms such as sine or square. The NI 7344 is hooked to the UMI that is going through a driver for a servo valve. The loop is analog and it is closed. I have played with some of the examples but can't get it to work. I have used the function generator VI to generate a signal but I think I am using the wrong input VI to the motion control board. When I use what I have it moves the servo and then stops. It doesn't continually generate the signal.
    I would love to use the controls on the function generator vi to control frequency and amplitude ect. Any help or pointer would be helpful. Thank you in advance.

    Hello,
    I'm not clear on exactly how you want to use the generated data but I'm assuming they will be used as your target points.
    There's a built-in example for motion called 'One-Axis Contour Move.vi'. This example demonstrates how to provide your target points as 1-D array. All you need to do is to replace the input array with the output of the function generator. In order to have it run continuously, use a while loop. You can further program your application so that it'll change the waveform on the fly by monitoring the user interface but this might be little little tricky as you will need to reset the move and load the new generated points while keeping track of your current position.
    I hope this helps. Let me know if you have further questions regarding this
    application.
    Best regards,
    Yusuf C.
    Applications Engineering
    National Instruments

  • Using mathscript to generate multiple digital outputs for switch control

    Hello 
    I am new to this NI LV and a have kind of a basic question. I would like to use Mathscript to generate an array of bolean numbers which will be used to control the Digital I/O lines. I am using NI 6251 USB device and the Mathscript code runs well. But I have a problem using this array to control the Digital output. So I created a simple test programme where I set the DAQ assitant to generate 4 digital outputs(P0.0 ~ P0.3) and it gives error that  ".. number of channels in the data does not match the number of channels in the task..." (see attachment) . How can I solve this problem thank you.
    Attachments:
    K-9.jpg ‏36 KB

    looks like you did not initialize all 4 of the elements in the bool array....

  • Can I change the fill color of an entire row based on what's selected in a pop-up menu in the first cell?

    I have a pop-up menu in the first cell of every row with three choices (and I may add more at a later date).  I want the fill color of the row to change depending on which thing is selected.  Is this hard to do?

    Hi,
    In essence the same as Wayne's answer, but with a slight modification to fit  to duplicate your 'color the whole row' specification. The final result, with Table 2 slid behind Table 1, is shown.
    Table 2 is a single column table with the same number of rows as Table 1. The table is resized to match the full width of Table 1.
    In A2, use the formula =Table 1::A2 to copy the value from that cell in Table 2. Fill the formula down through the rest of the column.
    Select all the cells in Table 2 (except the header row), and apply conditional formatting rules such as those below.
    Note that the Conditional Format rules are set to apply the same colour to text and fill in the cell, so that the text disappears.
    When Table 2 is ready, select it, then go Arrange > Send to Back.
    Before sliding Table 2 behind Table 1, Select Table 1 and use the Table Inspector to set the Cell Background to None (see red arrow in illustration). If This table has a Header column, you need to select the header cells independently and again set the Cell Background to None.
    Now select Table 2 and drag it to a position partially under Table 1. When you see the blue alignment guides on both sides, or at the top and bottom, of Table 1, release the mouse button and use the arrow keys to nudge Table 2 into its final position.
    Regards,
    Barry

  • How can I select and delete the fill color (white background) of a live trace (B&W) with in an actio

    How can I select and delete the fill color (white background) of a live trace (B&W) with in an action set?
    Illustrator CS4 in windows XP.

    Maybe Li[ve trace] is not t]he way[ to go
    I have some suggestion one leave it as is and use a blending mode of multiply to give it a color background like this
    leave it as is make it a grayscale tiff import int Illustrator and color it it in Illustrator like this
    Or trace over it with the brush tool aand then give it a color ground.
    Or do the original over and do a cleaner job with no tone or a minimum of tone. Then Live trace.

  • Changing the button fill color in Captivate 7?

    I am pretty sure that when I used Captivate 6 and I created a button, there was an option in the Properties pane to allow me to change the fill color of the button. I am using Captivate 7 now, and I no longer see this option. Under the "General" tab, it allows me to change the button type, caption, make it transparent, or allows me to see button widgets. Did they remove the ability to simply change the fill color of a button?

    I'm wondering if this is something that was maybe added in a service release. Either that or you may need to reset your preferences.
    Mine has a section titled Fill & Stroke as shown below.
    Cheers... Rick

  • Help using arrays in java

    HI all,
    I am working on a program that will print out my initials 'A' and 'T' using arrays. I am asked to initialize the first intial to '*' and the second intial to '@'. I wrote the code but the output is wrong. Can someone help me by letting me know what I am doing wrong in my arrray?I just get back my array of 30X30. I also wrote a driver but when I run the program, I really appreciate it so much.
    public class Initial
         private char whichinitial ;
         private int MAX =30;//Maximum amount for 2-d Matrix
         char[][] letterMatrix = new char[MAX][MAX];//2-d Array 30 x30
         private boolean first = true;
         public Initial()
         { //FIlls Array full of '*'s
              whichinitial = '*';
              for(int i=0;i< MAX;i++)
                   for(int j=0;i< MAX;i++)
                        letterMatrix[i][j] = whichinitial;
         public void setLetter(char letter)
         {//Setter for Letter
               whichinitial = letter;
         public char getLetter()
         {//Getter for Letter
              return whichinitial;
         public void firstLetter()
         { //Creates an A shape
              for(int i=0;i< MAX;i++)
                for(int j=0;j< MAX;j++)
                      if((i>0)|| ((i<6) || ((j>0) && (j<29))))
                         letterMatrix[j] =whichinitial;
         public void secondLetter()
         {//Creates an T shape
              first = false;
                   for(int i=0;i <MAX;i++)
                   for(int j=0;j <MAX;j++)
                        if((i>1) ||(j < 29)||(j>5)||(i>10))
                             letterMatrix[i][j] = whichinitial;
         public void display()
         {//Displays the Initials
              if(first)
                   System.out.println("\n \n \n My First Initial," + whichinitial + ", follows:");
              else
                   System.out.println("\n \n \n My Last Initial," + whichinitial + ", follows:");
                   for(int i=0;i <MAX;i++)
                        System.out.println();
                        for(int j=0;j <MAX;j++)
                             if(letterMatrix[i][j] == '*')
                                  System.out.print(" ");
                             else
                                  System.out.print(letterMatrix[i][j]);

    I am trying to write a program using a matrix. The size of the maxtrix should be 30X30. The first initial shoulld be initialized to '*' and the secind initial should be initialized to '@'. Both initials should be 30 characters high and 30 characters wide and the initials should also represent the uppercase letter of your initials. I know that the first initial's matrix needs to be filled up vertically and the second initial needs to be filled horizontally but the output is wrong....PLease Help!
    Message was edited by:
    apples03

  • Create a Panel skin (Spark) with a background fill color I can pass as a parameter

    Hi,
    I'm trying to create a Panel skin (Spark) with a background fill color I can pass as a parameter.
    (See in bold:)
    <?xml version="1.0" encoding="utf-8"?>
    <s:SparkSkin name="CustomPanelSkin"
                                   xmlns:fx="http://ns.adobe.com/mxml/2009"
                                   xmlns:s="library://ns.adobe.com/flex/spark"
                                   xmlns:fb="http://ns.adobe.com/flashbuilder/2009"
                                   blendMode="normal">
              <s:states>
                        <s:State name="normal" />
                        <s:State name="disabled" />
                        <s:State name="normalWithControlBar" stateGroups="withControls" />
                        <s:State name="disabledWithControlBar" stateGroups="withControls" />
              </s:states>
              <fx:Metadata>
                        [HostComponent("spark.components.Panel")]
              </fx:Metadata>
              <s:Group left="0" right="0" top="0" bottom="0">
                        <s:Rect
                                  left="0" right="0"
                                  top="0" bottom="0"
                                  radiusX="12" radiusY="12">
                                  <s:fill>
                                            <s:SolidColor color="#184c81" />
                                  </s:fill>
                        </s:Rect>
                        <s:Group id="contents"
                                             left="1" right="1" top="1" bottom="1">
                                  <s:layout>
                                            <s:VerticalLayout gap="0" horizontalAlign="justify" />
                                  </s:layout>
                                  <s:Group id="contentGroup"
                                                       width="100%" height="100%" minWidth="0" minHeight="0">
                                  </s:Group>
                        </s:Group>
              </s:Group>
    </s:SparkSkin>
    From what I read I should create a subclass, but there is not much material on the subject.
    I would later on want to use this skin in many Panel controls I have in my application.
    Thanks for the help.

    Did you read this?
    http://www.adobe.com/devnet/flex/articles/flex4_sparkintro.html

  • Using arrays in JAVA

    Hi Guys,
    I always had a few problems using arrays and now I need to use them and I am stuck.
    on my program i need to create an array of int with the numbers 1 to 1000 in it for this I have done:
    int[ ] array;
    on the class constructor
    array = new int[1000];
    to fill the array:
    for (int i = 0; i < array.length; i++)
         array[i] = i;
    The problem is that I always get an ArrayIndexOutOfBoundsException error.
    I know how to solve it which is to create an array with 1001 elements but is there a more elegant way of creating the array or this is the way to do it?
    To put my question in another way if any of you Guys was creating this program which way would you do it.
    Best regards
              Luis

    Sloppy of me. This is a bit better:
    package cruft;
    import java.util.Arrays;
    * A class for a one-based array of ints.
    public class OneBasedIntArray
       private int [] values;
       public static void main(String[] args)
          int [] values = new int[args.length];
          for (int i = 0; i < args.length; i++)
             values[i] = Integer.parseInt(args);
    OneBasedIntArray intArray = new OneBasedIntArray(values);
    System.out.println(intArray);
    public OneBasedIntArray(int[] values)
    this.values = new int[values.length];
    System.arraycopy(values, 0, this.values, 0, values.length);
    public int getValue(int index)
    if (index <= 0)
    throw new IllegalArgumentException("this array is one-based");
    return values[index-1];
    public void setValue(int index, int value)
    if (index <= 0)
    throw new IllegalArgumentException("this array is one-based");
    this.values[index-1] = value;
    public boolean equals(Object o)
    if (this == o)
    return true;
    if (o == null || getClass() != o.getClass())
    return false;
    OneBasedIntArray intArray = (OneBasedIntArray) o;
    if (!Arrays.equals(values, intArray.values))
    return false;
    return true;
    public int hashCode()
    return (values != null ? Arrays.hashCode(values) : 0);
    public String toString()
    StringBuilder builder = new StringBuilder();
    builder.append("OneBasedIntArray{");
    for (int i = 0; i < values.length; i++)
    builder.append("(").append(i+1).append(",").append(values[i]).append(")");
    builder.append('}');
    return builder.toString();

Maybe you are looking for