CurrentColorText for KnownColor(s)

4 posts, 0 answers
  1. Terry
    Terry avatar
    1 posts
    Member since:
    Dec 2006

    Posted 23 Jul 2008 Link to this post


    How can I get the CurrentColorText (defaults to '(Current Color is {0})', to display the colour name rather than the hex value  in {0} ???

    Shame question for preview too so I would like to see...

    'Your team colour is Yellow' not 'Your team colour is FF66C3' etc.

  2. Georgi Tunev
    Georgi Tunev avatar
    7207 posts

    Posted 23 Jul 2008 Link to this post

    Hi Terry,

    I am afraid this is not possible. RadColorPicker is designed to use HTML colors and it outputs the color names in hex format. If it used real names, the number of colors would have been very limited.

    Kind regards,
    Georgi Tunev
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. DevCraft R3 2016 release webinar banner
  4. Bryan
    Bryan avatar
    1 posts
    Member since:
    Nov 2009

    Posted 10 Sep 2010 Link to this post

    Sorry to dredge up an old post, but has this been changed? The documentation for the RadColorPicker clearly says, "The color may display as a color name or a hexadecimal string." and yet I can find no way of setting this.
  5. Rumen
    Rumen avatar
    12788 posts

    Posted 15 Sep 2010 Link to this post

    Hi Bryan,

    You can display the selected color's title using the get_selectedColorTitle() method, but you cannot convert the hexadecimal strings to color names, because as Georgi already mentioned the HTML color names are limited.

    You can define your own set of colors which offer HTML color names and get their names using the get_selectedColorTitle method:

    <script type="text/javascript">
        function colorChange(sender, eventArgs) {
            var myDiv = document.getElementById("myDiv");
            myDiv.innerHTML = 'Color name is ' + sender.get_selectedColorTitle();
    <Telerik:RadColorPicker ID="RadColorPicker1" runat="server" Preset="None" OnClientColorChange="colorChange">
        <Telerik:ColorPickerItem Title="Red" Value="#FF0000" />
        <Telerik:ColorPickerItem Title="Green" Value="#00FF00" />
        <Telerik:ColorPickerItem Title="Blue" Value="#0000FF" />
    <div id="myDiv"></div>

    Sincerely yours,
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top