Color values related to the RGB color modell

Hi All,

Could you please tell me the relation between the RGB and the ScRGB color modell.

What is 255 in Sc Is this 1.00000 or 0.00000

What is 128 in Sc Is this 0.5.... Or is there another way to compute the Sc values from the old RGB modell

Thank you!!



Answer this question

Color values related to the RGB color modell

  • dfad44Kyle

    One more thing.  The ScRGB color space has a larger color gamut than the RGB color space (it represents a wider range of colors).  So, if you are using ScRGB color values and you then convert to RGB or use the RGB color components of the color object, some color information can be clamped (lost). 

    If myColor.ScB = 1.2 and you grab the myColor.R you'll lose the information above 1.  So R will return 255.  If you query the ScR property, the value will still be 1.2 but if you set myColor.R = 255, then myColor.ScR will then be 1 and you have lost that information. 

    If you're simple using the RGB color space, then you don't need to worry about this.



  • Ryan98034

    RGB and ScRGB are two different color spaces. RGB is a subset of ScRGB. but the values that represents the colors in the color spaces are differet. If R = 1, then ScR is not equal to 1.

    The Color class in WPF has properties A,R,B,G (Alpha,Red,Blue,Green) which represents the color components of the RGB color space and properties for ScA, ScR, ScB, ScG which represents color components ofthe ScRGB color space.

    These properties on the Color class are synchronized. So, if you change the B color component of a color object, the ScB property will be automatically change to reflect the same color. In other words, the property B will represents the same color that the value ScB represents.

    255 in RGB is equal to 1 in ScRGB, and 0 in RGB is equal to 0 in ScRGB, but for other values you'll want to query the properties on the color object if you want the actual values of the RGB and ScRGB color components.

    For example, in C#

    if myColor is an instance of the Color class and you do the following,

    myColor.A = 100;

    then myColor.ScA will automatically be updated to the value of the same color in ScRGB values.

    There is more info at the online docs for the Color class:

    http://windowssdk.msdn.microsoft.com/library/default.asp url=/library/en-us/cpref33/html/T_System_Windows_Media_Color.asp

    Does this help



  • Color values related to the RGB color modell