Storing Color Info

2 posts, 1 answers
  1. Voss Grose
    Voss Grose avatar
    81 posts
    Member since:
    Sep 2012

    Posted 29 Jul 2009 Link to this post

    Do you have a recommendation on how best save color information to a Database if I'm using the ColorPicker?

    When I retrieve the information back and want to use it I'm having a difficult time figuring out how to convert a string to a SolidColorBrush object.


  2. Answer
    Bobi
    Admin
    Bobi avatar
    513 posts

    Posted 30 Jul 2009 Link to this post

    Hello Voss Grose,

    Please take a look at the following online example that demonstrates how to use different color format :
    http://demos.telerik.com/silverlight/#ColorPicker/ColorPaletteView

    The easiest way is to use  the build in:

        ColorPaletteBase.HexStringToColor("#FF475A1D");


    So you can store in the database strings like "#FF475A1D" and after that transform then in to color objects in this way:
                             Color color = ColorPaletteBase.HexStringToColor("#FF475A1D");

    I hope that this answers your question.

    Regards,
    Boryana
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. DevCraft banner
Back to Top