Jump to content

Effect UI issue with disabled ColorWheels


NSD

Recommended Posts

Spoiler

// Name:
// Submenu:
// Author:
// Title:
// Version:
// Desc:
// Keywords:
// URL:
// Help:
#region UICode
CheckboxControl custom = false; // Custom color
ColorWheelControl color = ColorBgra.FromBgr(0, 0, 0); // [PrimaryColor] {custom} Color
#endregion

// This single-threaded function is called after the UI changes and before the Render function is called
// The purpose is to prepare anything you'll need in the Render function
void PreRender(Surface dst, Surface src)
{
}

// Here is the main multi-threaded render function
// The dst canvas is broken up into rectangles and
// your job is to write to each pixel of that rectangle
void Render(Surface dst, Surface src, Rectangle rect)
{
  // Delete these lines if you don't need the primary or secondary color
  ColorBgra PrimaryColor = EnvironmentParameters.PrimaryColor;
  ColorBgra SecondaryColor = EnvironmentParameters.SecondaryColor;


  // Step through each row of the current rectangle
  for (int y = rect.Top; y < rect.Bottom; y++)
  {
    if (IsCancelRequested) return;
    // Step through each pixel on the current row of the rectangle
    for (int x = rect.Left; x < rect.Right; x++)
    {
      ColorBgra SrcPixel = src[x,y];
      ColorBgra DstPixel = dst[x,y];

      ColorBgra CurrentPixel = SrcPixel;

      // TODO: Add additional pixel processing code here


      dst[x,y] = CurrentPixel;
    }
  }
}

 

 

Am I wrong or is something wrong with the color control in CodeLab?
Check by checking / unchecking the Custom color checkbox.

 

Link to comment
Share on other sites

1 hour ago, NSD said:

Am I wrong or is something wrong with the color control in CodeLab?

 

This happens with other plugins too, so it's a bug in Paint.NET v4.2.15.

  • Like 1

(September 25th, 2023)  Sorry about any broken images in my posts. I am aware of the issue.

bp-sig.png
My Gallery  |  My Plugin Pack

Layman's Guide to CodeLab

Link to comment
Share on other sites

I've split these posts into a separate forum topic.

 

 

The Radius Corners plugin is a good example to demonstrate this issue.

 

I'm guessing a boolean just got inverted somewhere.

 

 

ColorWheel when disabled:

 

ColorWheel-d.png

ColorWheel when enabled:

 

ColorWheel-e.png

(September 25th, 2023)  Sorry about any broken images in my posts. I am aware of the issue.

bp-sig.png
My Gallery  |  My Plugin Pack

Layman's Guide to CodeLab

Link to comment
Share on other sites

  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...