Difference between revisions of "Color class"

From Catglobe Wiki
Jump to: navigation, search
(Created page with "{{CGscriptClass_Template |Name=<nowiki>Color</nowiki> |Description=<nowiki>Represents a color.</nowiki> |Constructors= {{CGscriptConstructors_Template|Parameters= {{CGscriptPa...")
 
Line 8: Line 8:
 
{{CGscriptConstructors_Template|Parameters=
 
{{CGscriptConstructors_Template|Parameters=
 
{{CGscriptParameters_Template|Type=Color|Name=<nowiki>color</nowiki>|Description=<nowiki>Base color</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=int|Name=<nowiki>alpha</nowiki>|Description=<nowiki>Alpha part</nowiki>}}
 
{{CGscriptParameters_Template|Type=Color|Name=<nowiki>color</nowiki>|Description=<nowiki>Base color</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=int|Name=<nowiki>alpha</nowiki>|Description=<nowiki>Alpha part</nowiki>}}
|Description=<nowiki>Create color from rgb</nowiki>}}
+
|Description=<nowiki>Create alpha color from existing color</nowiki>}}
 
{{CGscriptConstructors_Template|Parameters=
 
{{CGscriptConstructors_Template|Parameters=
 
{{CGscriptParameters_Template|Type=int|Name=<nowiki>red</nowiki>|Description=<nowiki>Red part</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=int|Name=<nowiki>green</nowiki>|Description=<nowiki>Green part</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=int|Name=<nowiki>blue</nowiki>|Description=<nowiki>Blue part</nowiki>}}
 
{{CGscriptParameters_Template|Type=int|Name=<nowiki>red</nowiki>|Description=<nowiki>Red part</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=int|Name=<nowiki>green</nowiki>|Description=<nowiki>Green part</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=int|Name=<nowiki>blue</nowiki>|Description=<nowiki>Blue part</nowiki>}}
Line 32: Line 32:
 
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>Red</nowiki>|HasGetter=1|Description=<nowiki>Get red part of color</nowiki>}}
 
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>Red</nowiki>|HasGetter=1|Description=<nowiki>Get red part of color</nowiki>}}
 
{{CGscriptProperties_Template|ReturnType=TypeInformation|Name=<nowiki>TypeInformation</nowiki>|HasGetter=1|Description=<nowiki>Get information about this class.</nowiki>}}
 
{{CGscriptProperties_Template|ReturnType=TypeInformation|Name=<nowiki>TypeInformation</nowiki>|HasGetter=1|Description=<nowiki>Get information about this class.</nowiki>}}
 +
|StaticMethods=
 +
{{CGscriptMethods_Template|ReturnType=Color|Name=<nowiki>Color_getByName</nowiki>|Parameters=
 +
{{CGscriptParameters_Template|Type=string|Name=<nowiki>name</nowiki>|Description=<nowiki>System color name</nowiki>}}
 +
|Description=<nowiki>Create new color object</nowiki>}}
 +
{{CGscriptMethods_Template|ReturnType=Color|Name=<nowiki>Color_getByRGB</nowiki>|Parameters=
 +
{{CGscriptParameters_Template|Type=string|Name=<nowiki>htmlhex</nowiki>|Description=<nowiki>html encoded color</nowiki>}}
 +
|Description=<nowiki>Create new color object</nowiki>}}
 +
{{CGscriptMethods_Template|ReturnType=Color|Name=<nowiki>Color_getByRGB</nowiki>|Parameters=
 +
{{CGscriptParameters_Template|Type=int|Name=<nowiki>red</nowiki>|Description=<nowiki>Red part</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=int|Name=<nowiki>green</nowiki>|Description=<nowiki>Green part</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=int|Name=<nowiki>blue</nowiki>|Description=<nowiki>Blue part</nowiki>}}
 +
|Description=<nowiki>Create new color object</nowiki>}}
 
}}
 
}}

Revision as of 03:59, 11 July 2018

Color



Represents a color.

Constructors

  • (string value "Value of color", bool ishtmlHex "If true, parse as html style hex, otherwise parse as system named color") - Create color from name
  • (Color color "Base color", int alpha "Alpha part") - Create alpha color from existing color
  • (int red "Red part", int green "Green part", int blue "Blue part") - Create color from rgb
  • (int red "Red part", int green "Green part", int blue "Blue part", int alpha "Alpha part") - Create color from rgb

Methods

  • object this[] { get; }(int index "Index") - Backward-compatible indexer
  • Empty this[] { set; }(int index "Index", object value "Value to set") - Backward-compatible indexer
  • string ToString() - The string representation of the object.

Properties

  • int Alpha { get; } - Get alpha part of color
  • int Blue { get; } - Get blue part of color
  • int Green { get; } - Get green part of color
  • string HtmlRgbaHex { get; } - Get the #xxxxxxxx html encoding of colors
  • string HtmlRgbHex { get; } - Get the #xxxxxx html encoding of colors
  • string ObjectTypeName { get; } - The name of the type of object.
  • int Red { get; } - Get red part of color
  • TypeInformation TypeInformation { get; } - Get information about this class.

Static Methods

  • Color Color_getByName(string name "System color name") - Create new color object
  • Color Color_getByRGB(string htmlhex "html encoded color") - Create new color object
  • Color Color_getByRGB(int red "Red part", int green "Green part", int blue "Blue part") - Create new color object