Navigation

    CreatiCode Scratch Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • CreatiCode

    color sensing

    Help
    3
    6
    270
    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.
    • E
      Emerson Rowberry last edited by

      how to sense a range of colors or multiple values between two selected colors

      jeffreyrb03-gmail info-creaticode 2 Replies Last reply Reply Quote 1
      • jeffreyrb03-gmail
        JaecadeJnight Mod Helper @ejrowberry09-12248f6d last edited by jeffreyrb03-gmail

        @ejrowberry09-12248f6d I don’t know what you mean exactly but here are blocks for sensing colors in general:
        b15dc6c5-18a2-4fc2-b71f-abe2f3b2618a-image.png
        1st one is from automation, second is in events, and the bottom one is in sensing.

        Now, to actually answer your question in a helpful way, first, you can use this online tool if you need it for like a one time thing:
        https://meyerweb.com/eric/tools/color-blend/#FF0000:990033:10:hex
        7a6810ad-3ee3-41c0-b581-bc8326e41e6a-image.png

        And for blocks, well blocks for that doesn’t exist.

        #LLJW
        <span style="color:white;background-image:linear-gradient(to right, lightblue, navy)">My name is Jeff</span>

        1 Reply Last reply Reply Quote 0
        • info-creaticode
          CreatiCode @ejrowberry09-12248f6d last edited by

          @ejrowberry09-12248f6d

          Maybe you can try to use “OR” to combine multiple color sensing blocks?

          63ee80dc-b0be-4ba2-bb78-1588a4c06a14-image.png

          E 1 Reply Last reply Reply Quote 1
          • E
            Emerson Rowberry @info-creaticode last edited by

            @info-creaticode I mean that I want to do something like select one shade of green and another shade of green, and everything in-between without having to write every hex code manually and hardcode it

            info-creaticode 1 Reply Last reply Reply Quote 1
            • info-creaticode
              CreatiCode @ejrowberry09-12248f6d last edited by

              @ejrowberry09-12248f6d

              In that case, it is easier to get the value of the color component and check if it is within a range. For example, if the color component is between 30 and 38, it is some kind of green:

              922bf3de-9e9d-4023-b9ed-43478c0c4572-image.png

              You can go further by checking saturation and brightness as well if you need it to be more precise.

              E 1 Reply Last reply Reply Quote 1
              • E
                Emerson Rowberry @info-creaticode last edited by

                @info-creaticode THANK YOU SO MUCH

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post