How can I set the foreground/background color after using CSPickColor()?

Hello all,
Is there any one who has experience on changing foreground or background color using Photoshop Plug-in SDK?
Currently I can get a returned color from CSPickColor(), but have no idea how to use it.
Thanks!

You can try a linear-gradient that starts at gray 0% and ends at white <whatever the percentage the thumb is at>.
        final Node track = slider.lookup(".track");
        slider.valueProperty().addListener(new ChangeListener<Number>() {
            public void changed(ObservableValue<? extends Number> ov, Number t, Number t1) {
                double pct = (t1.doubleValue()-slider.getMin())/(slider.getMax()-slider.getMin())*100;
                track.setStyle("-fx-background-color: linear-gradient(to right, gray, gray " + pct + "%, white" + pct + "%, white);");
        });Edited by: dgrieve on Apr 12, 2012 12:19 PM

Similar Messages

  • How can I get the foreground/background swatches in my panel?

    Howdy all-
    Been loving this forum, it's been extremely helpful getting started with Configurator. I'm pulling together a panel for my students to guide their retouching work and the last thing I am trying to get in is the foreground/background swatches like at the bottom of the toolbar. Is this possible? I haven't found it in the provided libraries- is it something that would need a script or am I looking in the wrong places?
    thanks so much again for the forum and any help anyone can provide.

    Hi
    You can only switch foreground/background color   or   set them to default color
    As in the previous thread ( by ipf55 )
    you have the possibility to insert the color picker.
    so the workaround is :
    switch to foreground ( or background as you prefer)
    choose a color with the color picker button (Now the foreground is  set with the color you choosed)
    then repeat te step for the background
    to choose a color you could also ( e.g.) insert into your panel a button that open the swatches panel
    This is the link to develop a panel with the caratheristic i suppose you are looking for
    Adobe® Photoshop® Panel Developer's Guide
    http://www.adobe.com/devnet/photoshop/pdfs/photoshop_panel_developers_guide.pdf
    ( go to pag 26-The Color Picker Panel tutorial)
    You could also take a look to the link to  adobe exchange I mentioned in the thread  above

  • How can I set the date of my PC using Java?

    Which class has the function to set system date and time.
    Thanks in advance.

    but the following sentence
    Process p=Runtime.getRuntime().exec("date
    11-03-2002");
    always throw IOExecption error
    java.io.IOException: CreatePreocess:date 11-03-2002
    error=0
    and why?
    How to settle it?
    'date' is an internal command which means you need a shell to run it. Depending on the OS this will either be 'cmd' or 'command'. If you search the forums with the following keywords you will find examples on how to use this: "exec", "Runtime", "cmd" or "command"

  • How can I create an alt background color for items in a jlistbox or jtree

    What I'm looking to do is have a white background for say items 1,3,5, etc. and a light yellow background for items 2,4,6, etc. I was wondering how can I set an alternative background color on items in a JTree or a JList

    Use a cell renderer:
    import java.awt.*;
    import javax.swing.*;
    public class ListAlternating extends JFrame
         public ListAlternating()
              String[] items = {"one", "two", "three", "four", "five", "six", "seven"};
              JList list = new JList( items );
              list.setVisibleRowCount(5);
              list.setCellRenderer( new MyCellRenderer() );
              JScrollPane scrollPane = new JScrollPane( list );
              getContentPane().add( scrollPane );
         public static void main(String[] args)
              ListAlternating frame = new ListAlternating();
              frame.setDefaultCloseOperation( EXIT_ON_CLOSE );
              frame.pack();
              frame.setLocationRelativeTo( null );
              frame.setVisible( true );
         class MyCellRenderer extends DefaultListCellRenderer
              public Component getListCellRendererComponent(
                   JList list, Object value, int index, boolean isSelected, boolean cellHasFocus)
                   super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
                   if (!isSelected)
                        setBackground(index % 2 == 0 ? list.getBackground() : Color.LIGHT_GRAY);
                   return this;
    }

  • How can i set the alternating colors for a table rows

    Dear All,
    Please any one help me how can i set the Alternating colors for Table Rows.
    i created a theam there i set the background alternating color to brown and i set the table design properity to alternating. but it is not reflecting.

    Hi,
    The design property in Table properties should work for your requirement. Select "alternating" value for design.
    Please see the API below:
    design
    Determines the appearance of the table. The property design can take the following values and is represented by enumeration type WDTableDesign.
    alternating - The table rows are displayed alternately in a different color.
    standard - The table background has one color. The individual table rows are displayed with grid net lines.
    transparent - The table background is transparent. The individual table rows are displayed without grid net lines.
    Check whether you have changed the right property or not? Also table should contain more than one rows to test this scenario.
    Regards,
    Jaya.
    Edited by: VJR on Jun 17, 2009 6:43 PM

  • How can I set the default print settings of my document as color.  I want the default print setting to be color when someone opens a document.  similar to duplex print preset is there a color print preset?

    How can I set the default print settings of my document as color.  I want the default print setting to be color when someone opens a document.  similar to duplex print preset is there a color print preset?

    Hi,
    Try saving your settings as a Preset by clicking the Preset drop down and then select Save Current Settings as a Preset.
    Next try changing the settings by selecting the saved preset.
    That allow saving the settings for a specific printer, I assume it may also allow selecting these settings for another printer.

  • How can I disable the change of color when changing background in ios7?

    how can I disable the change of color when changing background in ios7?

    For txt messages you can change the option of whether previews are shown (Settings >> Messages >> Show Preview Toggle). Switching this "Off" will still show a notification of a missed txt message, but it will not show text from the message itself.
    Unfortunately, similar functionality does not currently exist for phone calls; however, the new iOS release (scheduled for September, I think rumor has it) will revamp the way notifications are handled, and there maybe an elegant solution for you then.

  • How do I change the tab background color in Firefox 4?

    I just upgraded to Firefox 4. Tabs are now fine black font on dark grey background -- very hard to read. How do I change the tab background color?
    I have searched and the closest I can come is some instructions for modifying .css files, and it is not clear that those instructions will impact the tab background color.
    Thanks in advance for your help.

    Similar question asked by TH received another response.
    Here is the address of that question and answer:
    https://support.mozilla.com/en-US/questions/804464?s=change+tab+color+firefox+4&as=s
    I like the solution recommended there.
    Added information - after several days experience, I notice that some tabs occasionally revert to the original dark grey. So I am still looking for a better solution, ideally within Firefox rather than via add on. This seems like a basic setting for the browser that should be easy to change, rather than something so complex that I need an add on to change it. Or just build it without such a dark grey background to begin with and I would not need to change it.

  • How can I set the width of a Text element?

    Hello! I have created a custom button with this class:
    import javafx.scene.Node;
    import javafx.scene.CustomNode;
    import javafx.scene.Group;
    import javafx.scene.Cursor;
    import javafx.scene.shape.Rectangle;
    import javafx.scene.paint.Color;
    import javafx.scene.paint.LinearGradient;
    import javafx.scene.paint.Stop;
    import javafx.scene.effect.DropShadow;
    import javafx.scene.text.Text;
    import javafx.scene.input.MouseEvent;
    public class Button extends CustomNode {
        public var text: String;
        public var x: Integer = 0;
        public var y: Integer = 0;
        public var width: Integer = 90;
        var height: Integer = 25;
        override public function create(): Node {
            return Group {
                content: [
                    Rectangle {
                        cursor: Cursor.HAND;
                        x: this.x;
                        y: this.y
                        width: this.width;
                        height: this.height;
                        arcWidth: 15;
                        arcHeight: 15;
                        effect: DropShadow {radius: 6};
                        fill: LinearGradient {
                            startX: 0.0, startY: 0.0, endX: 0.0, endY: 1.0
                            stops: [
                                Stop {offset: 0.0, color: Color.WHITE}
                                Stop {offset: 1.0, color: Color.LIGHTGRAY}
                        onMouseEntered: function(e: MouseEvent): Void {
                            (e.node as Rectangle).fill = LinearGradient {
                                startX: 0.0, startY: 0.0, endX: 0.0, endY: 1.0
                                stops: [
                                    Stop {offset: 0.2, color: Color.WHITE}
                                    Stop {offset: 1.0, color: Color.LIGHTGRAY}
                        onMouseExited: function(e: MouseEvent): Void {
                            (e.node as Rectangle).fill = LinearGradient {
                                startX: 0.0, startY: 0.0, endX: 0.0, endY: 1.0
                                stops: [
                                    Stop {offset: 0.0, color: Color.WHITE}
                                    Stop {offset: 1.0, color: Color.LIGHTGRAY}
                        onMousePressed: function(e: MouseEvent): Void {
                            (e.node as Rectangle).fill = LinearGradient {
                                startX: 0.0, startY: 0.0, endX: 0.0, endY: 1.0
                                stops: [
                                    Stop {offset: 0.0, color: Color.LIGHTGRAY}
                                    Stop {offset: 1.0, color: Color.WHITE}
                        onMouseReleased: function(e: MouseEvent): Void {
                            (e.node as Rectangle).fill = LinearGradient {
                                startX: 0.0, startY: 0.0, endX: 0.0, endY: 1.0
                                stops: [
                                    Stop {offset: 0.0, color: Color.WHITE}
                                    Stop {offset: 1.0, color: Color.LIGHTGRAY}
                    Text {
                        x: this.x + 5, y: this.y + 16
                        content: this.text
    }But, how can I set the Text element centered into the button?

    Stack {
                        layoutInfo: LayoutInfo {
                            width: bind width;
                            height: bind height;
                        content: [Rectangle {
                                width: bind width, height: bind height
                                //fill: bind color;
                                fill: Color.GREEN
                                arcHeight: 20; arcWidth: 20;
                            Text {
                                font: Font {
                                    size: 24
                                textAlignment: TextAlignment.CENTER;
                                wrappingWidth: width;
                                boundsType: TextBoundsType.VISUAL;
                                fill: Color.WHITE;
                                content: bind text;
                    }wrappingWidth: Sets the maximun width of the text
    boundsType: If you put the wrappingWidth var and you want to center a text you MUST set this var to VISUAL

  • How do I change the white background color in a b/w line drawing jpg?

    How do I change the white background color in a b/w line drawing jpg?

    Just put a Solid Color Layer atop it and set it to Blend Mode Multiply or
    • load the Channel with the best contrast (cmd-click it in the Channels Panel)
    • invert Selection (cmd-I)
    • create a black Solid Color Layer
    • put whatever below that Layer

  • Setting the Border background color

    Post Author: gravy
    CA Forum: .NET
    Hi,
    Using the API I'm trying to set the Border background color to transparent but I can't. I want to set the background color to match what the designer does when you uncheck the Background option on the Border tab of a TextObjects properties.
    Can anyone help?

    What release are your using?
    do you want to set this dynamically, for one portlet or all. you may what to use
    'Themes'
    "Jorgeana" <[email protected]> wrote:
    >
    Does someone have a sample of setting the portlet border and background
    color ?
    I´m having problems using "setPortletBGColor" !! Tks

  • Can i change the preview background color?

    Hi
    can i change the preview background color?
    it's gray , may i change it?
    thanks
    i use bridge cs6

    can i change the preview background color?
    Yes you can do so in the Bridge preferences under general both Ui interface and image backdrop can be changed
    In the same preferences Cache you can change the location of the central cache to where ever you will. But you have to realize that if you use an external disk this can cause all kinds of problems regarding speed, performance and permission issues. best to keep it on an internal disk and having an SSD available will be even better because you will benefit from performance and speed very much.
    it's gray , may i change it?
    As long as you have a legal version and it is able to change then feel free to set it to your own custom wishes...

  • How can I set the page that will open, when I open a new tab, to be the same as the homepage?

    How can I set the page that will open, when I open a new tab, to be the same as the homepage?
    An app changed it to some other search engine, before installing the app, I the tab that would open was the homepage I set.
    In my case it is Google, and I want my new tabs to open on Google like they did before the installation.
    thank you,
    Asaf Privman.

    You can middle-click or Ctrl left-click the Home button on the Navigation toolbar to open the Home page in a new tab.
    You can look at one of these extensions:
    * NewTabURL : https://addons.mozilla.org/firefox/addon/newtaburl/
    * New Tab Homepage : https://addons.mozilla.org/firefox/addon/new-tab-homepage/

  • How can I change the font and color of an email signature?

    How can i change the font and color of an email signature?

    Mail > Preferences > Signature
    Highlight the Signature.
    Click Format in the menu bar and select " Show Fonts".
    Select the Font.
    Highlight the Text.
    Click Format in the menu bar and select " Show Colors".
    Select the color.
    Mail > Preferences > Composing > Message Format:  Rich Text
    Best.

  • How can I set up an older airport express using the newest airport utilities?

    How can I set up an older airport express using the newest airport utilities? Seems like there isn't an option to set this up.  Normally you could add/set up this in the airport setup assistant- but that doesn't exsist any longer.
    Thanks for any suggestions 

    How can I set up an older airport express using the newest airport utilities?
    Unfortunately you can't, since Apple dropped support of the older AirPorts with AirPort Utility 6.x.
    Using some workarounds....not supported by Apple.....you might be able to download and install an older version of AirPort Utility that would allow you to administer the older AirPort.
    See this thread for more details and instructions:
    https://discussions.apple.com/message/21397085#21397085

Maybe you are looking for

  • Question on my video card.

    I am curious if there is a way to hook my pc up to my flat screen tv. I have a 570 GTX video card that has a mini hdmi port on the back of my video card and I was wondering if by getting a cable to hook up from there could I connect it to my flat scr

  • XML Publisher Error with reports

    Hi All, I am geting the following error with a report published using XML Publisher The XML page cannot be displayed Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later. The system c

  • How can I get serial numbers or the free versions of Adobe, Air, Flash Player 14, and Reader XI Pro

    How can I get serial numbers or the free versions of Adobe, Air, Flash Player 14, and Reader XI Pro that I had installed on my computer before Microsoft crashed my computer and I had to do a fresh install? I finished reinstalling Win 8.1Pro on my com

  • Searching in Calendar for 2week+ appointments

    Hi guys Hope u can help. I've set up numerous appointments on my calendar, some going 3-4 months ahead of the current date, others just two to three weeks down the line. I often want to check when an appointment was scheduled and want to search for i

  • "No password" on resource in IDM 8

    Dear all, i am just creating a resource to pull userdata from an oracle table ( actually view but doesn't matter here ) but i do not want to manage a password, therefore i disabled the password feature. But i still getting an error when trying to sav