I love the smell of UnrealEd crashing in the morning. – tarquin
The type color is not a built-in type, but a struct defined in the Object(RTNP, U1, UT, U2, U2XMP, UE2Runtime, UT2003, UT2004, UDK, UT3) class of all Unreal Engine games.
The color struct is used for drawing certain things with the Canvas and HUD with a specified color that is set with the 4 members of type byte(or float for LinearColor struct) which are R(Red), G(Green), B(Blue) and A(Alpha).
Making a color
local Color BlueColor; BlueColor = MakeColor( 0, 0, 255, 255 );
this will create a blue color and assign it to BlueColor.
- Substracts a color by another color e.g.
local Color BlueColor; local Color BlackColor; BlueColor = MakeColor( 0, 0, 255, 255 ); BlackColor = BlueColor - MakeColor( 0, 0, 255, 255 );
Subtracts the blue color from BlueColor and would become a black color assigned to BlackColor.
* Multiplies a color by the scalar (i.e. float) value e.g.
local Color BlueColor; BlueColor = MakeColor( 0, 0, 255, 255 ); BlueColor = BlueColor * 0.5f;
Multiplies BlueColor by half thus BlueColor will become darkblue.
+ Adds a color to a color e.g.
local Color BlueColor; local Color PurpleColor; BlueColor = MakeColor( 0, 0, 255, 255 ); PurpleColor = BlueColor + MakeColor( 255, 0, 0, 255 );
Merges BlueColor with a red color and becomes purple then assigns to PurpleColor.
Because the above operators are slow it is recommend to convert them to a Vector first and then use the vector operators instead of the color operators when you are making use of the same color and same operators a lot in one function.
Because of the lack of many color operations you can view a list of community made color operations at UnrealScript utils to use in your project.
|Declarations||Preprocessor • Classes • Interfaces • Cpptext • Constants • Enums • Structs • Variables (Metadata) • Replication block • Operators • Delegates • Functions • States • Defaultproperties (Subobjects)|
|Types||bool • byte • float • int • name • string • Object • Class • Enums • Structs (Vector ⋅ Rotator ⋅ Quat ⋅ Color) • Static arrays • Dynamic arrays • Delegates • Typecasting|
|Literals||Boolean • Float • Integer • Names • Objects (None ⋅ Self) • Vectors • Rotators • Strings|
|Flow||GoTo • If • Assert • Return • Stop • Switch • While • Do...Until • For • ForEach • Break • Continue|
|Specifiers||Super • Global • Static • Default • Const|
|UnrealScript||Syntax • .UC • .UCI • .UPKG • Comments • #directives • Native|