class openfl.canvas.Color

Available on all platforms

Class Fields

static function aliceBlue():Color

Returns a Color with the hexadecimal value of 0xF0F8FF.

static function antiqueWhite():Color

Returns a Color with the hexadecimal value of 0xFAEBD7.

static function aqua():Color

Returns a Color with the hexadecimal value of 0x00FFFF.

static function aquamarine():Color

Returns a Color with the hexadecimal value of 0x7FFFD4.

static function azure():Color

Returns a Color with the hexadecimal value of 0xF0FFFF.

static function beige():Color

Returns a Color with the hexadecimal value of 0xF5F5DC.

static function bisque():Color

Returns a Color with the hexadecimal value of 0xFFE4C4.

static function black():Color

Returns a Color with the hexadecimal value of 0x000000.

static function blanchedAlmond():Color

Returns a Color with the hexadecimal value of 0xFFEBCD.

static function blue():Color

Returns a Color with the hexadecimal value of 0x0000FF.

static function blueViolet():Color

Returns a Color with the hexadecimal value of 0x8A2BE2.

static function brown():Color

Returns a Color with the hexadecimal value of 0xA52A2A.

static function burlyWood():Color

Returns a Color with the hexadecimal value of 0xDEB887.

static function cadetBlue():Color

Returns a Color with the hexadecimal value of 0x5F9EA0.

static function chartreuse():Color

Returns a Color with the hexadecimal value of 0x7FFF00.

static function chocolate():Color

Returns a Color with the hexadecimal value of 0xD2691E.

static function colorByName(name:String):Color

Gets a color by a known name.

name

The name of the color. This must be the same as any one of the function names listed as static functions. Names are case-sensitive.

returns

Returns a Color type with its respective values.

static function colorFromHex(hex:String):Color

Converts the hexadecimal equivalent from a string as a Color.

hex

The string value that represents a hexadecimal value. If the alpha value is excluded, the generated alpha value defaults to 0xFF, else the included value is extracted from the given hex appropriately.

returns

Returns a Color type representing the given hex value.

static function coral():Color

Returns a Color with the hexadecimal value of 0xFF7F50.

static function cornflowerBlue():Color

Returns a Color with the hexadecimal value of 0x6495ED.

static function cornsilk():Color

Returns a Color with the hexadecimal value of 0xFFF8DC.

static function crimson():Color

Returns a Color with the hexadecimal value of 0xDC143C.

static function cyan():Color

Returns a Color with the hexadecimal value of 0x00FFFF.

static function darkBlue():Color

Returns a Color with the hexadecimal value of 0x00008B.

static function darkCyan():Color

Returns a Color with the hexadecimal value of 0x008B8B.

static function darkGoldrenrod():Color

Returns a Color with the hexadecimal value of 0xB8860B.

static function darkGray():Color

Returns a Color with the hexadecimal value of 0xA9A9A9.

static function darkGreen():Color

Returns a Color with the hexadecimal value of 0x006400.

static function darkKhaki():Color

Returns a Color with the hexadecimal value of 0xBDB76B.

static function darkMagenta():Color

Returns a Color with the hexadecimal value of 0x8B008B.

static function darkOliveGreen():Color

Returns a Color with the hexadecimal value of 0x556B2F.

static function darkOrange():Color

Returns a Color with the hexadecimal value of 0xFF8C00.

static function darkOrchid():Color

Returns a Color with the hexadecimal value of 0x9932CC.

static function darkRed():Color

Returns a Color with the hexadecimal value of 0x8B0000.

static function darkSalmon():Color

Returns a Color with the hexadecimal value of 0xE9967A.

static function darkSeaGreen():Color

Returns a Color with the hexadecimal value of 0x8FBC8F.

static function darkSlateBlue():Color

Returns a Color with the hexadecimal value of 0x483D8B.

static function darkSlateGray():Color

Returns a Color with the hexadecimal value of 0x2F4F4F.

static function darkTurquoise():Color

Returns a Color with the hexadecimal value of 0x00CED1.

static function darkViolet():Color

Returns a Color with the hexadecimal value of 0x9400D3.

static function deepPink():Color

Returns a Color with the hexadecimal value of 0xFF1493.

static function deepSkyBlue():Color

Returns a Color with the hexadecimal value of 0x00BFFF.

static function dimGray():Color

Returns a Color with the hexadecimal value of 0x696969.

static function dodgerBlue():Color

Returns a Color with the hexadecimal value of 0x1E90FF.

static function firebrick():Color

Returns a Color with the hexadecimal value of 0xB22222.

static function floralWhite():Color

Returns a Color with the hexadecimal value of 0xFFFAF0.

static function forestGreen():Color

Returns a Color with the hexadecimal value of 0x228B22.

static function fuchsia():Color

