MidV = (FirstV + (VAdjustmentDirection * (MaxV / 2))) Ĭeiling = selection.Bottom - selection.Top MidS = (FirstS + (SAdjustmentDirection * (MaxS / 2))) MidH = AngleConstrain(FirstH + (HAdjustmentDirection * (MaxH / 2))) MidAlpha = (FirstAlpha + (AlphaAdjustmentDirection * (MaxAlpha / 2))) MidB = (FirstB + (BAdjustmentDirection * (MaxB / 2))) MidG = (FirstG + (GAdjustmentDirection * (MaxG / 2))) MidR = (FirstR + (RAdjustmentDirection * (MaxR / 2))) If (FirstV > LastV) VAdjustmentDirection = -1 If (FirstS > LastS) SAdjustmentDirection = -1 Ĭase 1: // Calculate MaxH and adjustment direction for short HSV fadesĬase 2: // Calculate MaxH and adjustment direction for long HSV fades MaxB = Math.Abs(Secondar圜olor.B - Primar圜olor. MaxG = Math.Abs(Secondar圜olor.G - Primar圜olor.G) MaxR = Math.Abs(Secondar圜olor.R - Primar圜olor.R) ((Secondar圜olor.R = Secondar圜olor.G) & (Secondar圜olor.R = Secondar圜olor.))ĮvanRGBtoHSV(Primar圜olor.R, Primar圜olor.G, Primar圜olor.B, ref FirstH, ref FirstS, ref FirstV) ĮvanRGBtoHSV(Secondar圜olor.R, Secondar圜olor.G, Secondar圜olor.B, ref LastH, ref LastS, ref LastV) If (((Primar圜olor.R = Primar圜olor.G) & (Primar圜olor.R = Primar圜olor.) || MaxAlpha = Math.Abs(Secondar圜olor.A - Primar圜olor.A) Rectangle selection = EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt() Int HAdjustmentDirection = 1, SAdjustmentDirection = 1, VAdjustmentDirection = 1 Int RAdjustmentDirection = 1, GAdjustmentDirection = 1, BAdjustmentDirection = 1, AlphaAdjustmentDirection = 1 ĭouble MaxDistance = 0, CurrDistance = 0 ĭouble angle = 0, XPercent = 0, YPercent = 0 ĭouble FirstH = 0, FirstS = 0, FirstV = 0 Int Direction = Amount6 // 0=vertical, 1=horizontal, 2-3=diagonal, 4=Radial Corner, 5=Radial Side, 6=square, 7=conicalīool SwapColors = false // 0=normal, 1=swappedĬolorBgra Primar圜olor, Secondar圜olor, currpixel Void Render(Surface dst, Surface src, Rectangle rect)īool AlphaOnly = Amount5 // false=full color, true=alpha channel only Desc: Render various colorful gradientsĬolorBgra Amount1 = ColorBgra.FromBgr(0,0,0) // From ColorĬolorBgra Amount3 = ColorBgra.FromBgr(255,255,255) // To Colorīool Amount5 = false // Alpha Onlyīyte Amount6 = 0 // Style|Vertical|Horizontal|Diagonal|Diagnal (other)|Radial Corner|Radial Side|Square|Conicalīyte Amount7 = 0 // Type|RGB|HSV (short)|HSV (long) Title: BoltBait's Gradient Effect v3.0 Here is the CodeLab source for the 4.0 version (avert your eyes!): In addition, gratitude should be served to pleska for providing the first Gradient function, and Crazy Man Dan for the first Gradient Tutorial. They were needed (rather than using the Paint.NET functions these broke it down better). Thanks to EvanOlds for letting us use his HSVtoRGB, RGBtoHSV, and AngleConstrain functions. The User Interface and Effects implementation was coded by Illnab1024 The Main Render function was coded by BoltBait These create beautiful rainbow gradients that are based on a color's hue, saturation, and value. Version 2.0 brought in Hue-based gradients. This Plugin (From Scratch), works out a few kinks in Pleska's plugin, and includes a few more gradient types. There is already Pleska's plugin, but that one is slightly buggy. Download (v2.0) DLL here: Gradient.dll MODERATORS NOTE: This effect is incompatible with Paint.NET 4.0xĭownload (v1.1) Source here: GradientSource.zipĭownload (v2.0) Source here: GradientSource_2_0.zip
0 Comments
Leave a Reply. |