Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7054509
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:38:08+00:00 2026-05-28T03:38:08+00:00

I found this great subclass of NSWindow , however it does not add any

  • 0

I found this great subclass of NSWindow, however it does not add any noise to the gradient of the toolbar. If you look closely at The App Store, Reeder or Twitter they all have noise over the gradient.

How do I add noise to a gradient?

I found this thread but I don’t understand how to put this into code.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T03:38:09+00:00Added an answer on May 28, 2026 at 3:38 am

    First of all the nessesary code has been added to INAppStoreWindow, so i have no use case for this anymore. However for people who would like to know how to do this, heres how it’s done by INAppStoreWindow.

    First a function for making the image with noise is created.

    static CGImageRef createNoiseImageRef(NSUInteger width, NSUInteger height, CGFloat factor)
    {
        NSUInteger size = width*height;
        char *rgba = (char *)malloc(size); srand(124);
        for(NSUInteger i=0; i < size; ++i){rgba[i] = rand()%256*factor;}
        CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceGray();
        CGContextRef bitmapContext = 
        CGBitmapContextCreate(rgba, width, height, 8, width, colorSpace, kCGImageAlphaNone);
        CFRelease(colorSpace);
        free(rgba);
        CGImageRef image = CGBitmapContextCreateImage(bitmapContext);
        CFRelease(bitmapContext);
        return image;
    }
    

    Then the image is used to overlay the noise over the current graphics

        static CGImageRef noisePattern = nil;
        if (noisePattern == nil) noisePattern = createNoiseImageRef(128, 128, 0.015);
        [NSGraphicsContext saveGraphicsState];
        [[NSGraphicsContext currentContext] setCompositingOperation:NSCompositePlusLighter];
        CGRect noisePatternRect = CGRectZero;
        noisePatternRect.size = CGSizeMake(CGImageGetWidth(noisePattern), CGImageGetHeight(noisePattern));        
        CGContextRef context = [[NSGraphicsContext currentContext] graphicsPort];
        CGContextDrawTiledImage(context, noisePatternRect, noisePattern);
        [NSGraphicsContext restoreGraphicsState];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I found this great jQuery slideshow: http://slidesjs.com/examples/images-with-captions/ However, I'd like it so the caption
I found this great snippet online for a searchable FAQ. However, I was wondering
I found this great code on MSDN for a UDP Client/Server connection, however the
I found this great article on Transactions with Table Adapters. However, this article doesn't
I found this great example of horizontal parallax http://www.perandersen.no/sandbox/parallax/ The only modification I would
I found this great class, all works well except... I spcify the output directory
I found this great code snippet that works wonderfully during circumstances that change a
I found this great Tablesorter plugin for jQuery but I can't make it work
I have just found this great tutorial as it is something that I need.
I found this question which is a great starting point towards creating embedded widgets

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.