SilverScreen Solid Modeler

SS_RGB

SS_RGB

Previous topic Next topic  

SS_RGB

Previous topic Next topic JavaScript is required for the print function  

SilverSharpAPI

 

SilverSharp.SS_RGB

 

Structure

The SilverSharp.SS_RGB object stores color information for a SilverScreen drawing. It also contains methods which convert SilverScreen-format colors to other useful forms

 

 

 

C# Code

 

value struct SS_RGB

  {

  SS_RGB(int r, int g, int b);

 

  string ToString();

 

  byte R;

  byte G;

  byte B;

 

  property double GrayIntensity { get; set; }

 

  uint       ToRGB();

  uint       ToCOLORREF();

  int        ToColorIndex();

   

  System.Windows.Media.Color           ToColor();

  System.Windows.Media.SolidColorBrush ToSolidBrush();

 

  static SS_RGB FromColor(System.Windows.Media.Color clr);

  static SS_RGB FromColorIndex(int color_index);

  static SS_RGB FromRGB(uint rgb);

  static SS_RGB FromCOLORREF(uint wrgb);

  static SS_RGB FromSolidBrush(System::Windows::Media::SolidColorBrush ^br);

  static SS_RGB Parse(String ^text);

  };

 

 

 

Properties

Name

Description

R

Read + Write property to get/set the red component of the color. This value is between 0 (for no red contribution) and 255 (for full red contribution).

G

Read + Write property to get/set the green component of the color.  This value is between 0 (for no green contribution) and 255 (for full green contribution).

B

Read + Write property to get/set the blue component of the color.  This value is between 0 (for no blue contribution) and 255 (for full blue contribution).

GrayIntensity

Read + Write property to get/set the color based on a grayscale intensity. When the property is read, the RGB-triple is converted to a grayscale value using the NTSC video standard. When the property is written, the color object becomes a shade of gray and R,G, and B will be equal. An intensity is between 0 and 1.

 

 

Members

Name

Description

FromColor

Creates an SS_RGB object from a System.Windows.Media.Color object

FromColorIndex

Creates an SS_RGB object from an index into the standard SilverScreen palette.

FromCOLORREF

Creates an SS_RGB object from a Win32 COLORREF

FromRGB

Creates an SS_RGB object from a SilverC-compatible RGB value

FromSolidBrush

Creates an SS_RGB object from a System.Windows.Media.SolidColorBrush object

Parse

Creates an SS_RGB object from a string representation (i.e. "black")

SS_RGB

Constructor to initialize the object

ToColor

Converts the SS_RGB object to a System.Windows.Media.Color object

ToColorIndex

Converts the SS_RGB object to a color index into the standard SilverScreen palette.

ToCOLORREF

Converts the SS_RGB object to a Win32 COLORREF

ToRGB

Converts the SS_RGB object to a SilverC-compatible RGB value.

ToSolidBrush

Converts the SS_RGB object to a System.Windows.Media.SolidColorBrush object

ToString

Formats the SS_RGB object as a string appropriate for a command

 

 

Remarks

The SilverSharp.SS_RGB contains a type converter to facilitate XML declarations.

 

See Also

also1, also2, also3