Ejemplo n.º 1
0
    /// <summary>
    /// Draws the color bitmap.
    /// </summary>
    /// <returns></returns>
    private Bitmap drawColorBitmap()
    {
      const int width = 5;
      const int height = 100;

      double h = _h;
      double s = _s;

      var bmp = new Bitmap( width, height );

      for ( int y = 0; y < height; ++y )
      {
        double l = height - y;

        Color color = new HslColor( h, s, l ).ToColor();

        for ( int x = 0; x < width; ++x )
        {
          bmp.SetPixel( x, y, color );
        }
      }

      return bmp;
    }
 private void setColor(HslColor color)
 {
   setColor(color.ToRgbColor());
 }
		/// <summary>
		/// Draws the color bitmap.
		/// </summary>
		/// <returns></returns>
		private static Bitmap drawColorBitmap()
		{
			const int width = 360 + 1;
			const int height = 100 + 1;

			var bmp = new Bitmap( width, height );

			for ( int y = 0; y < height; ++y )
			{
				for ( int x = 0; x < width; ++x )
				{
					double h = x;
					double s = 100 - y;
					double l = 100 - y;

					Color color = new HslColor( h, s, l ).ToColor();

					bmp.SetPixel( x, y, color );
				}
			}

			return bmp;
		}