ColorTools - Tools for color management in Mac OS X and iOS, supporting Adobe Swatch Exchange and NSColorList formats
Tools for color management in Mac OS X and iOS, supporting Adobe Swatch Exchange and NSColorList formats
seen from Belgium
seen from United States
seen from United States

seen from United States
seen from United States

seen from Malaysia
seen from Chile
seen from China
seen from Ukraine
seen from China

seen from New Zealand
seen from China

seen from United States

seen from Mexico

seen from United States

seen from United States
seen from China
seen from Hong Kong SAR China
seen from China
seen from Argentina
ColorTools - Tools for color management in Mac OS X and iOS, supporting Adobe Swatch Exchange and NSColorList formats
Tools for color management in Mac OS X and iOS, supporting Adobe Swatch Exchange and NSColorList formats

Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
Free to watch โข No registration required โข HD streaming
Converting an NSColor to a CGColor
Here's an easy way to convert an NSColor to a CGColor:
- (CGColorRef)NSColorToCGColor:(NSColor *)color { NSInteger numberOfComponents = [color numberOfComponents]; CGFloat components[numberOfComponents]; CGColorSpaceRef colorSpace = [[color colorSpace] CGColorSpace]; [color getComponents:(CGFloat *)&components]; CGColorRef cgColor = CGColorCreate(colorSpace, components); return cgColor; }
Easy.
NSView ๋ฐฑ๊ทธ๋ผ์ด๋ ์์, ์ด๋ฏธ์ง ์ค์ .
NSView ์๋ ๋ฐฐ๊ฒฝ์์์ ์ค์ ํ๊ธฐ ์ํ ๋ณ๋์ ๋ฉ์๋๊ฐ ์์ต๋๋ค.
๊ฐ์ฅ ์ฌํํ ๋ทฐ์ธ๋ฐ ์ด๋ฐ ๋ฉ์๋๊ฐ ์์ด์ ์ง์ ์ปค์คํ ๋ทฐ๋ฅผ ๋ง๋ค์ด์ NSView๋ฅผ ์์๋ฐ๊ณ ,
- (void) drawRect:(NSRect)dirtRect;
๋ฉ์๋๋ฅผ Override ํด์ผํฉ๋๋ค.
์ฐธ๊ณ ๋ก, ์ธ์๋ก ๋์ด์ค๋ dirtRect ๋ NSView ์ ์ ์ฒด ํ๋ ์์ด ์๋๊ณ ,
๊ฐฑ์ ๋์ด์ผํ๋ ์์ญ์ ๋๋ค. (invalidate rect ๋ฅผ ์๊ฐํ๋ฉด ๋ ๋ฏ..)
* ๋ฐฐ๊ฒฝ์์ ์ฑ์ฐ๊ธฐ
- (void) drawRect:(NSRect)dirtRect
{
[[NSColor blueColor]ย setFill];
NSRectFill([self bounds]);
}
์ [NSColor blueColor] ๋ฅผ ๋ณ๊ฒฝํ๊ธฐ ์ํ ๋ฉค๋ฒ๋ง ์ถ๊ฐํ๋ฉด ๋๊ฒ ๊ตฐ์..
* ๋ฐฐ๊ฒฝํจํด์ด๋ฏธ์ง ์ฑ์ฐ๊ธฐ
- (void) drawRect:(NSRect)dirtRect
{
[[NSColor colorWithPatternImage:patternImage] setFill];
NSRectFill([self bounds]);
}