Bug 29756 - NSColor returns incorrect Component property values.
Summary: NSColor returns incorrect Component property values.
Status: VERIFIED FIXED
Alias: None
Product: Xamarin.Mac
Classification: Desktop
Component: Library (Xamarin.Mac.dll) ()
Version: 2.0.0
Hardware: PC Windows
: High normal
Target Milestone: 2.4.0 (C6)
Assignee: Rolf Bjarne Kvinge [MSFT]
URL:
Depends on:
Blocks:
 
Reported: 2015-05-05 12:04 UTC by Jon Douglas [MSFT]
Modified: 2015-10-08 07:58 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Reproduction (13.19 KB, application/x-zip-compressed)
2015-05-05 12:04 UTC, Jon Douglas [MSFT]
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
VERIFIED FIXED

Description Jon Douglas [MSFT] 2015-05-05 12:04:40 UTC
Created attachment 11069 [details]
Reproduction

*Description

The "RedComponent", "GreenComponent", "BlueComponent" and the
"AlphaComponent" properties of NSColor return incorrect values.

*Reproduction

When you launch the sample, it will show a color picker and eight text boxes. When you
select a color with the color picker, it will show the RGBA values of the
color in the text boxes. The top row of text boxes shows the (incorrect)
values using the properties above, the bottom row of text boxes show the
(correct) values that were returned using the GetRGBA method.

            var color = colorWell.Color;
            nfloat red, green, blue, alpha;
            color.GetRgba (out red, out green, out blue, out alpha);

            // The values from the properties are wrong, they should match the values above returned by GetRgba
            red2.StringValue = color.RedComponent.ToString ("0.#####");
            green2.StringValue = color.GreenComponent.ToString ("0.#####");
            blue2.StringValue = color.BlueComponent.ToString ("0.#####");
            alpha2.StringValue = color.AlphaComponent.ToString ("0.#####");

*Version Information

Xamarin Studio
Version 5.9 (build 431)
Installation UUID: 2d44ddb9-f3de-41a5-830c-84a513b818ba
Runtime:
Mono 4.0.0 ((detached/d136b79)
GTK+ 2.24.23 (Raleigh theme)

Package version: 400000143

Apple Developer Tools
Xcode 6.3.1 (7703)
Build 6D1002

Xamarin.iOS
Version: 8.10.0.267 (Enterprise Edition)
Hash: 6481535
Branch: master
Build date: 2015-04-27 04:38:13-0400

Xamarin.Android
Version: 5.1.0.115 (Enterprise Edition)
Android SDK: /Users/jlipsky/Library/Developer/Xamarin/android-sdk-macosx
Supported Android versions:
2.3 (API level 10)
4.0.3 (API level 15)
4.1 (API level 16)
4.2 (API level 17)
4.3 (API level 18)
4.4 (API level 19)
5.0 (API level 21)
Java SDK: /usr
java version "1.7.0_60"
Java(TM) SE Runtime Environment (build 1.7.0_60-b19)
Java HotSpot(TM) 64-Bit Server VM (build 24.60-b09, mixed mode)

Xamarin Android Player
Version: Unknown version
Location: /Applications/Xamarin Android Player.app

Xamarin.Mac
Version: 2.0.0.262 (Enterprise Edition)

Build Information
Release ID: 509000431
Git revision: 7560726734fc7267de2fa9abed2509968deefaa8
Build date: 2015-04-17 19:25:48-04
Xamarin addins: 2e772c734ab3148054eae7bf8949f340fdeb5e5e

Operating System
Mac OS X 10.10.2
Darwin Jons-MacBook-Pro-2.local 14.1.0 Darwin Kernel Version 14.1.0
Thu Feb 26 19:26:47 PST 2015
root:xnu-2782.10.73~1/RELEASE_X86_64 x86_64
Comment 1 Chris Hamons 2015-05-05 12:10:09 UTC
This is a 64-bit issue. Moving to 32-bit Unified keeps the value in sync.
Comment 2 Rolf Bjarne Kvinge [MSFT] 2015-05-06 05:56:45 UTC
Fixed.

maccore/master: daeabf6514d436eca1877d93a9c3980af0bbfa26
Comment 3 Rajneesh Kumar 2015-10-08 07:58:16 UTC
I have checked this issue with cycle 6 build
 xamarin.mac-2.4.0.79_b5396c29ec2b327de2dd542c8d57fd7312368ba7
and observed that this issue has been fixed and no longer exist with build. Now the top row of text boxes shows the correct values using the properties mentioned in bug description and values that were returned using the GetRGBA method.

Screencast: http://www.screencast.com/t/1mIO9By4tG

This issue has been fixed, hence I am closing this issue.

Thanks..!

Environment Info:

=== Xamarin Studio ===

Version 5.10 (build 813)
Installation UUID: 0b7eaebc-a0ed-4b58-81df-91e378cad28c
Runtime:
	Mono 4.2.1 (explicit/29c1622)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 402010067

=== Xamarin.Profiler ===

Version: 0.0.0.0
Location: /Applications/XamarinProfiler.Mac.app/Contents/MacOS/XamarinProfiler.Mac

=== Apple Developer Tools ===

Xcode 7.0 (8227)
Build 7A220

=== Xamarin.iOS ===

Version: 9.2.0.85 (Enterprise Edition)
Hash: 7bcf0da
Branch: master
Build date: 2015-10-05 17:54:02-0400

=== Xamarin.Android ===

Version: 6.0.0.9 (Enterprise Edition)
Android SDK: /Users/Admin_Mac/Desktop/Anddk/android-sdk-macosx
	Supported Android versions:
		2.3    (API level 10)
		4.0.3  (API level 15)
		4.1    (API level 16)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		5.0    (API level 21)
		5.1    (API level 22)

SDK Tools Version: 24.3.4
SDK Platform Tools Version: 23.0.1
SDK Build Tools Version: 22.0.1

Java SDK: /usr
java version "1.7.0_25"
Java(TM) SE Runtime Environment (build 1.7.0_25-b15)
Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)

=== Xamarin Android Player ===

Version: 0.6.1
Location: /Applications/Xamarin Android Player.app

=== Xamarin.Mac ===

Version: 2.4.0.79 (Enterprise Edition)

=== Build Information ===

Release ID: 510000813
Git revision: 388e41428fb8f2910833c87fec0e7edaccd4f436
Build date: 2015-10-05 12:26:38-04
Xamarin addins: f21b254b56b36e417daee6da8b0300076f286ef1
Build lane: monodevelop-lion-cycle6

=== Operating System ===

Mac OS X 10.11.0
Darwin Admin-Macs-Mac-mini.local 15.0.0 Darwin Kernel Version 15.0.0
    Wed Aug 26 16:57:32 PDT 2015
    root:xnu-3247.1.106~1/RELEASE_X86_64 x86_64