Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • 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
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Color (Generics List) to Color[]

Color (Generics List) to Color[]

Scheduled Pinned Locked Moved C#
help
3 Posts 2 Posters 0 Views 1 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.
  • B Offline
    B Offline
    bobsugar222
    wrote on last edited by
    #1

    It's not as simple as it sounds List.Count != Color[].Length so I can't use List.ToArray() List will have n number of colours. I expect usually around 5-6. Color[] will probably have Length of 256. I want to dynamically blend the few colours from the List into Color[]. I'm trying to split the 256 into sections and blend 2 colours at a time. ie 256 / List.Count -1 My head's not in gear today so the Maths is escaping me... Any help appreciated. PS I'm playing with Fractals and I want to implement an editable colour palette. I did it a couple of years ago but I lost of the code and I'm trying to redo it...

    P 1 Reply Last reply
    0
    • B bobsugar222

      It's not as simple as it sounds List.Count != Color[].Length so I can't use List.ToArray() List will have n number of colours. I expect usually around 5-6. Color[] will probably have Length of 256. I want to dynamically blend the few colours from the List into Color[]. I'm trying to split the 256 into sections and blend 2 colours at a time. ie 256 / List.Count -1 My head's not in gear today so the Maths is escaping me... Any help appreciated. PS I'm playing with Fractals and I want to implement an editable colour palette. I did it a couple of years ago but I lost of the code and I'm trying to redo it...

      P Offline
      P Offline
      pbalaga
      wrote on last edited by
      #2

      And what do you want to do? Blend some colors from List<> with different colors from Color[]? To blend 2 colors at a time you don't need to split anything but rather write a loop that processes somehow each pair of colors. Then increments by 2. However, I'm confused about what you want to achieve...

      B 1 Reply Last reply
      0
      • P pbalaga

        And what do you want to do? Blend some colors from List<> with different colors from Color[]? To blend 2 colors at a time you don't need to split anything but rather write a loop that processes somehow each pair of colors. Then increments by 2. However, I'm confused about what you want to achieve...

        B Offline
        B Offline
        bobsugar222
        wrote on last edited by
        #3

        Ok, having googled a bit more, the terminology is interpolate. I have, say, 5 colours that I need to interpolate across a Color[256].

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

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