From 95d4bef3ea113d7a8704613f84866045c33dbdba Mon Sep 17 00:00:00 2001 From: Alexander Ljungberg Date: Sat, 20 Apr 2013 13:42:05 +0100 Subject: [PATCH] New: - CPColor hueComponent, saturationComponent and brightnessComponent. --- AppKit/CPColor.j | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/AppKit/CPColor.j b/AppKit/CPColor.j index 16ef6411f..268ab4e31 100644 --- a/AppKit/CPColor.j +++ b/AppKit/CPColor.j @@ -658,6 +658,30 @@ var cachedBlackColor, ]; } +/*! + Returns the hue component, the H in HSB, of the receiver. +*/ +- (float)hueComponent +{ + return [self hsbComponents][0]; +} + +/*! + Returns the saturation component, the S in HSB, of the receiver. +*/ +- (float)saturationComponent +{ + return [self hsbComponents][1]; +} + +/*! + Returns the brightness component, the B in HSB, of the receiver. +*/ +- (float)brightnessComponent +{ + return [self hsbComponents][2]; +} + /*! Returns the CSS representation of this color. The color will be in one of the following forms: