Search Unity

  1. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  2. Want more efficiency in your development work? Sign up to receive weekly tech and creative know-how from Unity experts.
    Dismiss Notice
  3. Participate with students all over the world and build projects to teach people. Join now!
    Dismiss Notice
  4. Build games and experiences that can load instantly and without install. Explore the Project Tiny Preview today!
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  6. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Color Palette - Manage all your color palettes directly inside Unity!

Discussion in 'Assets and Asset Store' started by PygmyMonkey, Mar 18, 2015.

  1. PygmyMonkey

    PygmyMonkey

    Joined:
    Jan 13, 2014
    Posts:
    277
    Color Palette
    Manage all your color palettes directly inside Unity!

    Instead of manually setting each color from the color picker, you can just pick the color you want from the Color Palette Window. You can even apply an entire palette on all the objects in your scene with just one click.

    Features
    - Manage all your color palettes on a single window,
    - Create random palettes from multiple algorithms,
    - Import palettes from various formats,
    - Import palettes directly from websites,
    - Tell your gameObjects to use a palette,
    - Change your gameObjects color palette in one click (in the editor and at runtime too!),
    - Clean C# code.



    Links
    - Available on the Asset Store,
    - Website with full documentation, examples and FAQ.






     
    Last edited: Mar 27, 2015
    mimminito likes this.
  2. PygmyMonkey

    PygmyMonkey

    Joined:
    Jan 13, 2014
    Posts:
    277
    The package (with an update) is now live on the Asset Store!

    Here's the changelog:
    Version 1.1.0
    - NEW
    Added .ase, .aco and .gpl file types support for importing palettes.
    - NEW Import palette from websites with a single click on a button.
    - NEW You can now import palettes from colourLovers.com, dribbble.com and colorcombos.com.
    - NEW Improved the create palette section and added algorithms to create random palettes (random, random pastel, random vivid, random from color, golden ratio and gradient).
     
  3. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,225
    Hiya! :)

    This is beautiful! I have some questions already, just out of curiosity for now.
    1. is it possible to change palettes at runtime (this would be supercool, if performant)?
    2. do they work with every GameObject's component (material, sprite, image, text)?
    Congratulations on this great asset :)
     
  4. PygmyMonkey

    PygmyMonkey

    Joined:
    Jan 13, 2014
    Posts:
    277
    Hey Daniele :) Thanks a lot!

    So yes, you can already say what you're asking ;)
    You can see the doc here: http://www.pygmymonkey.com/tools/color-palette/#tab-1417387713690-6-1
    And take a look starting 2:10 at the video here:

    You'll see that we can change the current palette from the Editor Window, but in the demo scene, you can also press play, and you'll see an OnGUI runtime script with buttons that will change the palette at runtime!
    For the moment, they work on sprite, image, text and renderer (material), I'll add support for other things as time goes on and people ask (because I don't know what to add).

    I still have to test the performance, currently an event is fired and every object that listen to it will react accordingly and change the palette they use.
    I also will improve this feature in the future, so you can easily customize all the children of a gameObject inside a single inspector, this will be awesome :)
     
  5. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,225
    This is SO AWESOME!



    I would suggest to evidence that it also works at runtime in the description. Maybe it's only me, but I find it a super-fantastic feature that needs more attention :)
     
    Chman likes this.
  6. PygmyMonkey

    PygmyMonkey

    Joined:
    Jan 13, 2014
    Posts:
    277
    xD thanks for this gif on my post, awesome.
    This is really a fantastic feature, I just need to improve it a little bit!
    And damn, it's not in the description just the last screenshot! Thanks :)
     
  7. PygmyMonkey

    PygmyMonkey

    Joined:
    Jan 13, 2014
    Posts:
    277
    An update is available on the Asset Store.

    Version 1.1.1
    - NEW
    Added a header menu, allowing you to:
    -- Clear all the palettes,
    -- Restore the default palettes,
    -- Click the help button to open the Color Palette website,
    -- Update the color palette objects in current scene.
    - UPDATE Moved the “Update color palettes objects” button to the header menu (it’s now just “Update scene”).
    - UPDATE The current palette had a full green background, now just the header is green.
     
    Izitmee likes this.
  8. DerrickBarra

    DerrickBarra

    Joined:
    Nov 19, 2013
    Posts:
    75
    Is it possible to load a color scheme file from a www call within a script and have it change the colors in a live unity app? (I see that it's possible within the editor).

    Regardless this is a cool product, kudos to you.
     
  9. PygmyMonkey

    PygmyMonkey

    Joined:
    Jan 13, 2014
    Posts:
    277
    Hello!
    Thanks for the compliment ;)

    Well, it's possible to do that yes, but the scripts responsible for this are in an Editor folder, and thus not available at runtime. So I'll need to move them to another folder.
    You want to download the color scheme from a website already supported by Color Palette or another one?
    Also, tell me a little bit more about what you want to do and I'll make a code example to show you how you can do that :)
     
  10. DerrickBarra

    DerrickBarra

    Joined:
    Nov 19, 2013
    Posts:
    75
    Basically the GUI in the app I'm working on is loaded at runtime via www calls for each sprite. The user can "mod" the app by replacing the default url locations for each image.

    The idea is to also allow them to mod the color of GUI elements by passing me their chosen colors via a website URL. Which website they use is dependent on what your app supports, the more the merrier ( I don't think my users will have a preference, as long as the website is free and easy, which I believe the ones you support are ). Basically this way I don't need to provide the toolset for choosing the colors within my app, and I can instead refer the user to the websites your tool supports.
     
  11. PygmyMonkey

    PygmyMonkey

    Joined:
    Jan 13, 2014
    Posts:
    277
    Ok no problem, I'll try to make a demo script to show you how it's done. It should be ready by sunday or monday :)
    Have a nice week-end!
     
  12. PygmyMonkey

    PygmyMonkey

    Joined:
    Jan 13, 2014
    Posts:
    277
    Hey Gambit Games!

    Sorry it took a little bit more time...
    I've added a demo scene + demo script to show exactly how to do what you want.

    Can you send me your email in PM so I can send you the latest version via email if you don't want to wait for the update on the Asset Store?
     
  13. DerrickBarra

    DerrickBarra

    Joined:
    Nov 19, 2013
    Posts:
    75
    Hey Pygmy, I've got no problems with waiting for you to update the package on the asset store, thanks so much!
     
  14. PygmyMonkey

    PygmyMonkey

    Joined:
    Jan 13, 2014
    Posts:
    277
    An update is available on the Asset Store :)

    Version 1.1.2
    - NEW
    Added demo scene 2, that show how to retrieve a color palette from a website at runtime.
     
    Izitmee likes this.
  15. mimminito

    mimminito

    Joined:
    Feb 10, 2010
    Posts:
    776
    This looks fantastic! Just gone through all of the videos and the plugin is so well organised! Fantastic work!
     
  16. PygmyMonkey

    PygmyMonkey

    Joined:
    Jan 13, 2014
    Posts:
    277
    Thanks a lot! Really appreciate it :)
     
    mimminito likes this.
  17. gilley033

    gilley033

    Joined:
    Jul 10, 2012
    Posts:
    671
    Hi, this looks like a great product, but I have a few questions before purchasing.

    I know the palette's themselves have a name associated with them, but does each color also have a name, and is that name retrievable at run-time? For instance, perhaps I have a red palette that has Crimson, Bright Red, Indian Red, etc. Can I access these names at run-time? For that matter, how do you choose a specific color from a palette at run-time? By array index?

    Finally, if names are supported for each individual color, are names imported automatically from files that support them, such as .aco files?

    Thanks!
     
  18. PygmyMonkey

    PygmyMonkey

    Joined:
    Jan 13, 2014
    Posts:
    277
    Hey there!
    Thanks a lot ;)

    Right now, each color doesn't have a name. I know exactly what you mean though. I think I'll add support for that in a future release, it might be useful! And with that the ability to retrieve that at runtime. (Also to import from files if I succeed doing that :D).
    Currently, to chose a specific color at runtime, yes you have to use the index of the color list. But you can also attach a script to your gameObject and it will update the color based on the current selected color palette (that you can change at runtime). With this script, if you change the entire color palette at runtime, the gameObject will receive the event, and change its color.

    If you have any other question, feel free to ask ;)

    Have a nice day!
     
    hopeful likes this.
  19. gilley033

    gilley033

    Joined:
    Jul 10, 2012
    Posts:
    671
    Thanks for the answers!

    I decided to purchase, and I am very happy so far. I am thinking of just presenting palettes to the user rather than individual colors, so I shouldn't need the individual color names/accessing, but that would be a neat feature!

    As an aside, do you have any experience with trying to download palettes straight from a color.adobe.com link? I'm able to access the page via my credentials, but unfortunately they use Javascript to generate the palettes, so using the WebClient class isn't straight forward. I'm researching this and am hopeful I'll figure it out, but I have no experience with the WebClient class or any type of web access via programming, and since you seem to have some experience I thought maybe you'd have an idea. If not, no biggie! If I figure out the solution I'll be sure to post here, as I'm sure there are other users that use that website.
     
  20. PygmyMonkey

    PygmyMonkey

    Joined:
    Jan 13, 2014
    Posts:
    277
    Nice! Thank you :)

    Well, about downloading from color.adobe.com, as you say, it requires credentials + javascript etc... and I don't really know how to go around all that... :/
    Currently, the only thing you can do, is download the palette from the website, and import it in Color Palette. Sorry.
     
  21. gilley033

    gilley033

    Joined:
    Jul 10, 2012
    Posts:
    671
    Yeah, the credentials weren't hard to figure out but I'm not sure there is a way around the javascript. I gave up on it; definitely not worth the trouble.
     
  22. PygmyMonkey

    PygmyMonkey

    Joined:
    Jan 13, 2014
    Posts:
    277
    Too bad :(
    Sorry it didn't work out.
     
  23. gilley033

    gilley033

    Joined:
    Jul 10, 2012
    Posts:
    671
    Turns out I don't really need it anyways, so no biggie! I'm not really using the kit in the way it was intended, but it's serving as a nice base to build the functionality I do need, saving me a lot of time. The code is very easy to understand and thus modify/extend, so great work! Leaving a rating now . . .
     
  24. PygmyMonkey

    PygmyMonkey

    Joined:
    Jan 13, 2014
    Posts:
    277
    What can I see except thanks a ton? :)
    Thank you. A gazillion time!
     
  25. PygmyMonkey

    PygmyMonkey

    Joined:
    Jan 13, 2014
    Posts:
    277
    An update is available on the Asset Store:)

    Version 1.1.3
    - NEW
    New Inspector for ColorPaletteObject. You can now see all the colors from your color palette and clicking (or dragging) on the colors will update the color (no more changing the color percentage value blindly).

    - NEW
    Added setRandomPalette method (to use at runtime).
    - UPDATE The ColorPaletteObject script does not use color percentage anymore, but color index.
    - FIX Fixed issue when the ColorPaletteObject script did not find a renderer on the GameObject
    - FIX Fixed saving palettes modifications in the Editor
     
    Last edited: Jun 26, 2015
  26. mbalic

    mbalic

    Joined:
    Nov 10, 2014
    Posts:
    2
    Hi, great asset. Would it be possible to set text labels for colours? For instance, we have a colour for our UI text and a colour for our default UI images. Both happen to be white, and therefore identical. It's therefore not obvious which is for which when simply seeing the white square. A label field when editing would be great, as well as a rollover tooltip.

    Also Undo support for the editor would be great too!
     
  27. PygmyMonkey

    PygmyMonkey

    Joined:
    Jan 13, 2014
    Posts:
    277
    Hey :)
    Thanks a lot!

    And yes, I have planned to add support for labels on colours. And great idea for the tooltip!
    I'll also try to take a look at adding Undo support ;)
     
    hopeful likes this.
  28. tabor

    tabor

    Joined:
    Nov 29, 2011
    Posts:
    42
    Hi Pygmy,

    I am really loving the asset so far.
    Was wondering if you could help me with one thing.

    Right now I am using it to assign a random pallet to my scene.
    For now I am changing CURRENT_PALETTE with:
    Code (CSharp):
    1. void Start()
    2. {
    3. ColorPaletteData.Singleton.setCurrentPalette(Random.Range (1, 12);
    4. }
    What I would like to use 3 random pallets in my scene. Maybe the ideal solution would be to add to the react menu: RANDOM_PALETTE 1, RANDOM_PALETTE 2, RANDOM_PALETTE 3.
    And each could select a random palette from all the available palettes.

    Spent a few hours trying to hacking it together myself with no luck. Can you help?
    Thank you!
     
  29. PygmyMonkey

    PygmyMonkey

    Joined:
    Jan 13, 2014
    Posts:
    277
    Hey there,
    I'm really glad you like it! Thanks :)

    So if I understand correctly what you want, is to use 3 random palettes, but can you detail a little more?
    I mean, from what I understand, you have, say 12 color palettes already defined, and you want to pick randomly 3 out of those 12 right? But you always want to keep the same 3 during the lifetime of your application?

    If that's the case. Why don't you just pick 3 random numbers (index) at Start, save them somewhere in a script and use them whenever you want ?
    Something like:

    Code (CSharp):
    1. randomPaletteIndex1 = Random.Range(1, 12);
    2. randomPaletteIndex2 = Random.Range(1, 12);
    3. randomPaletteIndex3 = Random.Range(1, 12);
    And then in your game, you just need to do:
    Code (CSharp):
    1. ColorPaletteData.Singleton.setCurrentPalette(randomPaletteIndex1);
    or
    Code (CSharp):
    1. ColorPaletteData.Singleton.setCurrentPalette(randomPaletteIndex2);
    or
    Code (CSharp):
    1. ColorPaletteData.Singleton.setCurrentPalette(randomPaletteIndex3);
    Please give me more detail, so I can give you exactly what you want.
    Also tell me if you're not a developer, I'll write the script you want and post it here ;)
     
  30. tabor

    tabor

    Joined:
    Nov 29, 2011
    Posts:
    42
    Thanks for your reply.
    I want to use all 3 palettes at the same time. Each randomly selected at runtime.

    In a hypothetical scene:
    Lets say the grass and trees pull from RANDOM_PALETTE 1
    the sky and clouds from RANDOM_PALETTE 2
    and the player and enemies from RANDOM_PALETTE 3

    and 12 is my current number of palettes but it would make more sense to replace that with a var that represents the total number of palettes in the array, in case I add or remove some.

    I'm an artist not a developer, so thank you for your help!
     
  31. PygmyMonkey

    PygmyMonkey

    Joined:
    Jan 13, 2014
    Posts:
    277
    Oh! Well the issue with that, is that Color Palette is designed to have only one current palette selected. You can't have 3...

    But you can use the ColorPaletteObject that you put on all the gameObjects you want to control the color.
    See an example in the Demo1 scene.
    You just need to set the react to: CUSTOM_PALETTE and select a color index.

    Then you'll need a script that will set the custom palette to the random palette you want.
    I'll try to write you a small script and maybe a demo scene tomorrow to do exactly what you need :)
     
  32. tabor

    tabor

    Joined:
    Nov 29, 2011
    Posts:
    42
    That sounds great, thank you.
     
  33. PygmyMonkey

    PygmyMonkey

    Joined:
    Jan 13, 2014
    Posts:
    277
    Re!

    So I made a demo scene that looks like this:


    I hope this is what you wanted?
    If yes, please send me an email at tools@pygmymonkey.com so I can send you this demo scene, so you don't have to wait for the next release of color palette ;)
     
  34. tabor

    tabor

    Joined:
    Nov 29, 2011
    Posts:
    42
    Awesome! That looks like exactly what I am looking for. Emailing you now.
     
    PygmyMonkey likes this.
  35. jl008

    jl008

    Joined:
    Jan 31, 2013
    Posts:
    25
    hi,
    where are the colors/pallets saved? Somehow my recent pallets changes disappeared and I want to make sure this file(s) are under my repo.
     
  36. PygmyMonkey

    PygmyMonkey

    Joined:
    Jan 13, 2014
    Posts:
    277
    Hello :)

    Palettes are saved in a single file, called ColorPaletteData.asset, located in PygmyMonkey/ColorPalette/Resources/ColorPaletteData.asset

    Have a great day!
     
  37. sloopidoopi

    sloopidoopi

    Joined:
    Jan 2, 2010
    Posts:
    242
    Hi,
    there is a bug with storing the color values (You loose the color changes when you just use the color picker and close the Unity editor) . I realized that in the ColorPaletteDetailRenderer.cs the GUI.changed flag is set too late.
    I changed the code at line 32:
    Code (CSharp):
    1. m_colorPalette.colorList[i] = EditorGUILayout.ColorField(m_colorPalette.colorList[i]);
    2. GUI.changed = false;
    to
    Code (CSharp):
    1. GUI.changed = false;
    2. m_colorPalette.colorList[i] = EditorGUILayout.ColorField(m_colorPalette.colorList[i]);
    Now the color changes are stored the right way
    but then the Editor slows down when you change the color with the color picker as every frame the AssetDatabase is updated. So i looked at the PaletteUtils.cs SavePalettes() method:
    I don't know exactly why these calls needed:
    Code (CSharp):
    1. UnityEditor.AssetDatabase.SaveAssets();
    2. UnityEditor.AssetDatabase.Refresh();
    As the ColorPaletteData isSetDirty flag is set the SerializedObject is automatically stored to disc. (I removed both calls and it works and the color picking doesn't slow down the editor ;))
     
  38. PygmyMonkey

    PygmyMonkey

    Joined:
    Jan 13, 2014
    Posts:
    277
    Hi,
    Thanks for the feedback!

    Well, as you said, if we save the palettes every time a color is changed, it will call SaveAssets and Refresh on the AssetDatabase and will be really slow if done every frame.
    That's the reason why I chose not to save things to disk when you modified a color...

    I can't remove the SaveAssets code, because it's what telling Unity that we want to save the palettes on disk :/

    What you can do though, and it's what will be in the next version, is call
    Code (CSharp):
    1. PaletteUtils.SavePalettes(m_paletteData);
    in ColorPaletteDataRenderer.cs line 88 when the user press the "Hide details / Show details" button.

    It still won't save palettes when you only change color, but usually when you're done modifying a palette, you click 'hide details'.

    Something else I can do, is trigger a save every x seconds if a color has been modified... do you think it's really that useful?
     
  39. jl008

    jl008

    Joined:
    Jan 31, 2013
    Posts:
    25
    save on "Hide details" would be nice. thanks
     
    PygmyMonkey likes this.
  40. PygmyMonkey

    PygmyMonkey

    Joined:
    Jan 13, 2014
    Posts:
    277
    Will be in the future version ;)
     
  41. PygmyMonkey

    PygmyMonkey

    Joined:
    Jan 13, 2014
    Posts:
    277
    A new update is available now :)

    Version 1.1.4
    - NEW:
    You now open Color Palette via the menu "Window/PygmyMonkey/Color Palette", it was
    previously in "Tools/PygmyMonkey/Color Palette".
    - NEW: Added example scene #3 (showing how to use random palettes)
    - FIX: Save color palettes when clicking on 'Hide details'
    - FIX: Importing the name of the palette from colorCombos.com
    - FIX: Importing palettes from dribbble.com
     
    Izitmee likes this.
  42. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,225
    Whooooo!!!! :)
     
    PygmyMonkey likes this.
  43. KWaldt

    KWaldt

    Joined:
    Nov 1, 2013
    Posts:
    121
    Hello there!

    Just bought this and I'm loving this so far--this is exactly what I needed!
    Really, thank you for creating this--it suddenly makes Unity more comfortable for mockups than Photoshop.

    Now, I have a question/request--is it somehow possible to connect the gameobjects colour with the palette, BUT keeping the alpha intact?
    I'm currently working on a UI-heavy project, and there are some panels that I'd like to have the same colour as other elements, but to vary their opacity. At the moment, I'd either have to create a new swatch for every opacity value I need (which would kinda destroy the flexibility of the palettes and make changing a colour annoying again), or I'd have to write a script which restores the opacity manually.
    It would be nice to have an extra attribute in the "Color Palette Object", something like an opacity float.
    Maybe the feature already exists? I'm a bit new to this extension.

    Best Regards,
    Kristina Waldt
     
  44. PygmyMonkey

    PygmyMonkey

    Joined:
    Jan 13, 2014
    Posts:
    277
    Hey there!

    I'm more than glad you like it! Awesome :)
    About your feature request, that's funny, because that's something I did a few days ago (but still have not send it to the Asset Store), so yes, it will be available ^^

    If you want it before everyone, just drop me an email (tools@pygmymonkey.com and I'll send it to you).

    Have a great day!
     
    KWaldt likes this.
  45. KWaldt

    KWaldt

    Joined:
    Nov 1, 2013
    Posts:
    121
    Oh, wow, that's some timing, I guess!

    To the others interested--I just got the update and it works beautifully!
    Your support is really great, I'll leave a review on the asset store as soon as possible.

    Best Regards,
    Kristina
     
    PygmyMonkey likes this.
  46. PygmyMonkey

    PygmyMonkey

    Joined:
    Jan 13, 2014
    Posts:
    277
    Thanks a lot!
     
  47. Comatose Turtle

    Comatose Turtle

    Joined:
    Mar 9, 2013
    Posts:
    2
    Hi! I recently bought this as a way to try out different UI color schemes more easily, but it doesn't seem to mesh with the new UI's default button animations. Do I have to create custom animations that alter the color palette component properties, or do you see another way of doing this?

    Thanks!
     
  48. PygmyMonkey

    PygmyMonkey

    Joined:
    Jan 13, 2014
    Posts:
    277
    Hey!

    In order to do that, you have to use the ColorPaletteObject attached to your button. But it's not yet compatible with Unity UI... it's only working on an Image or Graphic component, so you could attach it to the button sprite, but it won't handle all the button color animations.
    I'm planning on adding support for Unity UI in a future release though!

    Sorry, you'll have to wait a little bit :)
     
  49. PygmyMonkey

    PygmyMonkey

    Joined:
    Jan 13, 2014
    Posts:
    277
    A new update is available now :)

    Version 1.1.5
    - NEW:
    ColorPaletteObject now has an ‘override alpha’ field, so you can assign a custom alpha to an object when applying a color from a palette
    - NEW: Each color from a palette can now have a name that you can set, modify, retrieve at runtime and will be automatically retrieved when importing palettes or getting palettes from the web
    - NEW: Added the HEX value next to each color in the ‘Show details’ of Color Palette Window
    - NEW: You can now mouse over each color to have info on it (name, hex value and RGB values)
    - NEW: Can now import .aco files version 2 (prior was only version 1)
    - NEW: Added method to get a color from its name inside a palette (at runtime, via code)
    - UPDATE: Demo scene 3 show an example on how to retrieve info on a palette and color from its name
     
    KWaldt likes this.
  50. PygmyMonkey

    PygmyMonkey

    Joined:
    Jan 13, 2014
    Posts:
    277
    An update is available on the Asset Store :)

    Version 1.1.6
    - FIX
    Duplicated palettes are now no longer “linked” to the original palette
    - FIX Duplicated colors are now no longer “linked” to the original color
    - NEW Added getRandomPalette method
    - NEW Added getRandomColor (from a palette) method
    - UPDATE Renamed setRandomPalette to setRandomCurrentPalette
    - NEW Added a color offset you can tweak when creating a palette from a color reference (in the Create palette section)
    - NEW You can now import palettes from the website colrd.com!