Skip Navigation

RGB Colour Mixer

By Phuong Diep
Grades 4-6
Science and Technology,
  • Programming
  • Computing and Networks
  • Technology and Society
  • Design
Tools & Languages
Little Robot Friends

Key Coding Concepts

  • Algorithms
  • Boolean Logic
  • Conditional Statements
  • Events
  • Operators
  • Sequences
  • Variables



A step-by-step set of operations to be performed to help solve a problem


Boolean Logic

and, or, not are examples of boolean logic. they are values that can be either true or false


Conditional Statements

Making decisions based on conditions i.e. if some condition is met do something, else do nothing or something else



One thing causing another thing to happen i.e. ‘when clicked’ block



Mathematical and logical expressions i.e. X+X block



Identifying a series of steps for a task. Computers and Scratch read and perform commands in order from top to bottom



Stores a piece of information i.e. score of a game that increases by 1 value for each goal

In this activity, students transform their robots into RGB Colour Mixers by programming the touch sensors into red, green, and blue colour controllers. They can mix their own colours by tapping the touch sensors to increase the colour values of their robots' LED eyes.

  • Download the LRF Blocks App on each computer.
  • Review the complete LRF Blocks file for this project.
  • (Download > Open LRF Blocks app > Select “Projects” > “Import File” > Select file from your downloads folder)
  • Print the solution sheet
  • This activity requires computers and Little Robot Friends robots.


RGB stands for red, green, and blue. This is the system for representing colours on your computer display. You can think of it as the primary colours of your computer display, but instead of it being red, yellow, and blue like we learn in elementary school, it is red, green, and blue.

The intensity of the colours is measured on a scale from 0 to 255. You can think of the value 0 as 0% of intensity and the value 255 as 100% of intensity. Any colour can be created using different combinations and proportions of red, green, and blue!


Launch the LRF Blocks App and open a new project.

Explain the different categories in the blocks menu.

Show students how to move and connect blocks to create a "script".

Give students a few minutes to experiment with the LRF Blocks App and try to control one or more of their robot's sensors.


Let’s transform your robot into an RGB Colour Mixer! Ready?

Use the solution sheet to complete the following steps:

  1. Create a new project
  2. Tell your robot which colours we are mixing
  3. Add more red
  4. Add more green
  5. Add more blue
  6. Reset the amount of colour


Check out the Little Robot Friends FAQ for possible solutions. You may need to connect robots to the LRF App and install a firmware update if it is not working.

Learning Outcomes

I can program my robot’s eyes using the RGB colour scale from 0 to 255
I can use events to control when things happen in my project
I can use conditionals to check whether or not something is true
I can use variables to store information in my project

Success Criteria

I programmed a condition to make RGB colours increment by 10
I programmed a condition to detect when a colour exceeds the maximum RGB colour value
I programmed the colours red, green, and blue to reset back to zero when it gets too bright
I programmed my robot to mix different colours when you tap different touch sensors

Can students program another sensor event into a different colour controller?

Can students figure out how to decrease a colour value when you tickle the touch sensors?

Technology in Society: Students could research the history of RGB input and output devices. Pose the question: How can electronic devices that use light be used to help people in society?

Design: Ask students to discuss how adding RGB lighting to personal devices such as keyboards and the back of monitors enhances the user’s experience or the user’s perceived experience.

Little Robot Friends

Teach lessons that are tied to your existing curriculum!


More Lesson Plans For Grades 4-6

    View All Lesson Plans

    Explore lessons based on components

    The K-12 Computer Science Framework

    Although learning how to build digital projects is a key part of Computer Science education, students should also learn a wider set of skills and competencies that will help them to harness the power of digital technologies as both creators and consumers. A comprehensive approach to K-12 Computer Science education includes learning about the following five focus areas:

    View Framework ➝


    By the end of high school, students should be able to create a simple computer program.

    Computing and Networks

    By the end of high school, students should understand and be able to use the tools and devices commonly used to build digital projects.


    By the end of high school, students should be able to explain how we use computers to create, store, organize, and analyze data.

    Technology and Society

    By the end of high school, students should be able to explore the ways in which technology and society have mutually shaped each other.


    By the end of high school, students should be able to apply design principles to the digital projects they create.