DEV Community

Cover image for Experiencing The Stroop Effect With a Ruby CLI
Paul Götze
Paul Götze

Posted on

Experiencing The Stroop Effect With a Ruby CLI

You’ve probably seen these weird lists of color words before. Words whose text color does not match their content. Maybe you’ve even tried to read the text colors out loud quickly and have struggled to do so?

These lists are part of psychological tests to demonstrate the so-called Stroop effect. It is named after the American psychologist John Ridley Stroop, who first published the effect in English in 1935.

Wikipedia tells us:

"The Stroop effect is the delay in reaction time between congruent and incongruent stimuli."

But what does that actually mean? 🤔


I built a tiny command line interface with Ruby – just because it was fun and so that you can experience the Stroop effect yourself. You can install and run it with:

gem install stroop
stroop
Enter fullscreen mode Exit fullscreen mode

Congruent? Incongruent?

A Stroop tests consists of a small task, like reading color words. This task can be done with different kind of stimuli, namely: neutral, congruent, and incongruent.

Let’s take a list of color words with a neutral stimulus, which means that all words are written in the same text color:

Color word box - neutral stimulus

Neutral Stimulus – All color words are written in a neutral text color (black, or here gray)

Reading all words out loud should not be hard to do.

Next let’s take the same list of color words, but let’s print them in a color that matches the respective text. That’s a congruent stimulus:

Color word box - congruent stimulus

Congruent Stimulus – The word content matches the text color.

If you read he words again, it might even be easier than with the neutral stimulus.

Last, let’s print the same word list again, but this time we use another text color than the color that is represented in the text. That’s an incongruent stimulus:

Color word box - incongruent stimulus

Incongruent Stimulus – The word content and the text color are different.

Reading the colors words might feel a bit slower now. However, the Stroop effect is much more apparent, if we slightly change our task:

Instead of reading out loud the color words, try saying the text color for each word as fast as possible!

With the incongruent stimulus you probably need much longer now and you might even make one or the other mistake.

And that's the Stroop effect: the delay that appears if we speak the text color out loud for the incongruent word list compared to the congruent word list.

Isn’t it fun – and really exhausting?


🌱 The above word lists were generated using the stroop gem:

stroop neutral
stroop congruent
stroop incongruent
Enter fullscreen mode Exit fullscreen mode

with the seed: 134414671674842647560860440639024210370

(FYI: I found this tiny stroop CLI to also be perfect for creating colorful artsy-fartsy wallpapers & online profile backgrounds 😉)

Top comments (0)