Skip to content

Commit ab913b8

Browse files
committed
Documentation.
1 parent 845b74b commit ab913b8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+12501
-43
lines changed

Assets/ColorSet.png

-220 KB
Loading

ColorSet.xcodeproj/project.pbxproj

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,23 @@
437437
};
438438
/* End PBXHeadersBuildPhase section */
439439

440+
/* Begin PBXLegacyTarget section */
441+
0556FA752343510900EB91DB /* ColorSetKit-Documentation */ = {
442+
isa = PBXLegacyTarget;
443+
buildArgumentsString = "";
444+
buildConfigurationList = 0556FA782343510900EB91DB /* Build configuration list for PBXLegacyTarget "ColorSetKit-Documentation" */;
445+
buildPhases = (
446+
);
447+
buildToolPath = /usr/bin/make;
448+
buildWorkingDirectory = Documentation;
449+
dependencies = (
450+
);
451+
name = "ColorSetKit-Documentation";
452+
passBuildSettingsInEnvironment = 1;
453+
productName = "ColorSetKit-Documentation";
454+
};
455+
/* End PBXLegacyTarget section */
456+
440457
/* Begin PBXNativeTarget section */
441458
0543AE6120DC33BC00284E99 /* ColorSet */ = {
442459
isa = PBXNativeTarget;
@@ -516,6 +533,9 @@
516533
};
517534
};
518535
};
536+
0556FA752343510900EB91DB = {
537+
CreatedOnToolsVersion = 11.0;
538+
};
519539
057DC44A22B1492200BA6727 = {
520540
CreatedOnToolsVersion = 10.2.1;
521541
};
@@ -541,6 +561,7 @@
541561
0543AE6120DC33BC00284E99 /* ColorSet */,
542562
05CD4AB920ED7CD100DBDE99 /* ColorSetKit */,
543563
057DC44A22B1492200BA6727 /* ColorSetKit-Test */,
564+
0556FA752343510900EB91DB /* ColorSetKit-Documentation */,
544565
);
545566
};
546567
/* End PBXProject section */
@@ -778,6 +799,18 @@
778799
};
779800
name = Release;
780801
};
802+
0556FA762343510900EB91DB /* Debug */ = {
803+
isa = XCBuildConfiguration;
804+
buildSettings = {
805+
};
806+
name = Debug;
807+
};
808+
0556FA772343510900EB91DB /* Release */ = {
809+
isa = XCBuildConfiguration;
810+
buildSettings = {
811+
};
812+
name = Release;
813+
};
781814
057DC45322B1492200BA6727 /* Debug */ = {
782815
isa = XCBuildConfiguration;
783816
buildSettings = {
@@ -884,6 +917,15 @@
884917
defaultConfigurationIsVisible = 0;
885918
defaultConfigurationName = Release;
886919
};
920+
0556FA782343510900EB91DB /* Build configuration list for PBXLegacyTarget "ColorSetKit-Documentation" */ = {
921+
isa = XCConfigurationList;
922+
buildConfigurations = (
923+
0556FA762343510900EB91DB /* Debug */,
924+
0556FA772343510900EB91DB /* Release */,
925+
);
926+
defaultConfigurationIsVisible = 0;
927+
defaultConfigurationName = Release;
928+
};
887929
057DC45622B1492200BA6727 /* Build configuration list for PBXNativeTarget "ColorSetKit-Test" */ = {
888930
isa = XCConfigurationList;
889931
buildConfigurations = (

ColorSetKit/ColorPair.swift

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,69 @@
2424

2525
import Cocoa
2626

27+
/**
28+
* Represents a color pair.
29+
*
30+
* Color pairs contains a primary color, as well as an optional variant
31+
* for the dark mode and optional lightness variants..
32+
*
33+
* - Authors:
34+
* Jean-David Gadina
35+
*
36+
* - Seealso: `LightnessPair`
37+
*/
2738
@objc public class ColorPair: NSObject
2839
{
29-
@objc public dynamic var color: NSColor?
30-
@objc public dynamic var variant: NSColor?
40+
/**
41+
* The main/primary color.
42+
*/
43+
@objc public dynamic var color: NSColor?
44+
45+
/**
46+
* An optional color variant to use on dark mode interfaces.
47+
*/
48+
@objc public dynamic var variant: NSColor?
49+
50+
/**
51+
* Predefined lightness variants for the main/primary color.
52+
*/
3153
@objc public dynamic var lightnesses: [ LightnessPair ] = []
3254

55+
/**
56+
* Default convenience initializer.
57+
* Returns a color pair with no color, variant or lightness variant.
58+
*
59+
* - Seealso: `init(color:)`
60+
* - Seealso: `init(color:variant:)`
61+
*/
3362
@objc public convenience override init()
3463
{
3564
self.init( color: nil, variant: nil )
3665
}
3766

67+
/**
68+
* Initializes a color pair with a color.
69+
* No variant or lightness variant will be set.
70+
*
71+
* - parameter color: The main/primary color
72+
*
73+
* - Seealso: `init()`
74+
* - Seealso: `init(color:variant:)`
75+
*/
3876
@objc public convenience init( color: NSColor? )
3977
{
4078
self.init( color: color, variant: nil )
4179
}
4280

81+
/**
82+
* Initializes a color pair with a color and a dark mode variant.
83+
*
84+
* - parameter color: The main/primary color
85+
* - parameter variant: The variant color for the dark mode
86+
*
87+
* - Seealso: `init()`
88+
* - Seealso: `init(color:)`
89+
*/
4390
@objc public init( color: NSColor?, variant: NSColor? )
4491
{
4592
self.color = color

0 commit comments

Comments
 (0)