Learn to Program with ZedLX

Free Online Programming Course for Beginners

The Type color [3/11]

Let's compare a custom azure color, stored in the variable azure, with the azure color of the labeled initalizer /azure .
[Run the program]

We can see that the variable azure contains a color slightly darker then the color of the the labeled initalizer /azure .

In the first statement of the source code, the variable azure was assigned a value of type color by an unlabeled initializer. An unmarked initializer consists of expressions inside square brackets []. An unmarked initializer for type color contains three expressions, each specifying a value for one of the members .r, .g and .b, in that order.

Loading...