How to change a different color-specific colors in Illustrator javescript

Hello

How to change a different color-specific colors in Illustrator javescript

Of (Scolor specific)

C:85

Y:50

M:0

K:0


To (wasnother color)

C:50

Y:100

M:0

K:0

Screen Shot 2016-02-13 at 6.41.04 PM.png


I'm sure of if statement in the code change could be cleaned.

but this should work for you.

function reColorSelection(){  

    var col = new CMYKColor;
    col.cyan = 50;
    col.magenta = 100;
    col.yellow = 0;
    col.black = 0; 

    var oldCol = [];
    oldCol.C = 85;
    oldCol.M = 50;
    oldCol.Y = 0;
    oldCol.K = 0;
    oldCol.tolerance = 1;

    var sel = app.activeDocument.selection;
    for(var i=0; i < sel.length; i++){
        if(sel[i].typename === "CompoundPathItem"){
            for(var j=0; j< sel[i].pathItems.length; j++){
                modify(sel[i].pathItems[j]);
            }
        }
        modify(sel[i]);
    }  

    function modify(obj){
        if(obj.fillColor.cyan >= (oldCol.C-(oldCol.tolerance/2)) && obj.fillColor.cyan < (oldCol.C+(oldCol.tolerance/2))
            && obj.fillColor.magenta >= (oldCol.M-(oldCol.tolerance/2)) && obj.fillColor.magenta < (oldCol.M+(oldCol.tolerance/2))
            && obj.fillColor.yellow >= (oldCol.Y-(oldCol.tolerance/2)) && obj.fillColor.yellow < (oldCol.Y+(oldCol.tolerance/2))
            && obj.fillColor.black >= (oldCol.K-(oldCol.tolerance/2)) && obj.fillColor.black < (oldCol.K+(oldCol.tolerance/2))){
                obj.filled = true;
                obj.fillColor = col;
        }
    }
}
reColorSelection();

Tags: Illustrator

