simlogo1

 

 

 

SimQuest 6.4 help

 

 

Colour Models

 

In several animation elements, colours can be set as a function of a variable in your model.

There are three types of colour models:

 

RGB:        Red, Green and Blue

CMY: Cyan, Magenta and Yellow

HSB:        Hue, Saturation and Brightness

 

The RGB colour model

Using a RGB colour model, you can for instance make a ball change its background colour from black to green when the variable x exceeds the value 3. You should act as follows:

 

Add lines like these to your model:

 

red = if x < 3 then 0 else 32/255 endif

green if x < 3 then 0 else 255/255 endif

blue = if x < 3 then 0 else 32/255 endif

 

Now, edit the ball in the animation, and go to the Fill_Colour tab sheet. You have to link the variables red, green and blue to this particular animation element. This is done as follows.

 

colour_models2

Filling out the properties of the Fill_Colour tab sheet

 

The value of the variables you link to the Red, Green and Blue values need to be between 0 and 1. Regular RGB codes however consist of three values between 0 and 255, and that is why in the equation model we defined the values of red, green and blue as fractions of 255. You can look up the RGB codes of different colours in the various Default_Colour tab sheets, or use a graphics program. Simply devide all the numbers you find by 255 and link them to you animation element.

 

Alternatively, you can also enter 1/255 as a factor in the animation element editor, and use the regular RGB values in your model:

 

colour_models3

Using a factor of 1/255 in your RGB colour model

 

The CMY colour model

The CMY model works in the same way as the RGB model. The values of C (Cyan), M (Magenta) and Y (yellow) range between 0 and 1.

 

The HSB colour model

Also the HSB model works in a similar way as the RGB colour model: H (Hue), S (Saturation and B (Brightness) take values between 0 and 1. Basically the hue is used to select the colour, saturation sets the amount of white (0 = completely white, 1 is no white at all) and brightness sets the amount of black (0 is completely black and 1 is completely white).

 

 

 

Related topics:

 

 

 

Copyright University of Twente 2011