Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
hyperPad

hyperPad Forum

  1. Home
  2. Help and Support
  3. Store and Modify a Colour with Code: Possible? How?

Store and Modify a Colour with Code: Possible? How?

Scheduled Pinned Locked Moved Help and Support
31 Posts 5 Posters 6.2k Views 3 Watching
  • 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.
  • D Deeeds

    @GameCRAZY IT IS A STRING!!!

    That IS the problem.

    D Offline
    D Offline
    Deeeds
    wrote on last edited by
    #19

    @GameCRAZY do you know what I mean if I say "different data types?"

    Michael KhalfinG 1 Reply Last reply
    0
    • D Deeeds

      @GameCRAZY do you know what I mean if I say "different data types?"

      Michael KhalfinG Offline
      Michael KhalfinG Offline
      Michael Khalfin
      wrote on last edited by
      #20

      @Deeeds Yes, but you can still work with strings. I do know some Swift.

      D 1 Reply Last reply
      0
      • Michael KhalfinG Michael Khalfin

        @Deeeds Yes, but you can still work with strings. I do know some Swift.

        D Offline
        D Offline
        Deeeds
        wrote on last edited by
        #21

        @GameCRAZY If you don't have access to type casting, nor can you set a type, then once data has had its type changed by the system (hyperPad) and it's no longer compatible with the data required of colouring something (what we're speculating is happening here) then that is the problem.

        So labels of no use.

        Michael KhalfinG 1 Reply Last reply
        0
        • D Deeeds

          @GameCRAZY If you don't have access to type casting, nor can you set a type, then once data has had its type changed by the system (hyperPad) and it's no longer compatible with the data required of colouring something (what we're speculating is happening here) then that is the problem.

          So labels of no use.

          Michael KhalfinG Offline
          Michael KhalfinG Offline
          Michael Khalfin
          wrote on last edited by
          #22

          @Deeeds The label is only checking whether it's actually a string.

          T D 3 Replies Last reply
          0
          • Michael KhalfinG Michael Khalfin

            @Deeeds The label is only checking whether it's actually a string.

            T Offline
            T Offline
            Thecheater887
            wrote on last edited by
            #23

            @GameCRAZY hyperPad implicitly converts everything to the needed data type at runtime.

            1 Reply Last reply
            0
            • Michael KhalfinG Michael Khalfin

              @Deeeds The label is only checking whether it's actually a string.

              D Offline
              D Offline
              Deeeds
              wrote on last edited by Deeeds
              #24

              @GameCRAZY No, the label makes a best effort to show what it can. It's not a type checking mechanism, it's a type handling mechanism.

              And your contention, from the beginning, that both debugging by a label and that a label are somehow necessary are both wrongheaded. And you've continued to try to back that. That's why you're in a loop.

              Just let that idea go. Labels cannot help, in this situation, and theCheater has already isolated anything a label could tell us.

              1 Reply Last reply
              0
              • Michael KhalfinG Michael Khalfin

                @Deeeds The label is only checking whether it's actually a string.

                D Offline
                D Offline
                Deeeds
                wrote on last edited by Deeeds
                #25

                @GameCRAZY Let me try to explain why your claim that a label will help is wrong, so you can see why it is that I'm telling you it's wrong, and you might understand why you feel the way you currently do.

                You said you know a little Swift, that will help understand this.

                Swift is an incredibly type strict language, for reasons Chris Lattner had in mind for the future that will now never be: Namely, that Swift should be the next language used to make the next operating system. But Swift still has convenience handlers, like printing a line to the console.

                If you print something to the console, with Swift, looking at the output, you can't tell what type it is. It doesn't show. Just the content does (in most cases).

                So an Int, Int64, Vector, String, Hex number, they all look the same.

                If you show a label of a Hex number it's going to look EXACTLY the same as a label of the same figures as a string. The label doesn't help you know what type something is because it just makes a best effort to output something.

                AND, @Thecheater887 had already isolated anything else the label could tell us as not being useful... he'd already done a round test to find where exactly his "code" was failing.

                When you continued to press for your claim that a label would help, in the face of it being wrong twice, I pushed back.

                If you feel hurt, or anything else, that's a result of pushing on something that is probably wrong.

                Michael KhalfinG 1 Reply Last reply
                0
                • D Deeeds

                  @GameCRAZY Let me try to explain why your claim that a label will help is wrong, so you can see why it is that I'm telling you it's wrong, and you might understand why you feel the way you currently do.

                  You said you know a little Swift, that will help understand this.

                  Swift is an incredibly type strict language, for reasons Chris Lattner had in mind for the future that will now never be: Namely, that Swift should be the next language used to make the next operating system. But Swift still has convenience handlers, like printing a line to the console.

                  If you print something to the console, with Swift, looking at the output, you can't tell what type it is. It doesn't show. Just the content does (in most cases).

                  So an Int, Int64, Vector, String, Hex number, they all look the same.

                  If you show a label of a Hex number it's going to look EXACTLY the same as a label of the same figures as a string. The label doesn't help you know what type something is because it just makes a best effort to output something.

                  AND, @Thecheater887 had already isolated anything else the label could tell us as not being useful... he'd already done a round test to find where exactly his "code" was failing.

                  When you continued to press for your claim that a label would help, in the face of it being wrong twice, I pushed back.

                  If you feel hurt, or anything else, that's a result of pushing on something that is probably wrong.

                  Michael KhalfinG Offline
                  Michael KhalfinG Offline
                  Michael Khalfin
                  wrote on last edited by
                  #26

                  @Deeeds I don't feel hurt... No, I just wanted a proper explanation, and I thought it was worth trying.

                  1 Reply Last reply
                  0
                  • T Thecheater887

                    @Aidan-Oxley Forming and using a color.

                    I start with β€œ#” stored in a box container.

                    I then generate 6 random numbers and append them to the box container, so it should read like β€œ#1F390C” thus far. I then append FF for 100% opacity.

                    Output that to a change color, and my logic all the sudden doesn’t run by it, when with a standard-typed #FFFFFFFF or anything else functions normally.

                    Jack de WildeJ Offline
                    Jack de WildeJ Offline
                    Jack de Wilde
                    wrote on last edited by
                    #27

                    @Thecheater887 said in Store and Modify a Colour with Code: Possible? How?:

                    @Aidan-Oxley Forming and using a color.

                    I start with β€œ#” stored in a box container.

                    I then generate 6 random numbers and append them to the box container, so it should read like β€œ#1F390C” thus far. I then append FF for 100% opacity.

                    Output that to a change color, and my logic all the sudden doesn’t run by it, when with a standard-typed #FFFFFFFF or anything else functions normally.

                    This works fine for me:
                    0_1515110602634_IMG_0722.PNG

                    I'd suggest what @GameCRAZY is saying and outputting the string to a label or text input to verify it is a valid colour.

                    T Michael KhalfinG 2 Replies Last reply
                    0
                    • Jack de WildeJ Jack de Wilde

                      @Thecheater887 said in Store and Modify a Colour with Code: Possible? How?:

                      @Aidan-Oxley Forming and using a color.

                      I start with β€œ#” stored in a box container.

                      I then generate 6 random numbers and append them to the box container, so it should read like β€œ#1F390C” thus far. I then append FF for 100% opacity.

                      Output that to a change color, and my logic all the sudden doesn’t run by it, when with a standard-typed #FFFFFFFF or anything else functions normally.

                      This works fine for me:
                      0_1515110602634_IMG_0722.PNG

                      I'd suggest what @GameCRAZY is saying and outputting the string to a label or text input to verify it is a valid colour.

                      T Offline
                      T Offline
                      Thecheater887
                      wrote on last edited by
                      #28

                      @Jack8680 I was using ifs instead of an array, and started the box container with a β€˜#’ instead of empty like you did.

                      Jack de WildeJ 1 Reply Last reply
                      0
                      • T Thecheater887

                        @Jack8680 I was using ifs instead of an array, and started the box container with a β€˜#’ instead of empty like you did.

                        Jack de WildeJ Offline
                        Jack de WildeJ Offline
                        Jack de Wilde
                        wrote on last edited by
                        #29

                        @Thecheater887 the # and opacity are optional; it's pretty lenient. You can also do something like "f00" and it will understand it as "#FF0000FF" (red). Using ifs should still work, could there be a mistake in your behaviours somewhere?

                        1 Reply Last reply
                        0
                        • T Offline
                          T Offline
                          Thecheater887
                          wrote on last edited by
                          #30

                          It’s possible, but I distinctly recall my loops not looping as many times as I told them to.

                          1 Reply Last reply
                          0
                          • Jack de WildeJ Jack de Wilde

                            @Thecheater887 said in Store and Modify a Colour with Code: Possible? How?:

                            @Aidan-Oxley Forming and using a color.

                            I start with β€œ#” stored in a box container.

                            I then generate 6 random numbers and append them to the box container, so it should read like β€œ#1F390C” thus far. I then append FF for 100% opacity.

                            Output that to a change color, and my logic all the sudden doesn’t run by it, when with a standard-typed #FFFFFFFF or anything else functions normally.

                            This works fine for me:
                            0_1515110602634_IMG_0722.PNG

                            I'd suggest what @GameCRAZY is saying and outputting the string to a label or text input to verify it is a valid colour.

                            Michael KhalfinG Offline
                            Michael KhalfinG Offline
                            Michael Khalfin
                            wrote on last edited by
                            #31

                            @Jack8680 Exactly!

                            1 Reply Last reply
                            0

                            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                            With your input, this post could be even better πŸ’—

                            Register Login
                            Reply
                            • Reply as topic
                            Log in to reply
                            • Oldest to Newest
                            • Newest to Oldest
                            • Most Votes


                            • Login

                            • Login or register to search.
                            • First post
                              Last post
                            0
                            • Categories
                            • Recent
                            • Tags
                            • Popular
                            • Users
                            • Search