Returns a Color with the hexadecimal value of 0xFF00FF.

static function gainsboro():Color

Returns a Color with the hexadecimal value of 0xDCDCDC.

static function ghostWhite():Color

Returns a Color with the hexadecimal value of 0xF8F8FF.

static function gold():Color

Returns a Color with the hexadecimal value of 0xFFD700.

static function goldenrod():Color

Returns a Color with the hexadecimal value of 0xDAA520.

static function gray():Color

Returns a Color with the hexadecimal value of 0x808080.

static function green():Color

Returns a Color with the hexadecimal value of 0x008000.

static function greenYellow():Color

Returns a Color with the hexadecimal value of 0xADFF2F.

static function honeydew():Color

Returns a Color with the hexadecimal value of 0xF0FFF0.

static function hotPink():Color

Returns a Color with the hexadecimal value of 0xFF69B4.

static function indianRed():Color

Returns a Color with the hexadecimal value of 0xCD5C5C.

static function indigo():Color

Returns a Color with the hexadecimal value of 0x4B0082.

static function ivory():Color

Returns a Color with the hexadecimal value of 0xFFFFF0.

static function khaki():Color

Returns a Color with the hexadecimal value of 0xF0E68C.

static function lavender():Color

Returns a Color with the hexadecimal value of 0xE6E6FA.

static function lavenderBlush():Color

Returns a Color with the hexadecimal value of 0xFFF0F5.

static function lawnGreen():Color

Returns a Color with the hexadecimal value of 0x7CFC00.

static function lemonChiffon():Color

Returns a Color with the hexadecimal value of 0xFFFACD.

static function lightBlue():Color

Returns a Color with the hexadecimal value of 0xADD8E6.

static function lightCoral():Color

Returns a Color with the hexadecimal value of 0xF08080.

static function lightCyan():Color

Returns a Color with the hexadecimal value of 0xE0FFFF.

static function lightGoldenrodYellow():Color

Returns a Color with the hexadecimal value of 0xFAFAD2.

static function lightGray():Color

Returns a Color with the hexadecimal value of 0xD3D3D3.

static function lightGreen():Color

Returns a Color with the hexadecimal value of 0x90EE90.

static function lightPink():Color

Returns a Color with the hexadecimal value of 0xFFB6C1.

static function lightSalmon():Color

Returns a Color with the hexadecimal value of 0xFFA07A.

static function lightSeaGreen():Color

Returns a Color with the hexadecimal value of 0x20B2AA.

static function lightSkyBlue():Color

Returns a Color with the hexadecimal value of 0x87CEFA.

static function lightSlateGray():Color

Returns a Color with the hexadecimal value of 0x778899.

static function lightSteelBlue():Color

Returns a Color with the hexadecimal value of 0xB0C4DE.

static function lightYellow():Color

Returns a Color with the hexadecimal value of 0xFFFFE0.

static function lime():Color

Returns a Color with the hexadecimal value of 0x00FF00.

static function limeGreen():Color

Returns a Color with the hexadecimal value of 0x32CD32.

static function linen():Color

Returns a Color with the hexadecimal value of 0xFAF0E6.

static function magenta():Color

Returns a Color with the hexadecimal value of 0xFF00FF.

static function maroon():Color

Returns a Color with the hexadecimal value of 0x800000.

static function mediumAquamarine():Color

Returns a Color with the hexadecimal value of 0x66CDAA.

static function mediumBlue():Color

Returns a Color with the hexadecimal value of 0x0000CD.

static function mediumOrchid():Color

Returns a Color with the hexadecimal value of 0xBA55D3.

static function mediumPurple():Color

Returns a Color with the hexadecimal value of 0x9370DB.

static function mediumSeaGreen():Color

Returns a Color with the hexadecimal value of 0x3CB371.

static function mediumSlateBlue():Color

Returns a Color with the hexadecimal value of 0x7B68EE.

static function mediumSpringGreen():Color

Returns a Color with the hexadecimal value of 0x00FA9A.

static function mediumTurquoise():Color

Returns a Color with the hexadecimal value of 0x48D1CC.

static function mediumVioletRed():Color

Returns a Color with the hexadecimal value of 0xC71585.

static function midnightBlue():Color

Returns a Color with the hexadecimal value of 0x191970.

static function mintCream():Color

Returns a Color with the hexadecimal value of 0xF5FFFA.

static function mistyRose():Color

Returns a Color with the hexadecimal value of 0xFF34E1.

static function moccasin():Color

Returns a Color with the hexadecimal value of 0xFFE4B5.

static function navajoWhite():Color

Returns a Color with the hexadecimal value of 0xFFDEAD.

static function navy():Color

Returns a Color with the hexadecimal value of 0x000080.

static function oldLace():Color

