Check the difference (or similarity) between two colors in your game using the CIE94 formula.

This script checks two color values (provided as arguments in standard GM format) and returns the color difference as a numerical value. The closer to zero the value is, the more alike the colors are.

How does it work?

The script is used as follows:

colors_compare_cie94( color_one, color_two );

The script gets the RGB values of the two colors and converts them to XYZ values and then to Lab values. Then, the CIE94 formula is used to find the value of Delta-E (94), the difference between the two colors.

You can find out more about the CIE94 formula here: Wikipedia

Why is this useful?

There are many different applications of this script that could be useful. You could use the returned value to check how well your character blends into the background of your level (for stealth games) or you could use it to create a "green screen" effect. You could also use this value to make your games more friendly to users with vision problems. Let your imagination run wild?

Is it 100% foolproof?

Unfortunately, no. Mathematically calculating the similarity between two colors is no substitute for a healthy human eye. CIE94 isn't perfect. You may notice various areas where more similar colors, as perceived by our eyes, are given an 'odd' rating by the formula. This is unfortunately unavoidable.

More info

End User Licence Agreement (EULA).

Version 1.0.0. Published June 30, 2015

Created with GameMaker: Studio v1.4.1565

Age Rating: 4+

Privacy Policy

Average Rating

This asset hasn't received enough reviews yet.

Your review

You can only review assets you've bought.


Gitle M 27 June 2016

does what it says on the tin

one bug but was fixable and probably GM's own fault

Package contents

Loading, please wait

What is the issue?

Back to Top