• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Filling with a pattern *and* a color?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Filling with a pattern *and* a color?


  • Subject: Re: Filling with a pattern *and* a color?
  • From: jeff ganyard <email@hidden>
  • Date: Mon, 25 Sep 2006 12:40:32 -0700

On Sep 25, 2006, at 11:14 AM, Scott Craver wrote:

Hi,

I want to draw a shape filled with a basic pattern (horizontal stripes,)
using a color specified by the user. Basically like an old-school drawing
program would.


Viewing earlier list entries, I saw that to use a pattern fill, I had to
create the pattern as an image, and use:


[ [NSColor +colorWithPatternImage: myImage] setFill];

Done and done---but this only paints the pattern exactly as I created it,
using the colors in the image. How on Earth do I fill that pattern in a
specified color?

Use a greyscale pattern and then reduce the alpha on the user's color and fill again?


Or fill with the user's color and then fill with your pattern which has an alpha channel.

Second approach might be easier to work with and present the user's color.

jeff
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Filling with a pattern *and* a color? (From: "Scott Craver" <email@hidden>)

  • Prev by Date: Re: Custom view background texture/color
  • Next by Date: Re: Webkit question
  • Previous by thread: Re: Filling with a pattern *and* a color?
  • Next by thread: Tracing Cocoa Functions
  • Index(es):
    • Date
    • Thread