PSPDFColorPalette
Objective-C
@interface PSPDFColorPalette : NSObject
Swift
class ColorPalette : NSObject
A color palette is a set of color patches that are grouped together based on a specific look or theme.
Note
Starting with iOS 14 PSPDFKit’s default UI will display the system color picker (UIColorPickerViewController
) where possible. On macOS Big Sur and later the system
color picker will also be used for select options (e.g. the highlight annotation menu).
Customizing this API will have no effect on the system color picker.
-
Creates a color palette with a given title and the patches it should group.
Declaration
Objective-C
+ (nonnull PSPDFColorPalette *) colorPaletteWithTitle:(nonnull NSString *)title colorPatches:(nonnull NSArray<PSPDFColorPatch *> *)patches;
Swift
/*not inherited*/ init(title: String, colorPatches patches: [ColorPatch])
Parameters
title
The title of the palette.
patches
The color patches that should be grouped by this palette.
Return Value
A new color palette.
-
Creates a color palette representing all colors of the hsv color space.
Declaration
Objective-C
+ (nonnull PSPDFColorPalette *)hsvColorPaletteWithTitle: (nonnull NSString *)title;
Swift
class func hsvColorPalette(withTitle title: String) -> ColorPalette
Parameters
title
The title of the palette.
Return Value
A new color palette.
-
The title of the color palette as shown in the UI.
Declaration
Objective-C
@property (nonatomic, copy, readonly) NSString *_Nonnull title;
Swift
var title: String { get }
-
The color patches this color space represents.
Declaration
Objective-C
@property (nonatomic, copy, readonly) NSArray<PSPDFColorPatch *> *_Nonnull colorPatches;
Swift
var colorPatches: [ColorPatch] { get }
-
Declaration
Objective-C
+ (nonnull PSPDFColorPalette *)unifiedColorPalette;
Swift
class func unified() -> ColorPalette
Return Value
A unified color palette with 13 rainbow colors and 5 gray scale colors.
-
Declaration
Objective-C
+ (nonnull PSPDFColorPalette *)unifiedTransparentColorPalette;
Swift
class func unifiedTransparent() -> ColorPalette
Return Value
A unified color palette with 12 rainbow colors, 5 gray scale colors and a clear color.
-
Declaration
Objective-C
+ (nonnull PSPDFColorPalette *)monochromeColorPalette;
Swift
class func monochrome() -> ColorPalette
Return Value
A monochrome color palette containing 6 gray scale colors.
-
Declaration
Objective-C
+ (nonnull PSPDFColorPalette *)monochromeTransparentPalette;
Swift
class func monochromeTransparent() -> ColorPalette
Return Value
A monochrome color palette containing 5 gray scale colors and a clear color.
-
Declaration
Objective-C
+ (nonnull PSPDFColorPalette *)modernColorPalette;
Swift
class func modern() -> ColorPalette
Return Value
A modern color palette with 6 colors.
-
Declaration
Objective-C
+ (nonnull PSPDFColorPalette *)vintageColorPalette;
Swift
class func vintage() -> ColorPalette
Return Value
A vintage color palette with 6 colors.
-
Declaration
Objective-C
+ (nonnull PSPDFColorPalette *)rainbowColorPalette;
Swift
class func rainbow() -> ColorPalette
Return Value
A color palette with 6 colors similar to those in a rainbow.
-
Declaration
Objective-C
+ (nonnull PSPDFColorPalette *)paperColorPalette;
Swift
class func paper() -> ColorPalette
Return Value
A color palette with colors suitable for page backgrounds.
-
Declaration
Objective-C
+ (nonnull PSPDFColorPalette *)hsvColorPalette;
Swift
class func hsv() -> ColorPalette
Return Value
A color palette representing the hsv color space.