monkey2 color?

Community Forums/Monkey Talk/monkey2 color?

AdamStrange(Posted 2016) [#1]
ok, how do I directly access the color command? E.G.

canvas.Color = New Color(0.06, 0.06, 0.06)


I have no idea where to look to find out what Color is made up from, logic would dictate red, green, blue, or Red, Green, Blue or maybe even r,g,b

I want to be able to access canvas.Color.red I want to see what canvas.Color.red is and I want to change canvas.Color.red

Pity there is no help, no command list, nothing!!!!!!
I'll even write it, but finding out where anything is in the language is not a simple task


Wiebo(Posted 2016) [#2]
If you look at the module source you can find out what is exactly the case, but also the docs in the monkey2/docs folder (use the index.html file) will give you access to what is docced at the moment.

Color btw is R,G,B,A (all floats, from 0.0 to 1.0)


degac(Posted 2016) [#3]
Looking in the source code the Class Color has the .r .g .b .a for red,green, blue and alpha parameters.


AdamStrange(Posted 2016) [#4]
mmm, yes, but

If you look at the module source

which module? how do you know it is in a module?

again
Looking in the source code the Class Color has the .r .g .b .a

which source


Pete Rigz(Posted 2016) [#5]
The color Struct is in the std module where you'll find a lot of the other general stuff like vec and matrix:

std/graphics/color.monkey2


skidracer(Posted 2016) [#6]
Docs are searchable, go here and type Color into the search box (do NOT hit enter)


RustyKristi(Posted 2016) [#7]
sorry wrong post..


skidracer(Posted 2016) [#8]
btw the search also reveals that std.graphics.Color is not alone and mojo.graphics.Canvas.Color is also a thing...


Wiebo(Posted 2016) [#9]
Yes, but there it's a property of the canvas (a field) . You can have properties having with the name.