Similar Questions

  • How to change all the colors specific to another color.

    Can someone tell me how to change all the colors in Illustrator by another color at a time.

    I've worked in Freehand, and you can select all, go in a Panel and make the change

    all from one color to another in a layout.

    Exp. You can change pms 356 to pms 410 without selecting each one individually.

    I can't find this feature in Illustrator CS4

    Any help appreciated

    HJMann42

    Left is simple to do, said Kurt.

    Go to the Swatch Panel, select pms 401 that cmd select pms 356 go to the menu drop down and select Merge shades.

  • How to change the text color in CS4

    Hey everybody. I know I'm not comfortable in Dreamweaver, but had DW8 before moving to CS4 and I'm pretty handy with it. In version 8, if I wanted to change a text color, I simply highlighted text and choose a color. No worries.

    However in CS4, I seem to be only have this ability in my CSS, (not the HTML properties) properties. Then, when I try to change the color, it gives me a dialog box asking questions such as 'new CSS', 'for this page only", etc. and I don't understand what I'm supposed to do.

    Can someone tell me in a friendly way (step by step) how to change just one color of text on a page? I went to help and he said to use the color picker, but brings back me to my original problem.

    I'm either something terribly wrong or ADOBE did a simple task in the brain surgery!

    Thanks in advance for the help!

    Mark

    Use an external stylesheet for wide site styles.

    Use CSS for specific styles of the page code.

    Let your only SpryMenu.css.

    Related link.

    Link external style sheets to HTML pages in DW:

    http://ALT-Web.com/demos/DW-link-stylesheet.shtml

    Nancy O.
    ALT-Web Design & Publishing
    Web | Graphics | Print | Media specialists
    http://ALT-Web.com/
    http://Twitter.com/ALTWEB
    http://ALT-Web.blogspot.com

  • How to change the font colors in the communities of support?

    How to change the font colors in the communities of support?

    Thank you

    Press or click on use the Advanced Editor in the upper right of this text block which will take you to it.

  • How to change the background color of string programmatically?

    How to change the background color of string programmatically?

    Are you talking about string indicator and control chain? If so, right-click on a control/indicator of string and select Create-> property Node-> text-> text-> BG Color colors. Change to write and a number of the color you want to use phone.

  • How to change the highlight color for windows 7 (select the file or folder)?

    How to change the highlight color for windows 7 in the aero theme (select the file or folder)?

    You can change the font size because it is not a widget.   To do this:

    1 type dpi in your Start menu search box, and then choose make text and other more or less important.
    2 - Choose a size you prefer
    3 - Click on apply.
  • How to change the background color

    How to change the background color of the label field, how to do it thanks

    I can change the color of labelfield, but I want to change the background,

    How can I do this

    Thank you.

    I do not know mantaker do not want to forget the call to super...

    public void paint (Graphics gs) {}

    gs.setBackgroundColor (0x00FF0000); red background

    GS. Clear();

    Super.Paint (GS);

    }

  • How to change the background color dynamically on the page of the ofa

    How to change the background color dynamically on the page of the ofa

    Hello

    Can you please let me know the dynamic conditions to change the background color?

    Thank you

    Vincent

  • How to change the background color of the code written DW page but not the Web page...

    How to change the background color of the code written DW page but not the Web page...

    If you have DWCC2015, you can change to edit > Preferences > coloring Code and either choose a new theme (RecoGnEyes is the background dark code by default) or you can change it to what you want in the background field by default.

    2014 CC had no theme options, but you can change the background color in the same place.

    I think that some of the previous versions also had the option, but I don't have them on my machine to check.

  • How to change the background color of work in Photoshop CC 2015 plan

    How to change the background color of work in Photoshop CC 2015 plan

    Just tried to change these settings:

    Preferences-> Performance-> settings of the graphics processor-> advanced settings... The change of drawing in 'Normal' mode (mine was 'Basic'). Suddenly I can not change the background.

    Hope this works for you all also.

  • I NEED TO KNOW HOW TO CHANGE THE BACKGROUND COLOR OF MY INDEX FINGER. HTML PAGE

    I need to know how to change the background color of my page index.html on Dream weaver cs6.

    With CSS:

    {body

    background-color: #FF0000;

    }

    Nancy O.

  • How to change the background color of selection of the selected item in the drop-down box of choice?

    How to change the background color of selection of the selected item in the drop-down box of choice?

    By default, the selection background color like 'blue', but if I want it to be "yellow" for example, how should I do?

    Thank you

    The id is applied by (I think) the skin of the ChoiceBox class. You don't need to define.

    You must apply the css in an external style sheet. You can apply the external style sheet to any parent of the box of your choice, or on-site (the most usual way to do it).

    Example:

    import java.util.ArrayList;
    import java.util.List;
    
    import javafx.application.Application;
    import javafx.scene.Scene;
    import javafx.scene.control.ChoiceBox;
    import javafx.scene.layout.VBox;
    import javafx.stage.Stage;
    
    public class ChoiceBoxTest extends Application {
    
      @Override
      public void start(Stage primaryStage) throws Exception {
        primaryStage.setTitle("Example 2");
    
        final ChoiceBox choiceBox = new ChoiceBox<>();
    
        List tempResult = new ArrayList();
        for (int i = 0; i < 10; i++) {
          tempResult.add("Item " + i);
        }
        choiceBox.getItems().setAll(tempResult);
    
        VBox root = new VBox();
        root.getChildren().add(choiceBox);
        final Scene scene = new Scene(root, 300, 250);
        scene.getStylesheets().add("choiceBox.css");
        primaryStage.setScene(scene);
        primaryStage.show();
      }
    
      public static void main(String[] args) {
        launch(args);
      }
    
    }
    

    choiceBox.css:

    @CHARSET "UTF-8";
    #choice-box-menu-item:focused  {
     -fx-background-color: yellow ;
    }
    #choice-box-menu-item .label {
     -fx-text-fill: black ;
    }
    

    Post edited by: James_D

  • How to change the highlight color, click the button image and text and sound.  are there packages of buttons for use in my project?

    How to change the highlight color, click the button image and text and sound. are there packages of buttons for use in my project?

    Hello

    Even if the point of things based Web links buttons created using them is of simple images. Captivate uses simple images. If you need to put your creative hat and not to let the fact that you see the word 'web' scared you somehow. An image is an image. Use on the web, use Captivate. Same case!

    If you change the properties of the button, you can activate the legend of success. Fix any sound that you like with the legend of success and it will play when you click the button. If you do not want to see the legend of success, delete the text and configure it as transparent.

    See you soon... Rick

    Useful and practical links

  • How to change the background color of some rows in a Datagrid?

    How to change the background color of some rows in a Datagrid?

    Hee is an excellent example:
    http://www.CFLEX.NET/showfiledetails.cfm?channelId=1&object=file&ObjectID=487

    Tracy

  • How to change the background color of a single line

    Hi, OTN,.

    I use JDeveloper with ADF faces 11.1.1.2 in the view layer. My question is how to change the background color of a single line in af:table?.

    Hi idir Mitra
    You can use EL to bind column for example inlineStyle (#{row.id == null?' background-color: rgb (255,214,165);':'background-color:red'})})

    Cordially Abhilash.S

Maybe you are looking for