Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8725191
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:59:09+00:00 2026-06-13T07:59:09+00:00

I’m builing a fractal application and need to generate a smooth color scheme, and

  • 0

I’m builing a fractal application and need to generate a smooth color scheme, and I found a nice algorithm at Smooth spectrum for Mandelbrot Set rendering.

But that required me to call Color.HSBtoRGB and that method is not available in WinRT / Windows Store apps.

Is there some other built-in method to do this conversion?
Other tips on how to convert HSB to RGB?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T07:59:10+00:00Added an answer on June 13, 2026 at 7:59 am

    I ended up using the HSB to RGB conversion algorithm found at http://www.adafruit.com/blog/2012/03/14/constant-brightness-hsb-to-rgb-algorithm/, I adopted the inital (long) version. Perhaps this can be further optimized but for my purpose this was perfect!

    As the hsb2rgb method is in C and I needed C#, I’m sharing my version here:

        private byte[] hsb2rgb(int index, byte sat, byte bright)
        {
            int r_temp, g_temp, b_temp;
            byte index_mod;
            byte inverse_sat = (byte)(sat ^ 255);
    
            index = index % 768;
            index_mod = (byte)(index % 256);
    
            if (index < 256)
            {
                r_temp = index_mod ^ 255;
                g_temp = index_mod;
                b_temp = 0;
            }
            else if (index < 512)
            {
                r_temp = 0;
                g_temp = index_mod ^ 255;
                b_temp = index_mod;
            }
    
            else if ( index < 768)
            {
                r_temp = index_mod;
                g_temp = 0;
                b_temp = index_mod ^ 255;
            }
    
            else
            {
                r_temp = 0;
                g_temp = 0;
                b_temp = 0;
            }
    
            r_temp = ((r_temp * sat) / 255) + inverse_sat;
            g_temp = ((g_temp * sat) / 255) + inverse_sat;
            b_temp = ((b_temp * sat) / 255) + inverse_sat;
    
            r_temp = (r_temp * bright) / 255;
            g_temp = (g_temp * bright) / 255;
            b_temp = (b_temp * bright) / 255;
    
            byte[] color = new byte[3];
            color[0]    = (byte)r_temp;
            color[1]    = (byte)g_temp;
            color[2]    = (byte)b_temp;
    
            return color;
        }
    

    To call it based on the code linked in the original post I needed to make some minor modifications:

        private byte[] SmoothColors1(int maxIterationCount, ref Complex z, int iteration)
        {
            double smoothcolor = iteration + 1 - Math.Log(Math.Log(z.Magnitude)) / Math.Log(2);
            byte[] color = hsb2rgb((int)(10 * smoothcolor), (byte)(255 * 0.6f), (byte)(255 * 1.0f));
    
            if (iteration >= maxIterationCount)
            {
                // Make sure the core is black
                color[0] = 0;
                color[1] = 0;
                color[2] = 0;
            }
            return color;
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
In my XML file chapters tag has more chapter tag.i need to display chapters
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I need a function that will clean a strings' special characters. I do NOT
I have thousands of HTML files to process using Groovy/Java and I need to
I need to clean up various Word 'smart' characters in user input, including but
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
Let's say I'm outputting a post title and in our database, it's Hello Y&#8217;all
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.