. color method
-
http://code.google.com/apis/sketchup/docs/ourdoc/material.html#color
When using it on a solid colour you get something like: Color [25,46,72,255]
the first 3 elements are the rgb bits, but whats the final element? it's not transparency...
-
Cheers Tig, that makes sense.
-
@tig said:
For acolor it's always = 255 [100% opaque]... there is a color.alpha= method but it's never ever worked, you must set alpha [transparency] for a material itself not material.color e.g. material.alpha=0.4 for 40% opacity will work but the material.color.alpha still reports 255 [100%], if you try to change it, it just does nothing !
So to recap - the fourth item in a SUp material.color array is its alpha [r,g,b,a] but it's not used ! The alpha of the material itself works as a 0 to 1.0, equivalent to % setting of opacity...
http://code.google.com/apis/sketchup/docs/ourdoc/color.htmlThis is one for the API Docs thread.
-
Added it
-
For a color it's always = 255 [100% opaque]... there is a color.alpha= method but it's never ever worked, you must set alpha [transparency] for a material itself not material.color e.g. material.alpha=0.4 for 40% opacity will work but the material.color.alpha still reports 255 [100%], if you try to change it, it just does nothing !
So to recap - the fourth item in a SUp material.color array is its alpha [r,g,b,a] but it's not used ! The alpha of the material itself works as a 0 to 1.0, equivalent to % setting of opacity...
http://code.google.com/apis/sketchup/docs/ourdoc/color.html
Advertisement