//
//  UIColor+ANavMap.m
//  AMapNavIOSSDK
//
//  Created by admin on 2026/4/11.
//

#import "UIColor+ANavMap.h"

@implementation UIColor (ANavMap)


//格式：HEX
+ (UIColor *)hp_colorWithRGBHex:(UInt32)hex
{
    CGFloat r = (hex >> 16) & 0xFF;
    CGFloat g = (hex >> 8) & 0xFF;
    CGFloat b = (hex) & 0xFF;
    CGFloat a = 1.0f;
    return [UIColor colorWithRed:r / 255.0f
                           green:g / 255.0f
                            blue:b / 255.0f
                           alpha:a];
}

+ (UIColor *)hp_colorWithRGBHex:(UInt32)hex alpha:(CGFloat)alpha
{
    CGFloat r = (hex >> 16) & 0xFF;
    CGFloat g = (hex >> 8) & 0xFF;
    CGFloat b = (hex) & 0xFF;
    CGFloat a = alpha;
    return [UIColor colorWithRed:r / 255.0f
                           green:g / 255.0f
                            blue:b / 255.0f
                           alpha:a];
}


//格式：AHEX
+ (UIColor *)hp_colorWithRGBAHEX:(UInt32)hex
{
    CGFloat r = (hex >> 24) & 0xFF;
    CGFloat g = (hex >> 16) & 0xFF;
    CGFloat b = (hex >> 8) & 0xFF;
    CGFloat a = (hex) & 0xFF;
    return [UIColor colorWithRed:r / 255.0f
                           green:g / 255.0f
                            blue:b / 255.0f
                           alpha:a / 255.0f];
}


@end
