Changes

Jump to navigation Jump to search

gc:setColorRGB

949 bytes added, 07:48, 6 August 2011
Created page with "gc:'''setColorRGB''' is a function that is part of the gc (Graphics Context). It sets the color of subsequent ''draw'' and ''fill'' operations. {{Since|3.0}} ..."
gc:'''setColorRGB''' is a function that is part of the [[:Category:gc|gc]] (Graphics Context).

It sets the color of subsequent ''draw'' and ''fill'' operations.

{{Since|3.0}}

== Syntax ==
gc:'''setColorRGB'''(red, green, blue)

{| class="wikitable"
|-
! Parameter !! Type !! Description
|-
| <u><center>red</center></u> || number || A number from 0 to 255 representing the "amount" of red in the color
|-
| <u><center>green</center></u> || number || A number from 0 to 255 representing the "amount" of green in the color
|-
| <u><center>blue</center></u> || number || A number from 0 to 255 representing the "amount" of blue in the color
|}

== Example ==
<syntaxhighlight>
function on.paint(gc)
gc:setColorRGB(0,0,0)
gc:drawString("Hello you",0,0,"top") -- will display that text in black

gc:setColorRGB(255,0,0)
gc:drawString("Hello you too",20,20,"top") -- will display that text in red
end
</syntaxhighlight>


[[Category:gc]]

Navigation menu