In Apple Color Picker, need to sort custom list

I just created a custom color list in Apple's Color Picker which is not sorted and I want it to be.
FYI: the Apple Color Picker opens in many applications for choosing what color something should be. For example, in TextEdit use menu Format > Font > Show Colors.
On the Color Picker, the 3rd tab by default has pre-defined lists of colors, including "Apple", "Developer", and "Web Safe Colors". I created a custom color list, which is out of order alphabetically (or any other way). I would like to sort that list alphabetically (or by color, I guess) without deleting and recreating every color. Can this be done?

Hi, whytwolf.
I thought your question was interesting, so I spent some time experimenting.
The Colors Palette doesn't permit re-ordering the items in the list, such as by dragging or Command-dragging them.
Unfortunately, the color list one creates using the Colors Palette — e.g. the file colorlistname.clr in your Home > Library > Colors directory — is an NSDictionary object. It's saved in binary format and it appears virtually impossible to edit reliably with a text editor. These objects are usually created and read using Cocoa programming. I know of no editor specifically designed to permit one to change these objects directly, and a variety of Web searches for such an editor failed to find a tool.
It appears there was once a utility called Color List Editor that seemed tailor-made for your purpose, but it appears to have vanished without a trace. While the VersionTracker listing remains, all of the links to the download are broken. I was able to track down the author's Web site but the download isn't available there. I've e-mailed him in case it's still available, though it may not work with Tiger given its age. If I hear back anything from the author, I'll let you know.
What I recommend you do is recreate the list, first focusing on the order of items by name you want to include in such. Then, once that's sorted, assign the swatches. You should probably do a trial run on paper or using a spreadsheet to get the names and sequence correct before you undertake the actual list-creation process again using the Color Palette. Then work carefully, since correcting errors in mid-list means deleting the error and all entries thereafter. Most tedious!
It might also be worthwhile to submit a Mac OS X Feedback, suggesting Apple enhance the Color Palette so that one can reorder colors by dragging them in the list, at least for color lists the user has created, i.e. those on which the user has Access permissions of Read & Write.
Good luck!
Dr. Smoke
Author: Troubleshooting Mac® OS X

