Color RGB: Difference between revisions

From StarLogo Nova Wiki
(updates from Blockument)
(Marked this version for translation)
 
Line 2: Line 2:
<translate>
<translate>


<!--T:2-->
<section begin="image"/>[[File:color_rgb.png|alt=The Color RGB Block|thumb]]<section end="image"/><p id="tooltip">Returns a color made by blending numerical values of red, green, and blue. Refer to an RGB chart to obtain specific colors.</p>
<section begin="image"/>[[File:color_rgb.png|alt=The Color RGB Block|thumb]]<section end="image"/><p id="tooltip">Returns a color made by blending numerical values of red, green, and blue. Refer to an RGB chart to obtain specific colors.</p>


==Usage==
==Usage== <!--T:3-->


<!--T:4-->
This block will create a color with an amount of red, green, and blue in it as specified by the input values.
This block will create a color with an amount of red, green, and blue in it as specified by the input values.


==Syntax==
==Syntax== <!--T:5-->


<!--T:6-->
Inputs in this block:
Inputs in this block:
#a number less than or equal to 255, for the red value
#a number less than or equal to 255, for the red value
Line 15: Line 18:
#a number less than or equal to 255, for the blue value
#a number less than or equal to 255, for the blue value


==Example==
==Example== <!--T:7-->


<!--T:8-->
[[File:color_rgb_example.gif|alt=Color RGB example gif|thumb]]
[[File:color_rgb_example.gif|alt=Color RGB example gif|thumb]]
[[File:color_rgb_example.png|alt=Color RGB example code|thumb]]
[[File:color_rgb_example.png|alt=Color RGB example code|thumb]]


<!--T:9-->
The model above depicts colorful turtles wandering throughout spaceland. The color of these turtles can be changed to a random value using a created button: ‘color change!’ Whenever that button is pushed, the turtle agents change their color to a random value. Take note that by using the red green blue block, there is a much wider spectrum of color available compared to simply using built in colors.
The model above depicts colorful turtles wandering throughout spaceland. The color of these turtles can be changed to a random value using a created button: ‘color change!’ Whenever that button is pushed, the turtle agents change their color to a random value. Take note that by using the red green blue block, there is a much wider spectrum of color available compared to simply using built in colors.



Latest revision as of 19:14, 14 August 2023

Other languages:
The Color RGB Block

Returns a color made by blending numerical values of red, green, and blue. Refer to an RGB chart to obtain specific colors.

Usage

This block will create a color with an amount of red, green, and blue in it as specified by the input values.

Syntax

Inputs in this block:

  1. a number less than or equal to 255, for the red value
  2. a number less than or equal to 255, for the green value
  3. a number less than or equal to 255, for the blue value

Example

Color RGB example gif
Color RGB example code

The model above depicts colorful turtles wandering throughout spaceland. The color of these turtles can be changed to a random value using a created button: ‘color change!’ Whenever that button is pushed, the turtle agents change their color to a random value. Take note that by using the red green blue block, there is a much wider spectrum of color available compared to simply using built in colors.