Entries Tagged as 'reggy'

Coloring in Reggy

So, I have already seen a few people not entirely happy with the way I implementing coloring of groups in the newest Reggy release. I figured I would just give my view of what I did and why.

My goal with Reggy from the beginning was to be simple and not look like junk. There are many other regular expression testers out there. If you like them, use them. I happen to think many of them look like dirt. Reggy may not be gorgeous, but it’s certainly not dirt either.

The first implementation of coloring was actually by a volunteer (Justin Bakse) who was nice enough to pass the code back to me to look over. It was a good start for sure. But it used an implementation that I just don’t want — for simplicity’s sake: you pick X amount of colors, then for each match the code picks one of the colors, then the next and so on, repeating. This is visually distinctive if you pick a bunch of crazy colors, but I am still thinking that picking 10 colors in the preferences is not the Mac experience I want to provide for people.

My implementation looks like this:

// Add new color to matched ranges
bool countUp = YES;
float r,g,b,a;
[[NSUnarchiver unarchiveObjectWithData:[[NSUserDefaults standardUserDefaults] objectForKey:@”match_color”]] getRed:&r green:&g blue:&b alpha:&a];
for ( unsigned int i = 0; i < [matchedRanges count]; i++ )
{
    NSRange thisRange = NSRangeFromString([matchedRanges objectAtIndex:i]);

    // Generate new color from base color
    if ( i > 0 && [[NSUserDefaults standardUserDefaults] boolForKey:@”color_submatches”] )
    {
        if ( r > 0.8 || g > 0.8 || b > 0.8 ) countUp = NO;
        if ( r < 0.0 || g < 0.0 || b < 0.0 ) countUp = YES;

        if ( countUp ) { r += 0.2; g += 0.2; b += 0.2; } else { r -= 0.2; g -= 0.2; b -= 0.2; }
    }

    [[testingStringField textStorage] addAttribute:NSForegroundColorAttributeName value:[NSColor colorWithCalibratedRed:r green:g blue:b alpha:a] range:thisRange];
}

Pretty simple I think. Get the color components of the match string color preference (r, g, b, a). Then for every match other than the first match, increment each RGB component by 20% (this is a 0 to 1 scale) or decrement depending on the component values. I came out with 0.8 as a maximum value by just testing a bunch of different match colors and found 0.8 to be around the acceptable range of readability against a white background for most colors. The increment or decrement step value of 0.2 was another value I just played around with until there was a good balance between having each color step look different, yet still provide a small enough value so as to allow as many steps as possible between 0 and 1.

If anyone has a more elegant solution, please propose it. I am not a genius, I just know what I like. And I don’t like having to pick a bunch of colors. I like the simplicity of using one color with differing brightness as it still seems that the user has control over the coloring, but maybe I could go for a color generation scheme that is based on color theories like complements or triads. Or maybe I am the only one that is this picky?

Reggy 1.3 Is Out, Get It!

I pushed out a new version of Reggy this morning.

Release Notes:

  • added preference to apply sub-match/capture group coloring: each match or capture group gets a slightly different shade of color — especially nice for nesting matches
  • added preference to automatically use the clipboard contents on startup for the regular expression and/or the testing string
  • added menu items to paste the clipboard directly into either the regular expression (Command+Shift+V) or the testing string (Command+Option+V)
  • added a new and improved Reggy icon (Leopard Compatible/Resolution Independent)
  • added help link for regular expression syntax preference (goes to wikipedia)
  • updated regular expression engine
  • simplified preferences window

Thanks should go to Steve Huff at the Harvard-MIT Data Center for requesting the startup clipboard preferences. It was a great idea that, along with the menu items to quickly paste into the fields, many people will be happy to see.

So anyways, Leopard’s icon size is big, and I mean big:

Reggy Leopard Icon

I had to redraw the icon this morning because the clipping icon I was using was swiped from Tiger. I figured it would probably be proper of me to not steal the clipping icon.

I am really excited to get onto developing a Leopard-only 2.0 version. I am starting to read through the new documentation now. Let me just say thank you to Apple for making developing stuff like Reggy fun and easy.

Reggy Screenshots

I just made a small upgrade on Reggy’s website for those of you who haven’t used Reggy.

_Screenshots_

Enjoy

Reggy v1.2 Is Ready for You

Are you ready for it?

So, now we have an appcast for you to follow on the new Reggy website. Did some last minute tweaks to make me happy and now it is up on the servers, so go get it!

What changed?

  • added user preferences
    • matched string highlight color
    • regular expression options
    • regular expression syntax
    • check for automatic updates
  • added automatic updates using the Sparkle framework

I hope you like the update. As always, feel free to file bug reports and feature requests on the issue tracker.

I plan on posting a bit of what I see for the future of Reggy soon for those who may be interested.

Reggy’s New Website

Reggy has a new home… reggyapp.com

I needed a site to host some things on to do Sparkle integration, so I went ahead and purchased the domain name to host with.

At some point I hope to do a real website with feeds and such, but for now it gives some information and links to places where Reggy can be seen and/or downloaded.

One of the real benefits of having this site is that hopefully you will be able to check just one place for updates to Reggy in the future.

Update on Reggy Development

Thanks to a few noble users, Reggy’s Bug Tracker is getting use. Most of the issues are feature requests and I am slowly getting time to get to them.

I already have preferences going. Here are a few screenshots to give you an idea of where it’s going:

General Preferences Screenshot

General Preferences Screenshot

Hopefully that will help some people out.

I am not going to release 1.2 until I get Sparkle going for automatic application updates. It looks like that will happen hopefully within this week or next.

Reggy v1.1 Is Out.

I just pushed a new version of Reggy (my little open-source project for visually matching regular expressions). Version 1.1 adds much-needed AppleScript support and the ability to change the font and font size.

Enabling AppleScript support shouldn’t be as hard as it is to grasp I think. It took a few nights fiddling around before it started working all the time for me :)

There is one known issue that I allowed to slip through concerning the AppleScript support: If you change the checkbox values for matching certain criteria, the UI doesn’t update the checkbox properly. The program gets the change properly and matches accordingly, but it’s as if the UI doesn’t see the change. Note that I am using bindings for the checkboxes so I figure this should be working. Anyone with expertise in AppleScript, please help!