Confusion about FColor constructor

Right as we start the debug line in lecture 73, a constructor is used for FColor to make it red.

FColor(255, 0, 0)

But, the IDE shows a fourth parameter for alpha. If the alpha is missing, the constructor still works!
FColor::FColor(uint8 InR, uint8 InG, uint8 InB, uint8 InA = (uint8)’’)

This constructor definition raises many questions, and none of them are answered on the official API doc: https://docs.unrealengine.com/latest/INT/API/Runtime/Core/Math/FColor/index.html

  1. If you didn’t know already, how would you know that A is alpha? I could only find this by going into Color.h and finding a few references to the word “alpha”. It’s not obvious from the resources I’ve used so far.
  2. How would you know that InA isn’t required?
  3. What does the syntax InA = (uint8)’’ mean? Why are there two quotes there?

I’m trying to understand how I could figure these things out on my own. I know it’s going to get more confusing, so I want to lock it down on a simple example.

Thanks!

  1. Similar ways in which you did.
  2. When you see = in the parameter list, that means it has a default value and can be excluded.
  3. Not sure what (uint323)" is supposed to mean but looking at the declaration in the header it’s uint8 InA = 255

Privacy & Terms