colour_get_value

Returns the value of the colour given.

Syntax:

GML Code Example

colour_get_value(col);


Argument Description
col The colour to check


Returns: Real


Description

This function will return the value (luminosity) of the given colour. This is the amount of the "light" that is mixed into the final colour and is part of the hue, saturation and value method for defining a colour. The following image illustrates how this value corresponds to the HSV scale of colour:


Example:

GML Code Example

col = make_colour_hsv(random(255), 255, colour_get_val(c_teal));

The above code gets the value used to make the colour constant "c_teal" and then uses that value to set a random colour to have the same luminosity, storing the resulting colour in the variable "col".





No Examples Submitted

Does this page need better examples? Be the first to Submit

No Edits Suggested

Is this page unclear or not descriptive enough? Suggest an edit to the page and with enough upvotes your changes will be made.

No Questions Have Been Ask

Do you have a question about this page? Ask it Here