//
//  GSConicGradient.h
//  GlyphsCore
//
//  Created by Florian Pircher on 17.03.23.
//  Copyright © 2023 schriftgestaltung.de. All rights reserved.
//

#import <GlyphsCore/GSGradient.h>

NS_ASSUME_NONNULL_BEGIN

@interface GSConicGradient : GSGradient

/// The center of the gradient.
@property (nonatomic) NSPoint center;
/// The angle of the start color stop (in degrees counter-clockwise from the x-axis).
@property (nonatomic) CGFloat startAngle;
/// The angular distance between the start and end color stops (in degrees).
///
/// A value of 360° represents a conic gradient without a gap.
@property (nonatomic) CGFloat angle;
/// The distance from the center at which the control for the start color stop is displayed.
///
/// This distance does not affect the gradient itself and is used only for the user interface.
@property (nonatomic) CGFloat controlRadius;

/// The angle of the end color stop (in degrees counter-clockwise from the x-axis).
@property (nonatomic, readonly) CGFloat endAngle;

/// Creates a conic gradient with the given center, start angle, and angular distance.
- (instancetype)initWithCenter:(NSPoint)center startAngle:(CGFloat)startAngle angle:(CGFloat)angle controlRadius:(CGFloat)controlRadius colorLine:(GSColorLine *)colorLine extendMode:(GSGradientExtendMode)extendMode;
/// Creates a complete conic gradient with the given center and start angle.
- (instancetype)initWithCenter:(NSPoint)center startAngle:(CGFloat)startAngle controlRadius:(CGFloat)controlRadius colorLine:(GSColorLine *)colorLine extendMode:(GSGradientExtendMode)extendMode;

@end

NS_ASSUME_NONNULL_END
