1 /*
2     NSColor_PPUtilities.h
3 
4     Copyright 2013-2018 Josh Freeman
5     http://www.twilightedge.com
6 
7     This file is part of PikoPixel for Mac OS X and GNUstep.
8     PikoPixel is a graphical application for drawing & editing pixel-art images.
9 
10     PikoPixel is free software: you can redistribute it and/or modify it under
11     the terms of the GNU Affero General Public License as published by the
12     Free Software Foundation, either version 3 of the License, or (at your
13     option) any later version approved for PikoPixel by its copyright holder (or
14     an authorized proxy).
15 
16     PikoPixel is distributed in the hope that it will be useful, but WITHOUT ANY
17     WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18     FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
19     details.
20 
21     You should have received a copy of the GNU Affero General Public License
22     along with this program. If not, see <http://www.gnu.org/licenses/>.
23 */
24 
25 #import <Cocoa/Cocoa.h>
26 #import "PPSRGBUtilities.h"
27 #import "PPBitmapPixelTypes.h"
28 
29 
30 @interface NSColor (PPUtilities)
31 
32 - (PPImageBitmapPixel) ppImageBitmapPixelValue;
33 
34 - (bool) ppIsEqualToColor: (NSColor *) otherColor;
35 
36 - (NSColor *) ppColorBlendedWithColor: (NSColor *) otherColor;
37 - (NSColor *) ppColorBlendedWith25PercentOfColor: (NSColor *) otherColor;
38 
39 + (NSColor *) ppMaskBitmapOnColor;
40 + (NSColor *) ppMaskBitmapOffColor;
41 
42 
43 // +ppColorWithData_DEPRECATED: was deprecated because it is not cross-platform compatible
44 // between OS X & GNUstep (uses NSArchiver format, which is platform-specific) - should not be
45 // used for current files, only for loading files created by older versions (1.0b4 & earlier)
46 
47 + (NSColor *) ppColorWithData_DEPRECATED: (NSData *) colorData;
48 
49 @end
50 
51 @interface NSColor (PPUtilities_PatternColors)
52 
53 + (NSColor *) ppCheckerboardPatternColorWithBoxDimension: (float) boxDimension
54                                                 color1: (NSColor *) color1
55                                                 color2: (NSColor *) color2;
56 
57 + (NSColor *) ppDiagonalCheckerboardPatternColorWithBoxDimension: (float) boxDimension
58                                                         color1: (NSColor *) color1
59                                                         color2: (NSColor *) color2;
60 
61 + (NSColor *) ppIsometricCheckerboardPatternColorWithBoxDimension: (float) boxDimension
62                                                         color1: (NSColor *) color1
63                                                         color2: (NSColor *) color2;
64 
65 + (NSColor *) ppDiagonalLinePatternColorWithLineWidth: (float) lineWidth
66                                                 color1: (NSColor *) color1
67                                                 color2: (NSColor *) color2;
68 
69 + (NSColor *) ppIsometricLinePatternColorWithLineWidth: (float) lineWidth
70                                                 color1: (NSColor *) color1
71                                                 color2: (NSColor *) color2;
72 
73 + (NSColor *) ppCenteredVerticalGradientPatternColorWithHeight: (unsigned) height
74                                                     innerColor: (NSColor *) innerColor
75                                                     outerColor: (NSColor *) outerColor;
76 
77 + (NSColor *) ppFillOverlayPatternColorWithSize: (float) patternSize
78                                     fillColor: (NSColor *) fillColor;
79 
80 @end
81