How to create Colour() with a string

Home Forums General Programming How to create Colour() with a string

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #27098
    dasfaker
    Keymaster
      • Topics: 80
      • Replies: 793
      • Total: 873
      • ★★★

      I want to get a colour property of a component, so I get “FF000000”. I want to pass this string to create a colour (colour1 = Colour()).

      I’ve tried to use this but fails:

      col1 = StringRef(comp:getPropertyString("componentBubbleBackgroundColour1"))
      col2 = Colour()
      col2:fromString(col1)

      #27099
      atom
      Keymaster
        • Topics: 159
        • Replies: 2945
        • Total: 3104
        • ★★★★★

        One more thing i fucked up, i assigned the fromString method as a non-static and it’s defined as a static method in JUCE, so you should be doing something like this:

        c = Colour.fromString("0xffff0000")

        i fixed this now and i will post a fix today.

        #27100
        dasfaker
        Keymaster
          • Topics: 80
          • Replies: 793
          • Total: 873
          • ★★★

          Thanks

        Viewing 3 posts - 1 through 3 (of 3 total)
        • The forum ‘Programming’ is closed to new topics and replies.
        There is currently 0 users and 70 guests online
        No users are currently active
        Forum Statistics
        Threads: 2,495, Posts: 17,374, Members: 77,605
        Most users ever online was 12 on January 22, 2019 3:47 pm
        Ctrlr