Create Layer with BG Color

function layer() {
Application.activeDocument
Application.backgroundColor (blue = 34, green = 12, red = 1)
layer()
I want to create a NewLayer, with a specific background color, the code above is not working.

You really need to read the scripting guide.
Application is a Photoshop Class. To reference that class you use app. So the first line in the function should be app.activeDocument. Even then that line does not do anything except return a document object. If you do not store the returned object in a variable you might as well delete that line.
app.backgroundColor is an app property, not a method. So the () are not used. That property either returns a SolidColor object that is the current background color or you can assign it a new color something like this
var myColor = new SolidColor();
myColor.rgb.red = 1;
myColor.rgb.green = 12;
myColor.rgb.blue - 34;
app.backgroundColor = myColor;
But that does not create a new layer and I am not sure what kind of layer you want. Do you want to create a new artLayer then fill it with your color or do you want to create a new SolidFill adjustment layer using that color.
To create a new artLayer you do something like
app.activeDocument.artLayers.add();
To create a new adjustment layer you would need to use Action Manager( scriptlistener ).

Similar Messages

  • Replace colors on multiply layer with predefined color

    Hello,
    This is my first time here and I've tried to find an answer to my question but haven't been able to. Maybe someone can help me whith this.
    My process:
    I scann my artwork (linedrawing)
    I color my artwork with multiply mode on different layers (as i'm sure many do)
    Now what I haven't been able to figure out is how to replace the color on this multiply layer with a predefined color from my colorswatch.
    I've found tutorials on how you can change colour  around by using hue/saturation and stuff like that but I have a predefined colorpalette. So I just want to replace a certain color blue I always work with, for a specific color green from my palette.
    I've used the replace brush tool but the colors that appear are a blend of the first color and the second color I use.
    So my solution so far has been to set up a new layer and color again. I'm hoping there is an easier way.
    Thanks in advance for your suggestions!
    Kind regards,
    Lineke from Amsterdam

    You could have a Color Fill layer for each color selected from your Swatches, with the blending mode set to Multiply, and the layer mask filled with black. Then, paint on the mask with white to do your coloring.

  • Why is my In design swatch panel creating swatches with different color builds than Pantone formulas

    I am working in ID CS5 now but I have seen this problem in older versions as well. After creating a swatch, either process or spot, and using any of the Pantone selection choices, I get a different formula build than what is in the Pantone books. For example; PMS 110 PC is 2/24/100/7 in the book, but in InDesign it formulates as 0/12/100/7. Doers anyone have info on this?
    S

    maybe just as well, we are getting CS6 this month
    CS6 includes Pantone+ Color Bridge libraries, which use CMYK Process definitions to simulate Pantone solid colors. The new solid library colors (i.e., Pantone+ Coated) are always defined as spot type with Lab definitions—you can no longer switch to CMYK definitions via Ink Manager for the those libraries.
    Pantone+ Color Bridge Coated defines 110 as process CMYK 2|22|100|8. It's not surprising Pantone is always changing the CMYK simulation builds because the appearance of CMYK depends on the printing conditions. Personally I would go for a color managed conversion, allowing that much black in a saturated yellow seems questionable.

  • Photoshop in Adobe RGB 16 bit don't fill a layer with paint bucket and a color 35.40.35.100.

    I create a new file in RGB profile Adobe RGB 16bit
    take the paint bucket and fill the layer with a color created by selector with the following parameters 35.40.35.100 CMYK and RGB corresponds to 24.20.18 the result is a full level of color 76.73.63.9 but in RGB corresponds to 24.20.18 because the values in cmyk not match ??

    Could you please post screenshots (with the pertinent Panels visible) to illustrate the issue?
    Are you not aware that you cannot reliably define a CMYK color in RGB because the transformation is performed through the Profile Connection Space (Lab) and depends on the involved Color Spaces/ICC profiles (edited) and the Color Settings?

  • Photoshop opens dialog box when trying to fill a layer with transparent pixels locked

    This script should set the layer to lock transparent pixels, and then fill the layer with a color. It does that, except when it gets to the fill stage, it opens the fill dialog box, and you have to hit okay.
    If you omit the transparent pixel line, it runs as expected, no dialog box.
    Is there a way to suppress the box? Or am I doing something wrong that's causing the box to open?
    #target photoshop
    app.bringToFront();
    doc = app.activeDocument;
    doc.artLayers[0].isBackgroundLayer = false;
    doc.artLayers[0].transparentPixelsLocked = true;
    app.activeDocument.selection.fill(app.foregroundColor);

    Not sure why that happens.
    But I would recommend foregoing the locking and using the AM code for a Fill that honours the transparency.
    #target photoshop 
    app.bringToFront(); 
    doc = app.activeDocument; 
    doc.artLayers[0].isBackgroundLayer = false; 
    doc.activeLayer = doc.artLayers[0];
    // =======================================================
    var idFl = charIDToTypeID( "Fl  " );
        var desc18 = new ActionDescriptor();
        var idUsng = charIDToTypeID( "Usng" );
        var idFlCn = charIDToTypeID( "FlCn" );
        var idFrgC = charIDToTypeID( "FrgC" );
        desc18.putEnumerated( idUsng, idFlCn, idFrgC );
        var idOpct = charIDToTypeID( "Opct" );
        var idPrc = charIDToTypeID( "#Prc" );
        desc18.putUnitDouble( idOpct, idPrc, 100.000000 );
        var idMd = charIDToTypeID( "Md  " );
        var idBlnM = charIDToTypeID( "BlnM" );
        var idNrml = charIDToTypeID( "Nrml" );
        desc18.putEnumerated( idMd, idBlnM, idNrml );
        var idPrsT = charIDToTypeID( "PrsT" );
        desc18.putBoolean( idPrsT, true );
    executeAction( idFl, desc18, DialogModes.NO );

  • Material(pen) with different colors

    Dear Friends,
                       Please give the details of how to maintain a material(pen) in different colors(blue/black/green/red etc.).when I do purchase order(PO)/GR for that pen(unique material) is there is any specific option to do the PO/GR for black,blue......Awaiting for your replies....
    Thanks in advance
    Regards
    Eliaz

    Hi
    Use can active batch management and create batches with classifaction (color coding).
    Thanks

  • How to get a layer's background color with AE SDK

    Hello,
    I am trying to get the color of the background for my current layer but I can't seem to find how to do it.
    By background color, I don't mean the application's background color, but the color that shows through if I set the alpha of my pixels to 0.
    For example, suppose the composition background is black, I put a green solid on top of it, then put an image on top of the solid and apply my pug-in to the image.
    If I set the alpha to zero in my plug-in, the solid's green will show up.
    So I want to be able to find out that my background is green.
    I already tried using PF_AppGetBgColor() but that returns the application's background color, which is not green in this example.
    If you want more details about what I want to do, I have plug-in P1 which sets some pixels to 0-alpha. On top of it I apply another plug-in P2 which reveals 0-alpha pixels by blending them with some color.
    What happens now is that the output is the original image's color blended with P2's color (because P1 only modified the pixels' alpha).
    What I want is to have the color showing through the transparent pixels of P1 blended with P2's color.
    To do that, I would like to be able to set the color of the 0-alpha pixels to the background's color in P1.
    Sorry for the long question.
    Thanks for your suggestions.

    hello nicolas.
    if i understood you correctly, what you're trying to get it the image buffer of the composited layers, beneath the layer with your effect.
    if that is correct, then i'm afraid it's next to impossible to do.
    when AE renders a composition it doesn't do it bottom to top. it tries to do the opposite actually.
    why? because if at a certain point the buffer is fully opaque, then it doesn't need to render what's beneath.
    further more, checked out layers change the order rendering, and many other things affect the rendering order of the layers.
    besides that, there's no API for accessing intermediate comp buffers. just the final result.
    the closest you can get to that without turning the world over, is to use AEGP_GetCompBGColor(),
    which would prove useless to you as the image doesn't get composited over that color, unless that's the comp being saved to file.
    so why did i say "next to impossible"?
    you can turn the world around.
    you can write an AEGP of type "artisan". (look at the "arti" sample)
    these plug-ins render comps (instead of the "advanced3D" renderer)
    an artisan does have intermediate comp results, as it is the one doing the rendering.
    so now you can have your artisan save the buffer you need, and deliver it to your effect.
    i must warn you that doing this is very very very difficult.
    another possible solution is to create a duplicate of the comp in which your effect resides,
    erase all layers who's image you don't need, and render that duplicated comp using AEGP_GetReceiptWorld().
    if you use this method, you have to supervise the original comp, and apply changes to the duplicate.
    yes, that too is difficult to do.
    you could make a change in strategy, and apply your effect on an adjustment layer instead.
    the input for the adjustment layer is the composited buffer of underlying layers.
    then you could get the original sources you wish to process using checked out layer params.
    the last solution i can think of is using the sampleImage() expression on a hidden param.
    this will give you pixel data from any layer in the comp, but not the composite of the underlying layers.
    maybe if you tried sampling an adjustment layers post effects... i don't know. you'll have to try.
    this method is very slow, and is also limited to time out, so you can't get a large number of pixels.
    the expression will simply fail.
    i hope it hasn't been all bad news for you.
    maybe of you told more about the plug-in you're developing i could come up with a better plan.

  • Photoshop CS6 - How can javaScript fill blank layer with color?

    Hello,
    I'm a production artist and I work with PSD files that were created in Adobe Scene7 Image Authoring Tool. These PSDs contain a background layer along with 1-20 alpha channels. My script has to make new blank layers based on the number of alpha channels and then it has to fill the new layers with light gray. The RGB values are 161, 161, 161. I checked the PSCS6 JavaScript Reference pdf, but I don't see a method that would do this for artLayers. (Let me also say that I'm new to javaScript).
    Does anyone know how to fill a blank layer with these RGB values?
    Here's my script so far:
    #target photoshop 
    // declare variable to contain the active document
    var myDoc=app.activeDocument;
    // declare variable to contain the number of alpha channels, excluding the RGB channels
    var alphaChan = myDoc.channels.length - 3;
    // create loop to make new layers based on number of alpha channels and fill each layer with gray
    for (a=0; a<alphaChan; a=+1){
    myDoc.artLayers.add();
    if (myDoc.artLayers.length == (alphaChan + 1)) {
        break;

    var color = new SolidColor();
    color.rgb.red = 161;
    color.rgb.green = 161;
    color.rgb.blue= 161;
    myDoc.selection.fill(color);

  • HT2513 my iCal calendar that I created with the color green keeps changing to purple.  no matter how many times I change it to green, it turns it back to purple.  Of course this only happens with iCloud and not "from my Mac".  Any ideas?

    my iCal calendar that I created with the color green keeps changing to purple.  no matter how many times I change it to green, it turns it back to purple.  Of course this only happens with iCloud and not "from my Mac".  Any ideas on how to correct this?  This seems like a trivial error, but it's super annoying.

    I called Apple and they said that they know about this problem.  It's a problem with iCloud which their Engineers know about.  (there was a new iCloud release, hence...)  No ETA for a fix yet.  I asked that this be escalated so Engineering doesn't put it at the bottom of their fix list.  I talked to a Senior Advisor and mentioned to them to have QA check their regression tests as this has happened before to me (the problem just didn't take this long to resolve).  I like to use green too for important stuff, so I've resorted to creating a new calendar using the normal calendar green for events going forward.  They could have picked another color besides green to have this problem with and I wouldn't have been so upset.  ;-)

  • Creating an O/R layer with TopLink from Ant or a script

    We're currently using JDeveloper and BC4J to generate an O/R layer that simply creates a BC4J entity for each table in our schema with the appropriate associations between tables. The problem with this approach is that it is very brittle. Any change in the database breaks the BC4J layer and we have to recreate the entire thing. Using the JDeveloper wizzard is labor intensive and we want to automate the task of creating a new O/R layer with a script or Ant task, but unfortunately there is no way to do this with JDeveloper.
    Can we use TopLink to generate an O/R layer using a script or Ant task instead of the workbench? It would be a great time saver for us if we could point TopLink to our schema and have it generate an entity per table with the correct associations without having to use the workbench.
    Thanks.

    I have seen some customers do this, although not necessarily with ANT (it was a while ago). We do ship the Deployment Descriptor DTD (search your TopLink install for *.dtd). That should help you generate the mappings. You're on your own with the code, none of the code gen API's are available on the command line outside the MW.

  • Creating vertical reports with alternating colored rows

    I wanted to create a vertical report with alternating colored rows. Creating a vertical report template was not a problem but I am not able to use different bgcolor for alternating rows.

    As I mentioned above, I used the follwoing code to generate the vertical report BUT i could not get the alternating rows in a diffrent color:
    Before Rows:
    <table class="default2">
    Before Each Row:
    OMIT
    Column Template 1
    <tr><td bgcolor="#CCCC99" width="200"><font color="#336699" #ALIGNMENT#><b> #COLUMN_HEADER#</td> <td width="500">#COLUMN_VALUE#</td></tr>
    Column Template 1 Condition
    Use for Odd rows
    Column Template 1
    <tr><td bgcolor="#CCCC99" width="200"><font color="#336699" #ALIGNMENT#><b> #COLUMN_HEADER#</td> <td bgcolor="#FFFFFF" width="500">#COLUMN_VALUE#</td></tr>
    Column Template 1 Condition
    Use for Even rows
    After Each Row
    OMIT
    After Rows
    </table>

  • Keyboard shortcut for filling layer with color are opposite on my PS CS6 OSX install, Help?

    Hello all,
    I'm a bit of a noob, and following a tutorial….and found something strange and wonder if you might help me figure what's happening.
    I have Photoshop Extended CS6 on a macbook pro (late 2011).
    I'm running OSX v 10.7.5
    I'm following along and the instructor added a new layer. I did this.
    He then filled the layer with white which is his background color (he has black foreground, white background). I have the same fore/background colors.
    Now, I thought on mac that to fill with foreground color you hit Apple+Delete  and to fill with background you hit Option+Delete
    It is doing the exact OPPOSITE for me. I hit Apple+Delete (or even backspace)  and it fills with my background color which is white
    If I hit Option+Delete (or backspace) it fills with my foreground color.
    I've tried looking in the Edit Keyboard shortcuts area…but I don't see these settings anywhere.
    I do have an external keyboard  hooked to my mac. It is a 3rd party one, but seems to work in ever other way normally.
    Keyboard here is:  http://pckeyboard.com/page/UKBD/UB40P4A
    Any suggestions why my keyboard shortcut for filling a layer with color might be reversed?
    Thanks in advance,
    CC

    eartho wrote:
    option-delete is, and always has been, fill with foreground.
    a 1 second google search would have informed you of this.
    Thanks for the reply.
    I did do a Google and I got this:
    http://blog.coghillcartooning.com/84/tip-keyboard-shortcut-to-fill-a-photoshop-layer-or-se lection-with-the-background-or-foreground-color/
    And from that I got the option-delete was background, and apple-delete was foreground.
    Hence my confusion...
    Thanks for the reply, I guess I should check 2-3 sites each time I google for keyboard shortcuts for PS.
    CC

  • I purchased the products and I'm trying to complete a project I've started. I have an image and need to fill the back ground with a color I already have as a background layer so it blends in

    I purchased the products and I'm trying to complete a project I've started. I have an image and need to fill the back ground with a color I already have as a background layer so it blends in

    You should find the forum for whichever product this concerns and post your question(s) there.
    Here is a link to a page that has links to all Adobe forums...
    Forum links page: https://forums.adobe.com/welcome

  • Using multiply effect on illustrator file with 2 color job?

    Hi,
    Encountering a tricky problem and not sure if its an InDesign fix or an Illustrator fix.
    I am working on a 2 color job—pms color + black on a book cover. The cover needs to seperate into these 2 colors.
    Also, I need to make a high res and lowres pdf that look like the cover to send out to marketing, sales etc.
    WHAT's THE PROBLEM?...
    Well, I am creating a collage with black ink vector graphics on top of the pms background. I created this art in illustrator. it is saved as an .eps file. The illos were done by someone who used a white fill to knock out black areas. There is also a wide 50% grey outline around the illustration.
    I like the idea of the line of the illo being black and the fill being red so that it looks seethrough on the red background. But the 50% grey outline causes a problem...I'd like the 50% outline to blend with the red color, so instead of appearing like there is white in the ink it overprints.
    The only way I could think of (and quickest way) was to apply the multiply filter in illustrator to the vector illo. This seemed to work great.
    I brought the illo into InDesign where I created my cover layout.
    Looks great, Prints great. Separations appear to be good, although it shows the yellow, cyan, and majenta layer they appear to be blank, so I think it will seperate nicely into 2 plates–PMS + black.
    BUT, when I make a pdf, using "smallest file size" or using "high quality print", the pdf it makes does not show the illustrations in the collage. They are kind of beige and dulled out. The publisher needs pdfs too.
    Does this at all indicate that this job will not print correctly using this multiply filter, or is it all well and good final product wise, but its just an issue making the pdf? I am slightly nervous I am going to send this off to the printer and they will have some issue.
    I am a professional designer of 10 years with lots of print experience, but I have never used multiply in illustrator so I just want to make sure there is no rule against doing this I should know about. Does multiply at all mess with the color separations or is it fine? And how do I get my pdf to come out right? I'm hoping there's some dumb thing I'm forgetting, or a simple fix.
    Thanks for any insight you may have!
    L.

    I did figure out after posting this that I was using one .ai file and one .eps file—the .ai was showing up fine in the pdf and the eps was showing up screwy.
    odd thing though, when I just re-exported using pdf/x–1a settings, now both images appear muddy! but fine when I turn "overprint preview" on. I just don't want my publisher to have to tell everybody to turn overprint preview on...they shouldn't have to do that for editors etc, non design people.
    maybe the new "smallest file size" will be fine though since this is a press preset...we'll see.

  • Grouping Adjustment layer with Gradient Fill layer

    Page 151 of "The Missing Manual" suggests that one should be able to group a Levels Adjustment layer with a Gradient Fill layer so that the levels adjustment fades out to one side.
    If I understand this correctly, the setup would be:
    Levels Adjustment Layer (grouped with layer below)
    Gradient Fill layer (with a gradient from Opaque to Transparent)
    Photo in Background layer
    but I cannot get the desired effect of original picture on one side blending through to adjusted levels on the other.
    I can get the desired effect if I dispense with the Gradient Fill layer and simply manually create the gradient on the mask of the Levels Adjustment layer but this loses the advantage of easy adjustment of the gradient.
    [Thanks to those who answered my question about linking a mask to a layer. As this is a separate query, I thought it best to start a new topic]

    Sanders1,
    I thought I'd try it, myself, and got results that I did not expect...
    http://www.pixentral.com/show.php?picture=1OVdT0C7oX46DsPm6TrfT5xxrm3h
    1 - The background image.
    2 - I created a Gradient Fill layer using color (red) to transparent.
    3 - I created a Levels Adjustment layer, set to reduce red and green,
    leaving a blue image.
    4 - I grouped the Levels Adjustment layer with the Gradient Fill layer.
    Is this the type of result you are seeing? I wonder what is the logic.
    Byron

Maybe you are looking for

  • Receiver File Adapter - TimeStamp

    How should I get partial time stamp ( I need only CCYYMMDDHHMMSS ) without Hyphans(-). Any Ideas?

  • Adding the line items in mapping

    Hi Experts, I got the structure like this. Item    (0 to unbounded)     amount   (1 to 1). I am getting more than one amounts, I need to add all the amounts and map it to target field "sum". For this how can i do the mapping can anybody please help m

  • Clamav not updating at expected times after update

    I am running an intel xserve macosx server 10.4.10 my clamav was version 0.88.5 I updated clamav this morning to 0.91.1 using the tutorial from http://osx.topicdesk.com (I am still using clamscan and haven't made the changes to use clamd) My clamav w

  • XI 7.0 Flat File FTP Transfer

    We have an ERP 2005-NetWeaver system installed and in process.  In the XI(now called PI) we have it set up properly checked x3 by 2 different people and the SM and SLD up and configured.  Our first Business Scenario was to pull an iDoc from ERP 2005

  • Unable to set (ssl) certificate on a SQL Server 2012 clustered instance

    Hello everyone! I'm trying to encrypt the SQL Server communication with SSL but I can't add the certificate in the configuration manager. I've found and tried a lot of different explaination but none of them worked. I'll described what I've done and