How to get the fill color of a shape or solid color fill layers?

Hi all

I'm trying to get the values of the fill color of a shape or solid color fill layers.

I get the nature of the layer active i.e. SOLIDFILL, but there is no color as a property to get the color of the shape or solid color fill layers.

Y there is it possible or a script to do this?

Please help me on this.

Thank you
AI

I didn't bother to check the type of the active layer, but if a solid color layer is selected it should help.

// based on code by michael l hale;
var ref = new ActionReference();
ref.putEnumerated( charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
var layerDesc = executeActionGet(ref);
var adjList = layerDesc.getList(stringIDToTypeID('adjustment'));
var theColors = adjList.getObjectValue(0).getObjectValue(stringIDToTypeID('color'));
var str = '';
for(var i=0;i 
         

Tags: Photoshop

Similar Questions

  • How to get the RGB color values on the color picker component?

    How to get the RGB color values on the color picker component?

    trace (cp.selectedColor);

    Returns something like:

    16750950

    trace (key2cp.hexValue);

    Returns:

    ff9966

    I'm looking for RGB, for example, 0.5 0.5 0.5, corresponding to a gray color.

    Is there a chance that the RGB settings are hidden somewhere or is there a conversion function at least?

    Thank you.

    If key2cp.hexValue returns a string like 'abcdef', use:

    var s:String = key2cp.hexValue;

    var n: Number = Number("0x"+s);

    var r: Number = n > 16 & 0xff;
    var g:Number = n > 8 & 0xff;
    var b:Number = n & 0xff;

  • How to get the outline color and size of the rectangle?

    Hi all

    I'm developing an extension for CS5 and higher (including the CC version). I want to get the outline color and size of a rectangle. I was able to do in CS5. But I noticed that in the version of the CC, there are two ways in which the user can apply to a stroke. One is by applying the effect in the layer Style, and the other through the properties panel. I am able to get the values of time in my script, if it is applied through layer Style, but I can't do it in the other scenario.

    How are these two different traits and how do I get the outline color and size if it is applied via the properties panel using script?

    Thank you!

    Here's what I have so far. It takes more work, but I don't think that's never very accurate.

    function toggleOtherLayersVisibility() {
        var desc = new ActionDescriptor();
            var list = new ActionList();
                var ref = new ActionReference();
                ref.putEnumerated( charIDToTypeID('Lyr '), charIDToTypeID('Ordn'), charIDToTypeID('Trgt') );
            list.putReference( ref );
        desc.putList( charIDToTypeID('null'), list );
        desc.putBoolean( charIDToTypeID('TglO'), true );
        executeAction( charIDToTypeID('Shw '), desc, DialogModes.NO );
    };
    function liveShapeFillEnabled( enable ) {// boolean
        var desc = new ActionDescriptor();
            var ref = new ActionReference();
            ref.putEnumerated( stringIDToTypeID('contentLayer'), charIDToTypeID('Ordn'), charIDToTypeID('Trgt') );
        desc.putReference( charIDToTypeID('null'), ref );
            var shapeDesc = new ActionDescriptor();
                var styleDesc = new ActionDescriptor();
                styleDesc.putInteger( stringIDToTypeID('strokeStyleVersion'), 2 );
                styleDesc.putBoolean( stringIDToTypeID('fillEnabled'), enable );
            shapeDesc.putObject( stringIDToTypeID('strokeStyle'), stringIDToTypeID('strokeStyle'), styleDesc );
        desc.putObject( charIDToTypeID('T   '), stringIDToTypeID('shapeStyle'), shapeDesc );
        executeAction( charIDToTypeID('setd'), desc, DialogModes.NO );
    };
    function dupeVisibleMerged() {
        var desc = new ActionDescriptor();
        desc.putBoolean( charIDToTypeID('Dplc'), true );
        executeAction( charIDToTypeID('MrgV'), desc, DialogModes.NO );
    };
    function loadTransparency(){
        var desc = new ActionDescriptor();
            var ref = new ActionReference();
            ref.putProperty( charIDToTypeID( "Chnl" ), charIDToTypeID( "fsel" ) );
        desc.putReference( charIDToTypeID( "null" ), ref );
            var ref1 = new ActionReference();
            ref1.putEnumerated( charIDToTypeID( "Chnl" ), charIDToTypeID( "Chnl" ), charIDToTypeID( "Trsp" ) );
        desc.putReference( charIDToTypeID( "T   " ), ref1 );
        executeAction( charIDToTypeID( "setd" ), desc, DialogModes.NO );
    };
    function getLiveShapeStrokeInfo(){
        var doc = app.activeDocument;
        var lyr = doc.activeLayer;
        liveShapeFillEnabled( false );
        toggleOtherLayersVisibility();
        doc.artLayers.add();
        dupeVisibleMerged();
        var bounds = doc.activeLayer.bounds;
        var horzCenter = (bounds[2]-bounds[0])/2;
        var vertCenter = (bounds[3]-bounds[1])/2;
        lyr.visible = false;
        var sampler = doc.colorSamplers.add([bounds[0]+UnitValue(.5,'px'),bounds[1]+vertCenter]);
        sizeObject.color = sampler.color;
        loadTransparency();
        doc.selection.select([
                                [bounds[0],bounds[1]+vertCenter],
                                [bounds[0]+horzCenter,bounds[1]+vertCenter],
                                 [bounds[0]+horzCenter,bounds[1]+vertCenter+UnitValue(1,'px')],
                                 [bounds[0]+UnitValue(1,'px'),bounds[1]+vertCenter+UnitValue(1,'px')]],SelectionType.INTERSECT);
    
        sizeObject.size = doc.selection.bounds[2]-doc.selection.bounds[0];
    };
    var sizeObject = {};
    app.activeDocument.suspendHistory('Get Live stroke info','getLiveShapeStrokeInfo()');
    executeAction( charIDToTypeID('undo'), undefined, DialogModes.NO );
    sizeObject.size;
    
  • How to get the background color of a layer with AE SDK

    Hello

    I try to get the background color for my current layer, but I can't seem to find how do.

    I don't want background color, background color of the application, but the color that shows through, if I set the alpha of my pixels to 0.

    For example, assume that the background of the composition is black, I put a solid top, green then put a picture on top of the solid and apply my pug-in the image.

    If I set the alpha to zero in my plug-in, green solid will be displayed.

    So I want to be able to know that my background is green.

    I tried to use PF_AppGetBgColor(), but which returns the background color of the application, which isn't green in this example.

    If you want more details on what I want to do, I plug P1 which affects some 0-alpha pixels. Above it, I apply an another plugin P2 which reveals alpha-0 pixels by mixing with little color.

    What is happening now is that the output is color of the original image, mixed with the color of P2 (because only modified P1 alpha pixels).

    What I want is to have the color through the transparent pixels of P1 display mixed with the color of P2.

    To do this, I would like to be able to set the color of pixels 0-alpha in the color of the background in P1.

    Sorry for the question long.

    Thanks for your suggestions.

    Hello nicolas.

    If I understand it, that you try to get the buffer of image layers composited under the layer with your effect.

    If that is correct, then I fear that it is almost impossible to do.

    When AE makes a composition he doesn't it down. He's trying to do the opposite in fact.

    Why? because if at some point, the buffer is completely opaque, then he has no need to make what's below.

    further more, checked the diaper changing the rendering order, and many other things affect the rendering of the layers order.

    In addition, there is no API to access buffers intermediaries comp. just the end result.

    the closest you can get than without turning of the world, is to use AEGP_GetCompBGColor().

    that would be useless to you that the image is not composite on that color, unless it is the model being saved to the file.

    so why I said 'almost impossible '?

    You can transform the world.

    You can write a type ECAP 'craftsman '. (look at the example of 'arti')

    These plug-ins make comps (instead of the "advanced3D" converter)

    a craftsman has results intermediaries comp, because he is the one doing the rendering.

    so now you can have your craftsman save the buffer, you need and deliver it to your effect.

    I must warn you that this is very very very difficult.

    Another possible solution is to create a copy of the model resides in your effect,

    erase all the layers that has the image you need and make that reproduces model using AEGP_GetReceiptWorld().

    If you use this method, you must supervise the original model and apply changes to the copy.

    Yes, it's too difficult to do.

    you could make a change in the strategy and apply your effect to an adjustment layer instead.

    the entry for the adjustment layer is the buffer underlying layers.

    Then, you could get the original sources you want to treat using checked layer params.

    the last solution I can think uses the expression of sampleImage() on a hidden parameter.

    This will give you any layer's pixel data in the model, but not the composite of the underlying layers.

    Maybe if you tried sampling adjustment layers post effects... I don't know. you need to try.

    This method is very slow and is also limited to expire, so you can't get a large number of pixels.

    the expression simply fails.

    I hope that this was not all bad news for you.

    Maybe you said more about the plug-in you develop I could come up with a better plan.

    :-)

  • How to get the background color setting after accidentally change?

    Original title: background and other color changes
    I changed the background color by accident and cannot get the original settings that I had back

    Hello

    1. who is the operating system installed on the computer?
    2. what was the background color and what color you have changed from?
    3. What are other color changes you're talking about?
    4. What are the steps you did to change the background color?
     
     
    If you work on a windows 7 OS then try the steps in the following article and check the status of the issue.
     
     
    I hope this helps!
  • FrameMaker10 - Windows 7 - How to get the background color of a paragraph tag?

    2-27-2013 1-38-39 PM.png

    I'm trying to create my heading1 with a background like the picture above.

    I put the blue background on a master page, but the chassis will in the background blue and later blue background does not show through.

    Any ideas?

    Thank you

    Cindy

    Cindy,

    You must create a specific master page for the opening/first chapter page that contains two connected text frames. The most senior executive would have the blue background and be served for the title. The following text block would get the text and have two columns.

  • How to get the gradient in Illustrator fill color

    I have the draw button for the web in Adobe Illustrator format. I'm trying to get the fill parameters to create the same look with CSS. I can't find what color to use and gradient settings.

    button-problem.png

    Eugene,

    In the drop-down window (in the line on the very top starting with file), you can check degraded, and if yes, what happens?

  • How can I get the tabs colorful to use different distinct colors for 2 gmail accounts?

    Under Firefox 29.0.1 iMac OSX 10.9.3. I have multiple Google accounts: 2 1 Google Calendar and gmail accounts. Colorful tabs add-on will allow me to choose a color for a gmail account, but it also uses this same color for the other gmail account. How can I get the different colors on 2 gmail accounts?

    In addition, colorful tabs is also the same for my homepage (google.com) and my google calendar. How can I get different colors on these 2?

    Personally, I use 'Fabtabs' for my mozilla FireFox.

    https://addons.Mozilla.org/en-us/Firefox/addon/FabTabs/

    This add-on has problems like that when I use it.

  • The knife tool develops a black line on the objects that I colored using the live paint bucket. How to get the tool knife to stop this and instead of being invisible?

    The knife tool develops a black line on the objects that I colored using the live paint bucket. How to get the tool knife to stop this and instead of being invisible?

    I understand that it is a live paint object you use.

    Try this:

  • How to get the color and stroke of ComboBox

    I would get the selected color and stroke selected ComboBoxes to print these values as strings in an .ini file to save the settings.

    Here is my example http://s24.postimg.org/q59kivgxh/Z055.png where I have a scene with ComboBoxes.List

    The list of colors is an ObservableList in the classroom

    public class ComboBoxColorCellFactory {
      
     public static  ObservableList<String> colorList = FXCollections.observableArrayList(
             
    "White", "WhiteSmoke", "GhostWhite", "Ivory", "MintCream", "Beige", "Transparent", "Seashell", "Snow", "Honeydew", "FloralWhite", "Cornsilk", "BlancheDalmond","Wheat", "AntiqueWhite", "NavajoWhite"); 
    

    and the list of race

    public class ComboBoxLineCellFactory {
        
       public static ObservableList<String> linesList = FXCollections.observableArrayList(
         "-fx-stroke-dash-array: 1;", "-fx-stroke-dash-array: 12 2 4 2;", "-fx-stroke-dash-array: 2 2;", 
         "-fx-stroke-dash-array: 15 5.0 15 5.0;", "-fx-stroke-dash-array: 0.8 8.0;", "-fx-stroke-dash-array: 3 3;", "-fx-stroke-dash-array: 6 3;");
    

    In my previous version of swing, I used to get these values in this way (PriceRetracementIni is the class with the statements of private fields and define and use the get methods).

    PriceRetracementIni.setColor1(Integer.toString(((Color)jComboBoxColor1.getSelectedItem()).getRed())+ "|" + Integer.toString(((Color)jComboBoxColor1.getSelectedItem()).getGreen())+ "|" + Integer.toString(((Color)jComboBoxColor1.getSelectedItem()).getBlue()));
    
    

    PriceRetracementIni.setStyle1(ComboLineTypeConstants.getStrokeArray((BasicStroke)jComboBoxStyle1.getSelectedItem()));
    
    

    PriceRetracementIni.setFontStyle(jComboBoxFontStyle.getSelectedItem().toString());
    
    

    How do I make FX 2, assuming that I have comboboxColor, comboboxStyle and comboboxFont?

    Thank you.

    Post edited by: acepsut missed some info about the color and stroke list

    comboBox.getSelectionModel () .getSelectedItem)

    See the Javadocs for ComboBox and SelectionModel

  • How to get the channels spot given colors and spot channels length

    File is CMYK format... channel spot color is CMYK we as a spot channel color is c100m50y20k5
    How to get the channel spot color data using javascript? c = ? m = ? y = ? k = ?
    howv to get your channel length n (not the CMYK channel) use javascript?  such as CMYK + spot n-channel 7 = 7

    Please help me

    #target photoshop

    var myDoc = activeDocument;

    var channel = myDoc.channels;

    var number = 0;

    for (var m = 0; m< channels.length;="" m++)="">

    If (channels [m] .kind == ChannelType.SPOTCOLOR) {the number ++}

    };

    Alert (the number + "spotchannels");

  • How to get the color of the text information in the text layer?

    How to get the color of the text information in the text layer?  I mean using scripts Photoshop, Version of Photoshop CS 8.0

    The color textItem is readable for me in VBS Note expects the activeLayer be a textLayer and displays the HexValue of the color of the text.

    Option Explicit
    
    Dim appRef
    Dim docRef
    Dim textItemRef
    Dim artLayerRef
    Dim textColor
    
    Set appRef = CreateObject( "Photoshop.Application" )
    
    appRef.BringToFront
    
    Set docRef = appRef.ActiveDocument
    Set artLayerRef = docRef.ActiveLayer
    Set textItemRef = artLayerRef.TextItem
    Set textColor = textItemRef.Color
    
    MsgBox textColor.RGB.HexValue
    

    And returns the color of the text if the text is the same color. But if the text is more than a color textItem.color returns only the color of the first text range.

  • How can set the background color of the status bar?

    Quote from the old forum:

    Comments: comments
    How can set the background color of the status bar?
    Posted the: July 17, 2008 02:56
     
    How can set the background color of the status bar?
    Using this code for the status bar:
    LabelField statusField = new LabelField ("Good Morning", LabelField.USE_ALL_WIDTH |) LabelField.NON_FOCUSABLE | LabelField.HCENTER)
    {
    int _backgroundColour = Color.LIGHTGREEN;
    public void paint (Graphics g)
    {
    g.setBackgroundColor (Color.RED);
    g.Clear ();
    Super.Paint (g);
    }
    };

    Font defaultfont = Font.getDefault ();
    Police smallfont = defaultfont.derive (Font.PLAIN, 12);

    statusField.setFont (smallfont);
    setStatus (statusField);

    When I ran the code you have above, my status background color was red.  Is not what you see?  If so, please provide the BlackBerry model and software version that you are testing.  You can find this under Options.

    Or if you try to do something else, please provide details.

    I tested this in the BlackBerry Simulator included with version 4.5.0 BlackBerry JDE (4.5.0.44).

    To do this in version 4.1, first call getColor and save the current color.  Then call setColor, setting the color to the color you want to use for the background.  After this call call fillRect, starting with 0, 0 and go to the size of the field (use this.getWidth () and this.getHeight () to get this).  This must fill in the field with your specified color.

    To allow the drawing of the default content of the field call setColor once again, passing in the original color, then call super.paint.

  • How to get the printer laserjet 3015 of all-in-one to work with hp520 touchsmartpc 64-bit with windows 7

    How to get the printer laserjet 3015 of all-in-one to work with hp520 touchsmartpc 64-bit with windows 7

    Hi baldwinj,

    Follow the steps outlined in the document below to install the OS driver in for this printer in Win 7 64 bit.

    HP LaserJet Color LaserJet and products of LaserJet AiO/MFP - install the driver included in the operating system Windows 7 (OS)

    Download drivers and software

  • 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

Maybe you are looking for

  • How to reset the office pictures back to default

    Running XP sp3 on a Dell B110.  Somehow got ALL the photos as of parts for the wallpaper in display properties.  Is it possible to reset to factory default images? Mike T IS

  • Windows will not read the disc media

    For some reason, windows will not read dvd or cd or the floppy one and the flash drives or cards of the camera with a usb drive. What would cause this and how then I get back to work? All media works on the other pc.

  • problem after anniversary update of the w10

    I've recently updated this anniversary update of the W10 15Z laptop and now get an error message at startup which reads: "lack of system32\eed_ec.dll". Someone knows how to fix this? Can I copy this file from another computer and paste it in system32

  • Windows Vista mixer does not switch windows

    I use Windows Vista 64 bit on a laptop of Ed. When I first bought my laptop 4 months ago, it worked.  I have the windows switcher icon in the taskbar, but when you access the Windows I have open turn out.  I get a box on the screen with all the windo

  • User name and password for Windows 7, install new.

    I just installed Windows 7 on my computer and it asks me a username and password.  How can I find out what my username and password are I never put in place and never had a single installation on Vista either?