summaryrefslogtreecommitdiff
path: root/SmartDeviceLink/SDLRGBColor.h
blob: 3702b1b05e4586041b09a57953eaa7abe2f6f6f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//
//  SDLRGBColor.h
//  SmartDeviceLink
//
//  Created by Joel Fischer on 5/18/18.
//  Copyright © 2018 Livio. All rights reserved.
//

#import <UIKit/UIKit.h>

#import "NSNumber+NumberType.h"
#import "SDLRPCStruct.h"

NS_ASSUME_NONNULL_BEGIN

/// Represents an RGB color
///
/// @since 5.0
@interface SDLRGBColor : SDLRPCStruct

/**
 Create an SDL color object with red / green / blue values between 0-255

 @param red The red value of the color
 @param green The green value of the color
 @param blue The blue value of the color
 @return The color
 */
- (instancetype)initWithRed:(UInt8)red green:(UInt8)green blue:(UInt8)blue;

/**
 Create an SDL color object with a UIColor object.

 @warning The alpha color of the UIColor object will be ignored

 @param color The UIColor object to base this color on
 @return The color
 */
- (instancetype)initWithColor:(UIColor *)color;

/**
 *  The red value of the RGB color
 *  Required, Integer, 0-255
 */
@property (copy, nonatomic) NSNumber<SDLInt> *red;

/**
 *  The green value of the RGB color
 *  Required, Integer, 0-255
 */
@property (copy, nonatomic) NSNumber<SDLInt> *green;

/**
 *  The blue value of the RGB color
 *  Required, Integer, 0-255
 */
@property (copy, nonatomic) NSNumber<SDLInt> *blue;

@end

NS_ASSUME_NONNULL_END