Miranor Widget Store


You have to be logged in to use this function.


   Create New Account ˖ Forgot password?
COLOR WHEEL GENERATOR (Design App)Buy this Widget!
1 Credits

Function 'makeColorWheel' returns an image of a color wheel (as an Elgrint::MImage object) of given radius (in pixels) and lightness (0-black to 255-white). The color wheel presents the HSL colors of every Hue (0 to 360) and Saturation (0-center to 255-rim) for the given Lightness. Useful for implementing a color picker widget.

Author: Dimitry Rotstein

Tags: color, wheel, HSL, hue, saturation, lightness

Code preview:

MImage makeColorWheel(int radius, float lightness) { const int r = radius; // For convenience const float l = lightness; MImage res(MSize(r,r)*2,ZeroColor); // Make empty image canvas for (MImage::Iter it(res); it(); ++it) // Fill each pixel { const int i = it.getX(), j = it.getY(); double d = sqrt(double(i-r)*(i-r) + (j-r)*(j-r));

***************Buy the widget to get the rest of the code***************

Miranor Home | About Miranor | About Elgrint | Create account | Login | Account settings | Contact Us | Privacy Policy | Site map

© Copyright 2014 by Miranor. All rights reserved. By using this site you agree to the Terms of Use.

Page last updated on August 10th, 2014.

Real Time Web Analytics