Dismiss Notice
Some Razer services have been impacted due to the unique circumstances COVID-19 has created. We apologize for any inconvenience and appreciate your understanding during this critical time.

Colore - C# Library for Chroma

Discussion in 'Razer Chroma' started by BrandonJCScott, Mar 8, 2015.

Thread Status:
Not open for further replies.
  1. BrandonJCScott

    BrandonJCScott Active Member

    Colore - C# Library for Chroma - Release 1.0.48

    Colore is a powerful, elegant library for developing Razer Chroma applications in C# with all the .NET goodness you would expect.

    In the coming week, we will be adding helper methods for simplistic Chroma use, plus building a site along with our CI Server where we will host static binaries. We will also look into adding the project to NuGet.

    You can contribute to Colore right now at: https://github.com/CoraleStudios/Colore
    Most of our current work can be found on the develop branch, where we will move milestone releases to master after code reviews.

    Please, feel free to fork, and create a Pull Request for Adam or me to review. Instructions can be found in the Contributing section.

    Nuget: https://www.nuget.org/packages/Colore/
    Release 2.1.0: https://github.com/CoraleStudios/Colore/releases/tag/v2.1.0

    An example Colore WPF implementation can be found here: https://github.com/CoraleStudios/ColoreExample-WPF. It will be updated as the library develops.

    Colore is brought to you by Corale Studios, the team (Adam Hellberg @Sharparam and Brandon Scott @BrandonJCScott) who created SharpBlade for SBUI.
     
    Last edited: Sep 19, 2015
  2. njbmartin

    njbmartin Developer of Awesome

    Great work @BrandonJCScott. I'll definitely be using this in a number of projects!
     
  3. kushal

    kushal Member Staff Member

    Awesome!
     
  4. njbmartin

    njbmartin Developer of Awesome

    As soon as I start work on my Visual Studio plugin, I'll be sure to give you my feedback.
     
  5. Where is a documentation on how to use this library?
     
  6. BrandonJCScott

    BrandonJCScott Active Member

    Hey there. We've just got going with Colore, and we're setting up our CI server as we speak! All the code is documented so you can use that. We'll be added more functionality as time goes on. We'll post any major changes here.
     
  7. njbmartin

    njbmartin Developer of Awesome

    This deserves being pinned.
     
    BrandonJCScott and Sharparam like this.
  8. Sharparam

    Sharparam Member

    The first public version of Colore has just been released!

    We are super excited to finally make a release of Colore after spending our time making sure everything is working and has intuitive interfaces!

    Version 1.0.48 is released and can be downloaded from the GitHub release page, or by getting the NuGet package.

    Documentation exists as XML docs only for now, so you'll be able to see it through IntelliSense in Visual Studio or equivalent tools in your IDE of choice. We are planning to get web-based documentation up and running (similar to that of SharpBlade).

    To start using Colore, explore the methods exposed via Corale.Colore.Core.Chroma.Instance, Corale.Colore.Core.Keyboard.Instance, and Corale.Colore.Core.Mouse.Instance.

    Brandon has tested the current version of the library, and it should work as advertised, but there may be bugs that have escaped us. If you find anything, create an issue on the GitHub project and let us know as soon as possible!

    Happy coding :)
     
    Last edited: Mar 27, 2015
    fbl07 likes this.
  9. Ergonyx

    Ergonyx Member

    So what's the Grid.Key equivalent in this? Because I thought the obnoxiously long Corale.Colore.Razer.Keyboard.Effects.CustomGrid was it, but it doesn't work as I expected.

    PS. I don't know dick about C# and I'm only starting to learn so I can use this to do things I wasn't able to do with the Configurator.

    Nevermind. I'll just wait till you guys have some better documentation that actually says what things are and how to use them because I'm just getting annoyed at how god damn hard it is to change the color of a single key -_-
     
    Austin Clark likes this.
  10. njbmartin

    njbmartin Developer of Awesome

    I've found that "CreateKeyboardCustomEffects" is much simpler to use for changing a single key's colour.
     
  11. Ergonyx

    Ergonyx Member

    I don't even know what that is because I've never seen it. That doesn't pop up when I type so I don't know where you found it.

    I'm using the Object Browser to try and get an idea as to what things do but really, I'm just shoving stuff into the code and hoping for the best as I get increasingly frustrated because I can't find a damn starting point that makes any sense to me.

    Like this here:
    I don't see that stuff either.
     
    Austin Clark likes this.
  12. Sharparam

    Sharparam Member

    Made a typo in my post, the classes for interfacing with Chroma are in Corale.Colore.Core, so an example:

    Code:
    namespace ChromaApp
    {
      using Corale.Colore.Core;
    
      class Program
      {
        static void Main()
        {
          Keyboard.Instance.Set(Color.Red); // Sets the color of all keys to red
        }
      }
    }
    
    Edit: More explicitly, to set the color of a certain key:

    Code:
    namespace ChromaApp
    {
      using Corale.Colore.Core;
      using Corale.Colore.Razer.Keyboard;
    
      class Program
      {
        static void Main()
        {
          // Sets the color of the W key to red.
          Keyboard.Instance.Set(Key.W, Color.Red);
        }
      }
    }
    
     
    Last edited: Mar 27, 2015
    njbmartin likes this.
  13. I attempted to use your code above but I got nothing to show. Here is the code that I have:
    Code:
    class Program
        {
            static void Main(string[] args)
            {
                Console.WriteLine("Clearing the keyboard.");
                Keyboard.Instance.Clear();
    
                Console.WriteLine("Setting the keyboard effect to red.");
                Keyboard.Instance.Set(Color.Red);
    
                Console.ReadKey();
            }
        }
    
    Is there something I need to do with the project or my keyboard?
    Would having two keyboards (BlackWidow Chroma and my laptop) affect this?

    Thanks in advanced :)
     
  14. Sharparam

    Sharparam Member

    Not sure what happens with two keyboards, as there doesn't seem to be anything in the SDK about using more than one device. Did you exit Synapse before running the code? I don't think it works with it running.
     
  15. Thanks :) now it is working perfectly after I turned off Synapse.
     
  16. njbmartin

    njbmartin Developer of Awesome

    This changes everything... Fantastic work guys!
     
  17. Ergonyx

    Ergonyx Member

    I get a NativeCallException error when I try to run the single key code. I'll just wait till you guys have your documentation done. Too damn frustrating trying to guess what everything does.
     
    Austin Clark likes this.
  18. Sharparam

    Sharparam Member

    Details? Exception message? Call stack? Don't hesitate to create an issue and describe the problem.
     
  19. Ergonyx

    Ergonyx Member

    I don't know anything about github and I'm having a ton of issues just trying to guess what all this stuff is for. This feels so much more convoluted than the C++ examples I messed with.

    But here's an image of the error I'm getting.

    [​IMG]
     
    Austin Clark likes this.
  20. I got the same error message when trying to set a specific key using the IKeyboard.Set(Key, Color) method.
     
Thread Status:
Not open for further replies.
Sign In with Razer ID >


Don't have a Razer ID yet?
Get Razer ID >