Similar Messages

  • Can I get the Apple Color Picker in CS5 Windows?

    HI -
    I'm a lifetime Mac and long time PShop user transplanted into a Windows shop.  Of all the things that I miss on my new workplace platform, the Apple Color Picker is the one that I encounter most often.
    Is there a plug-in, an extension, is there some way, ANY WAY, that I could have the Apple CP to use on a Windows version of CS5??  It might seem like a trivial issue to Windows users but to a transplanted Mac user - it's a major one.
    TIA your input.
    JL

    You probably already know your choices, as provided by Photoshop on a Windows system, are only Adobe and Windows per the Edit - Preferences - General tab.
    It may be possible some 3rd party could have invented an Apple Color Wheel work-alike, but I have never run across one.  Try a Google search for:
    color wheel picker Photoshop windows
    Such a search turns up stuff like:
    http://graphicssoft.about.com/od/colortoolswin/Color_Pickers_and_Color_Tools_for_Windows.h tm
    and
    http://www.anastasiy.com/panels
    If you don't find one you like, you're probably best off just trying to get used to the Adobe color picker; it will afford you some system-independence for the future, should you switch back to Mac.
    -Noel

  • Apple Color Picker Erase Swatch function no longer works.

    It was always possible to erase one of the swatches in the ubiquitous Apple Color Picker by dragging a white square over the swatch square you wanted to erase. Now that function doesn't work anymore. Very odd. You can add new colors as always, you just can't erase them. In any application where I use the Color Picker this function no longer works. For example Pixelmator, Rapidweaver, etc.
    Any ideas?

    Sorry, I read too much into it. I guess I couldn't imagine it was just scrolling. I was thinking you were talking about going from page to page with a swipe gesture.
    Given that, their software is either broken or something is interfering. Any other programs have a problem with two-finger scrolling?

  • The color picker needs some serious love

    Please just make it function exactly like photoshop.....
    Things I cannot do but want to:
    When I have a gradient on an object - and i click on one of the little things to select a different color in the gradient(object A) and get the eyedrop tool and select an color from another object(object B) - give us the option somewhere...a setting or something to NOT replace the gradient (object A) with whatever the eyedropper took. So if i have an object with a gradient(object B) and color pick a color on it - I don't want object B's gradient to completely replace Object A's gradient. I just want it to take the color of that specific part of the object and apply it to the tick in the gradient on object A....just like in photoshop.
    Let us paste hex codes into them in one shot....i dont want to type in the hex code in 3 different fields, just give me one darn field!

    Oh well I didn't know about the shift clicking....live and learn.
    Still...adding in hex codes in one line would make my life so much easier.
    Also, right now when you double click on a swatch from a gradient you can pick a color via clicking the default selected color icon or swatches...adding a color wheel icon under those two icons would be really nice...just like in photoshop.

  • Is there anyway to populate the Apple map with push pins ie customer lists

    Is there anyway to populate the Apple or Google map on my iPhone 5 with push pins that will stay there?  For example I would like to populate with all of my customers around the country to help me quickly find them when I am on the road.

    The pins don't stay there, but you can bookmark pin positions, and then drop a pin on the desired customer's location by selecting the customer from the bookmarks list.

  • My Adobe color picker won't appear.

    Hi,
    I've Googled this without success. For some reason the Adobe color picker is missing from my Photoshop 8.0. I don't know when it went missing. When I double click a swatch in the toolbox or swatches pallet or fill layers or effects window or anywhere I can think of to get the color picker to pop up I get nothing. My eyedropper tool gets activated, but there is no color picker to be seen.
    I've changed my screen resolution to maximum to see if it was lost on an outer realm of the desktop and didn't find it. I've also gone to Window > Workspace > Reset Pallet Locations but still no luck. I've gone into Photoshop's Preferences > General > Color Picker and the Adobe option is selected which I've toggled in and out of it in case it needed to reset itself, but I still get nothing. Right now I'm getting by on my Apple color picker, which I find very limiting. I still have all the Pantone, TruMatch, etc., files in Applications > Adobe Photoshop > Presets > Color Books folder, but no Adobe color picker to access them with. My Mac's Home > Library > Color Picker folder appears empty (assuming I don't need to un-hide anything to see all file types).
    So my questions are these...
    1) What is the file name and extension of Adobe Photoshop's color picker? Maybe I'll be able to search my system for it and locate it somewhere.
    2) What folder is it supposed to be located in? So I can put it there if and when I find it.
    3) Can I download the ADOBE color picker somewhere? The only one I want is Adobe's. Particularly for choosing spot colors.
    I no longer have the original Photoshop discs for a re-install.
    Thanks for any help.

    The Photoshop color picker is built into Photoshop.  There is no file, and no plugin for it.
    The only way to get a different color picker (system or a picker plugin) is to choose another one in Photoshop's preferences.
    But it sounds like you simply had the picker open on a previously connected display (and the OS is not so good about telling applications that the display is no longer available).

  • CS4 Color Picker?

    I am having a problem getting Adobe color picker to produce accurate colors. For example, if I dial in RBG value 49, 49, 49 ( HEX: 31 31 31), I get a dark color swatch that is RBG value 37, 37, 37 (Hex: 25 25 25) according to my MAC Digital Color Meter.  I tried the CS4 Apple Color picker and it seems to produce accurate colors.  Is this a bug in CS4 or is it an issue with my settings in CS4?

    The "digital color meter" reads values directly from the display -- it gets values after display correction has been applied.
    Chris

  • How to set the default Color Picker?

    Hello everyone,
    I wrote my own Color Picker and it works nicely within the standard apple color picker panel. I am quite annoyed, however, that I have to switch to my new Color Picker by hand every time I open the Color Picker Panel. I have found that I can set an application-speficic default color picker by setting the NSColorPickerSlidersDefaults property for that application using defaults. However, that way I can only set one of the original apple color pickers to be the default, not my own, because there is no number defined for my own color picker and I can't add it.
    Does anyone know a solution please?

    Thanks camickr !
    That's exactly what I was looking for. (let the UIManager take care of colors of the textfield whether it's editable or not)
    as for 2nd reply my code is in several files. IF i have to shorten it, it would be:
    it's just a pseudo code and incomplete but it gets the idea across
    * this function automatically changes colors of textfield based on mode which can change any time
    if(mode == NEW_MODE)
    textField.setEditable(true);
    else
    textField.setEditable(false);
    * This function sets the color during save time
    public void save()
    clear();
    if(textField.getText() == null)
    textField.setBackGround(Color.PINK);
    public void clear()
    //reset the color if it's pink or to the original color
    //the color must update once we change mode which is independent of this
    public void open(Patient p)
           clear();
           displayPatient(p);
    }

  • Color picker in a form?

    I'd like to add a color picker of some sort to a form I'm working on.
    I'm open to any and all suggestions.
    Thanks in advance!
    -Ted

    Hi,
    Note sure if you can get the Dreamweaver extension to work in LiveCycle Designer.
    Attached is an example where clicking a button assigns that colour to a global variable and to the captions of the fields. You can have the script in mouseEnter if you want.  The second option is allowing the user to select the RGB and then this is automatically applied to selected objects.
    A lot depends on how many colours you want and what elements you want in the form to take up this colour.
    Good luck,
    Niall
    ps just updated a version with "sliders", which set the colour on the change event.

  • Where is the color picker???

    I am using ID CC.
    For the life of me, I cannot find any Adobe help or community forum info and have been searching forever in the app, but I cannot find the color picker to select my custom colors.
    Please help.
    Thank you!

    For the life of me, I cannot find any Adobe help or community forum info and have been searching forever in the app
    InDesign Help | Applying color

  • Color picker changes as soon as I touch a slider

    I select a Pantone color in the color picker. I switch to view the CMYK sliders to make a small adjustment. As soon as I touch one of the sliders the color sample changes to a darker shade even though the CMYK values ahve not changed. Doesn't happen if I touch a RGB sliders.
    This happens using the Apple color picker in Photoshop no matter what color management I am using, also in Freehand.

    Have you tried typing and saving using Notes or word processing Apps before sending message?

  • Export Custom List into Excel through custom Ribbon

    Hi i have a requirement, in that i need to export custom list into EXCEL through custom Ribbon. For Example in my list, i have Col1, Col2, Col3. Col3 has multiple values (allow mutiple values) and when export this into excel all values in Col3 should
    come as new rows and rest of the column values should duplicate. please helpout from this requirement.
    List View
    Col1   Col2      Col3
    v1        v2    v31,v32,v33
    Excel View
    Col1  Col2  Col3
    v1      v2      v31
    v1      v2      v32
    v1      v2      v33
    Nihath

    Hello Nihath,
    As per your description, you have to read each and every items in list with column value then only you can generate excel. There is direct way to export datatable to excel but in your case you will also need to iterate Col3 value to create new row in excel.
    I would suggest to use CAML query to get all items then check Col3 value. If there are multiple value then add them as new datatable row and finally export full datatable to excel.
    Here is link for CAML:
    http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spquery.listitemcollectionposition.aspx
    Export datatable to excel:
    http://stackoverflow.com/questions/12533626/export-datatable-to-excel
    Finally add this feature in ribbon:
    http://ankurmadaan.blogspot.in/2012/10/custom-ribbon-action-for-specific-list.html
    Hope it could help
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • It's possible to disable custom color from color picker?

    Hi guys!
    I've searched in the threads about color picker but I found anything about it...
    It's possible to disable the option to select a custom color? I work in a enterprise who makes softwares to brazilian clients, and not everybody understands english phrases...
    Another way it's to translate the option, but I don't know if is possible too.
    Thanks!

    You definitely need to add the stylesheet to the Scene, not to anything else. If you take my example and change
    scene.getStylesheets()...
    to
    root.getStylesheets()...
    you'll see that it won't work any more.
    The difference between this and the css you used is that the css you used is applied to the display of the color picker button; you need to apply styles to the popup (the color palette), which is not contained in your VBox or AnchorPanes. Notice how the font has changed for the name of the color in the button, but it hasn't changed for the "Custom Color" label you are trying to remove.
    Somewhere there is some code that is adding the VBox you are subclassing to a Scene, and setting that scene into a stage. Your best option (perhaps second best option, see below) is to find that code so you can add the stylesheet to the Scene itself.
    If you're working within a framework someone else has written, and can't access or change the code where the scene is defined, you have another option that I can see. Every Node has a scene property that refers to the scene to which that node belongs. So you could observe changes to that property and when it's updated, add the stylesheet to the scene.
    So here is a hack to make my original hack work, in the event that you cannot access the scene directly, for some reason:
    final String suppressCustomColorCss = getClass().getResource( "noCustomColorPicker.css").toExternalForm();
    colorPicker.sceneProperty().addListener(new ChangeListener<Scene>() {
    @Override
      public void changed(ObservableValue<? extends Scene> observable,
      Scene oldScene, Scene newScene) {
      if (newScene != null) {
      List<String> cssClasses = newScene.getStylesheets();
      if (!cssClasses.contains(suppressCustomColorCss)) {
      cssClasses.add(suppressCustomColorCss);
    This code basically says "when the color picker becomes part of a new scene, add the stylesheet to that scene".
    At this point, you're applying hack on top of hack to get the effect you need. I think if I were in this situation I would just go ahead and define my own color picker. All you really need is a MenuButton, a property to hold the selected color, and a popup with a layout of controls to choose an arbitrary color. It would be a bit of work, but shouldn't be too hard. If you take this option (which I think may be your best bet), it's more work now but it will be clear what you are doing - when you (or other programmers on your team) come back to the code later you'll understand how it works much better.
    You should also file a couple of feature requests. One for API to enable/disable the option to choose a custom color, as this seems like a reasonable piece of functionality to have. The other should be for properly internationalized text for the labels in the color picker, as these are currently just hard coded into the source code in English.

  • Who's Up for a Challenge? (or who needs a good Color Picker?)

    Greetings,
    I got lost in the muck trying to figure out how to make this color-picker code initialize with the last chosen color.... This is an open source project, and I posted my predicament on the blog for it, but it's been a few weeks and no one has responded. I've been able to integrate the code with my project no problem, it's just figuring out how to change this one behavior... the startup color seems to be hardcoded in several different places...
    Seems like there's some folks here who enjoy a good challenge, so I thought I'd see if anyone might want to give it a shot.... I'm probably making it much more complicated than it is by starting from the wrong vantage point....
    The Blog: http://www.v-vent.com/blog/?p=27
    The Code: http://www.v-vent.com/source/hue/veventhuesource.zip
    Any clues you have to offer would be greatly appreciated.... the idea seems simple enough....currently starts on yellow every time you load the view... would like it to start on the last color chosen, which is getting stored in user defaults....

    Ok John, here are each of the three files I touched:
    // ColorPickerViewController.m
    #import "ColorPickerViewController.h"
    #import "ColorPickerView.h"
    #import "AboutScreenViewController.h"
    @implementation ColorPickerViewController
    @synthesize aboutScreenViewController;
    // --> added const decl
    NSString *const keyForHue = @"hue";
    NSString *const keyForSat = @"sat";
    NSString *const keyForBright = @"bright";
    // --> register default settings
    - (void)registerDefaults {
    NSMutableDictionary *defaultValues = [NSMutableDictionary dictionary];
    [defaultValues setObject:[NSNumber numberWithFloat:0.5] forKey:keyForHue];
    [defaultValues setObject:[NSNumber numberWithFloat:0.5] forKey:keyForSat];
    [defaultValues setObject:[NSNumber numberWithFloat:0.5] forKey:keyForBright];
    [[NSUserDefaults standardUserDefaults] registerDefaults:defaultValues];
    - (void)viewDidLoad {
    [super viewDidLoad];
    NSLog(@"CALL ME ! " );
    [self registerDefaults]; // <-- register default settings
    NSUserDefaults *saveColors = [NSUserDefaults standardUserDefaults];
    ColorPickerView *theView = (ColorPickerView*) [self view];
    // --> removed key existance test and explicit defaults from this block
    // since defaults are now registered
    [theView setCurrentHue:[saveColors floatForKey:keyForHue]];
    [theView setCurrentSaturation:[saveColors floatForKey:keyForSat]];
    [theView setCurrentBrightness:[saveColors floatForKey:keyForBright]];
    AboutScreenViewController *abouter = [[AboutScreenViewController alloc]
    initWithNibName:@"AboutScreenView" bundle:nil];
    self.aboutScreenViewController = abouter;
    [abouter release];
    [theView onViewDidLoad]; // <-- added
    - (void) viewWillDisappear :(BOOL)animated {
    NSUserDefaults *saveColors = [NSUserDefaults standardUserDefaults];
    ColorPickerView *theView = (ColorPickerView*) [self view];
    [saveColors setFloat:[theView currentHue] forKey:keyForHue];
    [saveColors setFloat:[theView currentSaturation] forKey:keyForSat];
    [saveColors setFloat:[theView currentBrightness] forKey:keyForBright];
    - (UIColor *) getSelectedColor {
    return [(ColorPickerView *) [self view] getColorShown];
    - (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning]; // Releases the view if it doesn't have a superview
    // Release anything that's not essential, such as cached data
    - (IBAction) pressedAboutButton {
    [self.view addSubview:self.aboutScreenViewController.view];
    [self.view bringSubviewToFront:self.aboutScreenViewController.view];
    - (void)dealloc {
    [super dealloc];
    [aboutScreenViewController release];
    @end
    // ColorPickerView.h
    #import <UIKit/UIKit.h>
    @class GradientView;
    @interface ColorPickerView : UIView {
    GradientView *gradientView;
    UIImageView *matrixView; // <-- added
    // --> unused ivars
    // UIImage *backgroundImage; //Image that will sit in back on the view
    // UIImage *closeButtonImage; //Image for close button
    // UIImage *nextButtonImage; //Image for next button
    IBOutlet UIImageView *backgroundImageView;
    IBOutlet UIView *showColor;
    IBOutlet UIImageView *crossHairs;
    IBOutlet UIImageView *brightnessBar;
    IBOutlet UILabel *colorInHex;
    IBOutlet UILabel *Hcoords;
    IBOutlet UILabel *Scoords;
    IBOutlet UILabel *Lcoords;
    IBOutlet UILabel *Rcoords;
    IBOutlet UILabel *Gcoords;
    IBOutlet UILabel *Bcoords;
    //Private vars
    // --> ok, private.. but atm, the controller still needs to call getters
    // and setters for currentBrightness, currentHue, and currentSaturation
    @private
    // CGRect colorMatrixFrame; // <-- removed - using matrixView ivar instead
    CGFloat currentBrightness;
    CGFloat currentHue;
    CGFloat currentSaturation;
    UIColor *currentColor;
    // unused properties
    // @property (nonatomic,retain) UIImage *backgroundImage;
    // @property (nonatomic,retain) UIImage *closeButtonImage;
    // @property (nonatomic,retain) UIImage *nextButtonImage;
    @property (nonatomic,retain) GradientView *gradientView;// <-- added
    @property (nonatomic,retain) UIImageView *matrixView; // <-- added
    @property (readwrite) CGFloat currentBrightness;
    @property (readwrite) CGFloat currentHue;
    @property (readwrite) CGFloat currentSaturation;
    - (UIColor *) getColorShown;
    - (void) onViewDidLoad; // <-- added
    @end
    // ColorPickerView.m
    #import "ColorPickerView.h"
    #import "GradientView.h"
    #import "Constants.h"
    // --> declare private properties, methods and functions
    @interface ColorPickerView ()
    @property (nonatomic,retain) UIColor *currentColor;
    - (void) getStringForHSL : (CGFloat) hue : (CGFloat) sat : (CGFloat) bright;
    - (void) getStringForRGB :(CGColorRef) theColor;
    - (NSString *) hexStringFromColor : (CGColorRef) theColor;
    static int myRoundOff(CGFloat value);
    @end
    @implementation ColorPickerView
    // --> unused properties
    // @synthesize backgroundImage;
    // @synthesize closeButtonImage;
    // @synthesize nextButtonImage;
    @synthesize gradientView; // <-- added
    @synthesize matrixView; // <-- added
    @synthesize currentHue;
    @synthesize currentSaturation;
    @synthesize currentBrightness;
    @synthesize currentColor; // <-- added
    - (id)initWithCoder:(NSCoder*)coder {
    if (self = [super initWithCoder:coder]) {
    // --> changes to support gradientView, which is now a retaining property
    GradientView *gradView = [[GradientView alloc] initWithFrame:kBrightnessGradientPlacent];
    self.gradientView = gradView;
    [gradView release];
    // [gradientView setTheColor:
    // [UIColor yellowColor].CGColor]; // <-- fixed and moved to onViewDidLoad
    [self addSubview:gradientView];
    [self sendSubviewToBack:gradientView];
    // --> changes to support retaining property 'matrixView'
    // colorMatrixFrame = kHueSatFrame; // <-- removed colorMatrixFrame ivar
    UIImageView *hueSatImageView = [[UIImageView alloc] initWithFrame:kHueSatFrame];
    [hueSatImageView setImage:[UIImage imageNamed:kHueSatImage]];
    self.matrixView = hueSatImageView;
    [hueSatImageView release];
    [self addSubview:matrixView];
    [self sendSubviewToBack:matrixView];
    [self setMultipleTouchEnabled:YES]; // <-- moved to keep similar blocks together
    // currentBrightness = kInitialBrightness; // <-- removed
    // currentColor = [[UIColor alloc]init]; // <-- fixed and moved to onViewDidLoad
    return self;
    // --> several of the ivars in this class should be moved to the controller -
    // for now this method should be called at the end of the controller's viewDidLoad method
    - (void)onViewDidLoad {
    self.currentColor = [UIColor colorWithHue:currentHue
    saturation:currentSaturation
    brightness:currentBrightness
    alpha:1.0];
    [showColor setBackgroundColor:currentColor];
    [self getStringForRGB:currentColor.CGColor];
    [self getStringForHSL:currentHue :currentSaturation :currentBrightness];
    [colorInHex setText:[self hexStringFromColor:currentColor.CGColor]];
    NSLog(@"%s: hue=%1.2f sat=%1.2f bright=%1.2f",
    _func_, currentHue, currentSaturation, currentBrightness);
    - (NSString *) hexStringFromColor : (CGColorRef) theColor {
    const CGFloat *c = CGColorGetComponents(theColor);
    CGFloat r, g, b;
    r = c[0];
    g = c[1];
    b = c[2];
    // Fix range if needed
    if (r < 0.0f) r = 0.0f;
    if (g < 0.0f) g = 0.0f;
    if (b < 0.0f) b = 0.0f;
    if (r > 1.0f) r = 1.0f;
    if (g > 1.0f) g = 1.0f;
    if (b > 1.0f) b = 1.0f;
    // Convert to hex string between 0x00 and 0xFF
    return [NSString stringWithFormat:@"#%02X%02X%02X",
    // --> using myRoundOff instead of int typecast
    myRoundOff(r * 255), myRoundOff(g * 255), myRoundOff(b * 255)];
    // --> use this if needed to fudge extrema
    static int myRoundOff(CGFloat value) {
    return lround(value);
    - (void) getStringForHSL : (CGFloat) hue : (CGFloat) sat : (CGFloat) bright { // <-- CGFloat params
    // NSLog(@"%s: hue=%1.4lf sat=%1.4lf bright=%1.4lf", _func_, hue, sat, bright);
    // --> using myRoundOff instead of int typecast
    [Hcoords setText:[NSString stringWithFormat:@"%d",myRoundOff(hue*255)]];
    [Scoords setText:[NSString stringWithFormat:@"%d",myRoundOff(sat*255)]];
    [Lcoords setText:[NSString stringWithFormat:@"%d",myRoundOff(bright*255)]];
    - (void) getStringForRGB :(CGColorRef) theColor {
    const CGFloat *c = CGColorGetComponents(theColor);
    CGFloat r, g, b;
    r = c[0];
    g = c[1];
    b = c[2];
    // --> using myRoundOff instead of int typecast
    [Rcoords setText:[NSString stringWithFormat:@"%d",myRoundOff(r*255)]];
    [Gcoords setText:[NSString stringWithFormat:@"%d",myRoundOff(g*255)]];
    [Bcoords setText:[NSString stringWithFormat:@"%d",myRoundOff(b*255)]];
    - (void) updateHueSatWithMovement : (CGPoint) position {
    // --> correcting currentHue and currentSaturation calculations
    // currentHue = (position.x-kXAxisOffset)/kMatrixWidth;
    // currentSaturation = 1.0 - (position.y-kYAxisOffset)/kMatrixHeight;
    CGPoint ptInMatrix = [self convertPoint:position toView:matrixView];
    currentHue = ptInMatrix.x/(matrixView.frame.size.width-1);
    currentSaturation = 1.0 - ptInMatrix.y/(matrixView.frame.size.height-1);
    // printf("hue Of the touch is : %f
    ",currentHue);
    // printf("sat Of the touch is : %f
    ",currentSaturation);
    UIColor *forGradient = [UIColor colorWithHue:currentHue
    saturation:currentSaturation
    brightness: kInitialBrightness
    alpha:1.0];
    [gradientView setTheColor:forGradient.CGColor];
    [gradientView setupGradient];
    [gradientView setNeedsDisplay];
    self.currentColor = [UIColor colorWithHue:currentHue // --> using setter to retain color
    saturation:currentSaturation
    brightness:currentBrightness
    alpha:1.0];
    [showColor setBackgroundColor:currentColor];
    [colorInHex setText:[self hexStringFromColor:currentColor.CGColor]];
    [self getStringForRGB:currentColor.CGColor];
    [self getStringForHSL:currentHue :currentSaturation :currentBrightness];
    - (void) updateBrightnessWithMovement : (CGPoint) position {
    // --> correcting currentBrightness calculation
    // currentBrightness = 1.0-(position.x/gradientView.frame.size.width) + kBrightnessEpsilon;
    CGPoint ptInGradient = [self convertPoint:position toView:gradientView];
    currentBrightness = 1.0 - ptInGradient.x/(gradientView.frame.size.width-1);
    // printf("Brightness Of the touch is : %f
    ",currentBrightness);
    // --> setting and using currentColor ivar instead of local var
    self.currentColor = [UIColor colorWithHue:currentHue
    saturation:currentSaturation
    brightness:currentBrightness
    alpha:1.0];
    [showColor setBackgroundColor:currentColor];
    [colorInHex setText:[self hexStringFromColor:currentColor.CGColor]];
    [self getStringForRGB:currentColor.CGColor];
    [self getStringForHSL:currentHue :currentSaturation :currentBrightness];
    //Touch parts :
    // Scales down the view and moves it to the new position.
    - (void)animateView:(UIImageView *)theView toPosition:(CGPoint) thePosition
    [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationDuration:kAnimationDuration];
    // Set the center to the final postion
    theView.center = thePosition;
    // Set the transform back to the identity, thus undoing the previous scaling effect.
    theView.transform = CGAffineTransformIdentity;
    [UIView commitAnimations];
    -(void) dispatchTouchEvent:(CGPoint)position
    if (CGRectContainsPoint(matrixView.frame,position)) // <-- colorMatrixFrame ivar was removed
    // NSLog(@"Color!");
    // printf("X Of the touch in grad view is : %f
    ",position.x);
    // printf("Y Of the touch in grad view is : %f
    ",position.y);
    [self animateView:crossHairs toPosition: position];
    [self updateHueSatWithMovement:position];
    else if (CGRectContainsPoint(gradientView.frame, position))
    // NSLog(@"Bright!");
    CGPoint newPos = CGPointMake(position.x,kBrightBarYCenter);
    [self animateView:brightnessBar toPosition: newPos];
    [self updateBrightnessWithMovement:position];
    else
    // printf("X Of the touch in grad view is : %f
    ",position.x);
    // printf("Y Of the touch in grad view is : %f
    ",position.y);
    // Handles the start of a touch
    - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
    for (UITouch *touch in touches) {
    [self dispatchTouchEvent:[touch locationInView:self]];
    // printf("X IS %f
    ",[touch locationInView:self].x);
    // printf("Y IS %f
    ",[touch locationInView:self].y);
    // Handles the continuation of a touch.
    - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
    for (UITouch *touch in touches){
    [self dispatchTouchEvent:[touch locationInView:self]];
    - (void)drawRect:(CGRect)rect {
    // --> corrected calculation of crosshairs.center
    CGFloat x = currentHue * matrixView.frame.size.width;
    CGFloat y = (1 - currentSaturation) * matrixView.frame.size.height;
    CGPoint ptInMatrix = CGPointMake(x, y);
    crossHairs.center = [matrixView convertPoint:ptInMatrix toView:self];
    // --> corrected calculation of brightnessBar.center
    x = (1 - currentBrightness) * gradientView.frame.size.width;
    y = gradientView.frame.size.height/2 - 3;
    CGPoint ptInGradient = CGPointMake(x, y);
    brightnessBar.center = [gradientView convertPoint:ptInGradient toView:self];
    // NSLog(@"%s: gradientView.frame=%@", _func_, NSStringFromCGRect(gradientView.frame));
    // NSLog(@" brightnessBar.center=%@", NSStringFromCGPoint(brightnessBar.center));
    UIColor *forGradient = [UIColor colorWithHue:currentHue // added
    saturation:currentSaturation
    brightness: kInitialBrightness
    alpha:1.0];
    [gradientView setTheColor:forGradient.CGColor]; // added
    [gradientView setupGradient];
    [gradientView setNeedsDisplay];
    [colorInHex setFont:[UIFont fontWithName:@"helvetica" size:16]];
    [self sendSubviewToBack:showColor];
    - (UIColor *) getColorShown {
    // NSLog(@"Are we here ? ");
    return [UIColor colorWithHue:currentHue saturation:currentSaturation
    brightness:currentBrightness alpha:1.0];
    - (void)dealloc {
    [currentColor release]; // <-- added
    [gradientView release]; // <-- added
    [matrixView release]; // <-- added
    [super dealloc];
    @end
    Disclaimer: While the above is working, tested code, the files are not meant to be examples of good practice. The objective was to hose out most of the functional bugs while changing the old files as little as possible. This is usually the best first step in cleaning up a project, since it allows the original programmers to see the changes in the context of the existing structure. Those changes can be much more difficult to see after a complete overhaul. Improving the structure will also change the nib files, and describing those changes in the forum can be tedious.
    Thus I perpetuated the structural weaknesses instead of moving most of the ivars, along with the code that administers them, into the ColorPickerViewController class. A number of useless but harmless artifacts were also left in the files.
    Most of my tests were only for functionality on the simulator. Though I tried to take care of memory management in the code I added or changed, there's lots of memory management clean up to do. I did some brief tests on a first gen iPod Touch with iOS 3.12, and at first glance I was surprised how well things seemed to be working. I was even able to position the crosshairs in a couple corners after a few tries (e.g. at full brightness, the upper-right corner should be HSL: 255, 255, 255; RGB: 255, 0, 0). All four of these extrema are reachable on the simulator, and if you have steady hands and/or small fingers, they're probably all reachable on an iPhone as well.
    Enjoy!
    - Ray

  • Custom Color Picker using Radio buttons??

    I'm trying to create a custom color picker as Apex color picker has tooo many colors.  I thought a radio button would work if I could program the text to also display the color, but the following sql shows the formatted text in the result.
    SELECT  '<font color="'||color_id||'"><b>'||color_name||'</b></font>' d, color_name r FROM colors
    <font color="#F0F8FF"><b>AliceBlue</b></font>
    <font color="#FAEBD7"><b>AntiqueWhite</b></font>
    <font color="#00FFFF"><b>Aqua</b></font>
    <font color="#7FFFD4"><b>Aquamarine</b></font>
    I know I can make text different colors in a report using this technique.
    Any ideas?
    Thanks,
    Drew
    Application Express 4.2.3.00.08

    ABD - DBA wrote:
    I'm trying to create a custom color picker as Apex color picker has tooo many colors.  I thought a radio button would work if I could program the text to also display the color, but the following sql shows the formatted text in the result.
    SELECT  '<font color="'||value2||'"><b>'||value||'</b></font>' d, value r FROM lov where type='COLOR'
    <font color="#F0F8FF"><b>AliceBlue</b></font>
    <font color="#FAEBD7"><b>AntiqueWhite</b></font>
    <font color="#00FFFF"><b>Aqua</b></font>
    <font color="#7FFFD4"><b>Aquamarine</b></font>
    I know I can make text different colors in a report using this technique.
    The font element has been deprecated for many years, is now obsolete, and must not be used by authors.
    To control the presentation of text, use a suitable semantic text element with CSS. If no suitable semantic text element exists, use span:
    <span style="color: #00FFFF; font-weight: bold;">Aqua</span>

Maybe you are looking for

  • WLC 5508 - AP 3602i & 1231's

    Hi all, I just got my "new toys" 2 x 5508 with 200 odd 3600 AP's. I have setup all my SSID's and they work perfectly on code AIR-CT5500-K9-7-2-110-0 AIR-CT5500-K9-7-2-111-3 AIR-CT5500-K9-7-3-101-0 Now when I tried adding a 1231 AP I keep getting the

  • New Epson WF 7620 will not print with Macbook Air, receive "Print File Was Not Accepted" message.

    Hello! To anyone who tries to help me, thank you in advance! I brought home a new Epson WF 7620 yesterday and did all the necessary stuff, installing it with my Macbook Air (Mac OS X ; 10.7.4.). I installed the software from the site, added the print

  • SSL source IP

    When using SSL modules in the CSS, does the client source IP address show up on the web server? Or does the CSS do a source NAT so the packet comes back to the SSL module?

  • Right click with 1 Bouton Mouse

    Hi, I'm using a Mini Mac with the default Apple cable mouse (1 bouton). How do you right-click in Windows? Ctrl + Mouse button doesn't work anymore...

  • Route to subnet not to host

    I am installing a Cisco RV042G router that will handle Internet access at  one location.  There is another location connected to the first location with a T1 . What I want to do is created a route to the remote subnet (across the t1) inside the RVO42