Description

Check the difference (or similarity) between two colors in your game using the CIE76 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_cie76( 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 CIE76 formula is used to find the value of Delta-E, the difference between the two colors.

You can find out more about the CIE76 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. CIE76 isn't the newest formula for this kind of thing either. 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 - although we will be looking into using more recent forumlas, like CIE94 or CIE2000 to improve this asset and others in future.

UPDATE:

We have created a new asset for comparing colors using CIE94. Check it out here.

More info

End User Licence Agreement (EULA).

Version 1.0.0. Published June 29, 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.

No reviews yet

No reviews have been left for this asset - be the first!

Package contents

Loading, please wait

What is the issue?

Back to Top