Skip to content

Commit 77b6b4e

Browse files
Merge pull request livecode#1601 from runrevsebastien/bugfix-14098
Bugfix 14098
2 parents 1eafe81 + b1f4f3f commit 77b6b4e

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

engine/src/mac-dialog.mm

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,11 @@ -(void) getColor
840840
{
841841
NSColor *t_color;
842842

843-
t_color = [[mColorPanel color] colorUsingColorSpaceName: NSCalibratedRGBColorSpace];
843+
// Do not calibrate the colour. As stated in the doc for -colorUsingColorSpace
844+
// "The new NSColor object. This method converts the receiver's color to an equivalent
845+
// one in the new color space. Although the new color might have different component
846+
// values, it looks the same as the original."
847+
t_color = [mColorPanel color];
844848

845849
// Convert the value from to a colour component value.
846850
s_color_dialog_color . red = (uint2) ([t_color redComponent] * UINT16_MAX);
@@ -899,10 +903,10 @@ void MCPlatformBeginColorDialog(const char *p_title, const MCColor& p_color)
899903

900904
// SN-2014-11-28: [[ Bug 14098 ]] Make use of the initial colour
901905
CGFloat t_divider = UINT16_MAX;
902-
NSColor* t_initial_color = [NSColor colorWithRed:(CGFloat)p_color.red / t_divider
903-
green:(CGFloat)p_color.green / t_divider
904-
blue:(CGFloat)p_color.blue / t_divider
905-
alpha:1];
906+
NSColor* t_initial_color = [NSColor colorWithCalibratedRed:(CGFloat)p_color.red / t_divider
907+
green:(CGFloat)p_color.green / t_divider
908+
blue:(CGFloat)p_color.blue / t_divider
909+
alpha:1];
906910
[t_colorPicker setColor:t_initial_color];
907911

908912
NSView* t_pickerView;

0 commit comments

Comments
 (0)