sketchucation logo sketchucation
    • Login
    โ„น๏ธ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    . color method

    Scheduled Pinned Locked Moved Developers' Forum
    5 Posts 3 Posters 244 Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R Offline
      remus
      last edited by

      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...

      http://remusrendering.wordpress.com/

      1 Reply Last reply Reply Quote 0
      • R Offline
        remus
        last edited by

        Cheers Tig, that makes sense.

        http://remusrendering.wordpress.com/

        1 Reply Last reply Reply Quote 0
        • thomthomT Offline
          thomthom
          last edited by

          @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.html

          This is one for the API Docs thread.

          Thomas Thomassen โ€” SketchUp Monkey & Coding addict
          List of my plugins and link to the CookieWare fund

          1 Reply Last reply Reply Quote 0
          • R Offline
            remus
            last edited by

            Added it ๐Ÿ‘

            http://remusrendering.wordpress.com/

            1 Reply Last reply Reply Quote 0
            • TIGT Offline
              TIG Moderator
              last edited by

              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

              TIG

              1 Reply Last reply Reply Quote 0
              • 1 / 1
              • First post
                Last post
              Buy SketchPlus
              Buy SUbD
              Buy WrapR
              Buy eBook
              Buy Modelur
              Buy Vertex Tools
              Buy SketchCuisine
              Buy FormFonts

              Advertisement