Returns a Color with the hexadecimal value of 0xFDF5E6.

static function olive():Color

Returns a Color with the hexadecimal value of 0x808000.

static function oliveDrab():Color

Returns a Color with the hexadecimal value of 0x6B8E23.

static function orange():Color

Returns a Color with the hexadecimal value of 0xFFA500.

static function orangeRed():Color

Returns a Color with the hexadecimal value of 0xFF4500.

static function orchid():Color

Returns a Color with the hexadecimal value of 0xDA70D6.

static function paleGoldenrod():Color

Returns a Color with the hexadecimal value of 0xEEE8AA.

static function paleGreen():Color

Returns a Color with the hexadecimal value of 0x98FB98.

static function paleTurquoise():Color

Returns a Color with the hexadecimal value of 0xAFEEEE.

static function paleVioletRed():Color

Returns a Color with the hexadecimal value of 0xDB7093.

static function papayaWhip():Color

Returns a Color with the hexadecimal value of 0xFFEFD5.

static function peachPuff():Color

Returns a Color with the hexadecimal value of 0xFFDAB9.

static function peru():Color

Returns a Color with the hexadecimal value of 0xCD853F.

static function pink():Color

Returns a Color with the hexadecimal value of 0xFFC0CB.

static function plum():Color

Returns a Color with the hexadecimal value of 0xDDA0DD.

static function powderBlue():Color

Returns a Color with the hexadecimal value of 0xB0E0E6.

static function purple():Color

Returns a Color with the hexadecimal value of 0x800080.

static function red():Color

Returns a Color with the hexadecimal value of 0xFF0000.

static function rosyBrown():Color

Returns a Color with the hexadecimal value of 0xBC8F8F.

static function royalBlue():Color

Returns a Color with the hexadecimal value of 0x4169E1.

static function saddleBrown():Color

Returns a Color with the hexadecimal value of 0x8B4513.

static function salmon():Color

Returns a Color with the hexadecimal value of 0xFA8072.

static function sandyBrown():Color

Returns a Color with the hexadecimal value of 0xF4A460.

static function seaGreen():Color

Returns a Color with the hexadecimal value of 0x2E8B57.

static function seaShell():Color

Returns a Color with the hexadecimal value of 0xFFF5EE.

static function sienna():Color

Returns a Color with the hexadecimal value of 0xA0522D.

static function silver():Color

Returns a Color with the hexadecimal value of 0xC0C0C0.

static function skyBlue():Color

Returns a Color with the hexadecimal value of 0x87CEEB.

static function slateBlue():Color

Returns a Color with the hexadecimal value of 0x6A5ACD.

static function slateGray():Color

Returns a Color with the hexadecimal value of 0x708090.

static function snow():Color

Returns a Color with the hexadecimal value of 0xFFFAFA.

static function springGreen():Color

Returns a Color with the hexadecimal value of 0x00FF7F.

static function steelBlue():Color

Returns a Color with the hexadecimal value of 0x4682B4.

static function tan():Color

Returns a Color with the hexadecimal value of 0xD2B48C.

static function teal():Color

Returns a Color with the hexadecimal value of 0x008080.

static function thistle():Color

Returns a Color with the hexadecimal value of 0xD8BFD8.

static function tomato():Color

Returns a Color with the hexadecimal value of 0xFF6347.

static function turquoise():Color

Returns a Color with the hexadecimal value of 0x40E0D0.

static function violet():Color

Returns a Color with the hexadecimal value of 0xEE82EE.

static function wheat():Color

Returns a Color with the hexadecimal value of 0xF5DEB3.

static function white():Color

Returns a Color with the hexadecimal value of 0xFFFFFF.

static function whiteSmoke():Color

Returns a Color with the hexadecimal value of 0xF5F5F5.

static function yellow():Color

Returns a Color with the hexadecimal value of 0xFFFF00.

static function yellowGreen():Color

Returns a Color with the hexadecimal value of 0x9ACD32.

Instance Fields

var alpha:Float

Returns only the alpha value extracted from valueWithAlpha as a Float percentage from 0-1.

var value:Int

Returns the color without the alpha channel (red, green, blue)

var valueWithAlpha:UInt

Returns the color with the alpha channel (alpha, red, green, blue).

function new(?red:Int = 0, ?green:Int = 0, ?blue:Int = 0, ?alpha:Int = 255):Void

Creates a Color type with the given values.

red

The red channel identifying a range from 0-255, or a hexadecimal value up to 0xFF.

green

The green channel identifying a range from 0-255, or a hexadecimal value up to 0xFF.

blue

The blue channel identifying a range from 0-255, or a hexadecimal value up to 0xFF.

alpha

The alpha channel identifying a range from 0-255, or a hexadecimal value up to 0xFF.