DotNetBrowser 1.14 or later supports HTML Input element with type=color.

Both WinFormsBrowserView and WPFBrowserView display the default color chooser dialog where user can select the required color. 


You can override this default behavior by registering your own DialogHandler implementation with overridden OnColorChooser() method where you can set the required color programmatically without displaying any UI dialogs. The following code demonstrates how to do this:

C#

using System;
using System.Drawing;
using System.Windows.Forms;
using DotNetBrowser;
using DotNetBrowser.WinForms;

namespace ColorChooserSample
{
    class Program
    {
        public class WindowMain : Form
        {
            private WinFormsBrowserView browserView;

            public WindowMain()
            {
                Browser browser = BrowserFactory.Create();
                browserView = new WinFormsBrowserView(browser);

                browser.DialogHandler = new DefaultDialogHandler(browserView);

                this.Controls.Add(browserView);

                Width = 1024;
                Height = 768;
                this.Load += WindowMain_Loaded;
            }

            internal class DefaultDialogHandler : WinFormsDefaultDialogHandler
            {
                public DefaultDialogHandler(Control view) : base(view)
                {
                }

                public override CloseStatus OnColorChooser(ColorChooserParams parameters)
                {
                    parameters.Color = Color.Blue;
                    return CloseStatus.OK;
                }
            }

            void WindowMain_Loaded(object sender, EventArgs e)
            {
                browserView.Browser.LoadHTML("<html><body><input type='color' value='#ff0000'></body></html>");
            }

            [STAThread]
            public static void Main()
            {
                WindowMain wnd = new WindowMain();
                Application.Run(wnd);

                var browser = wnd.browserView.Browser;
                wnd.browserView.Dispose();
                browser.Dispose();
            }
        }
    }
}

VB.NET

Imports System.Drawing
Imports System.Windows.Forms
Imports DotNetBrowser
Imports DotNetBrowser.WinForms

Module Module1
    Public Class WindowMain
        Inherits Form

        Public Dim browserView As WinFormsBrowserView

        Public Sub New()

            Dim browser As Browser = BrowserFactory.Create()
            browserView = New WinFormsBrowserView(browser)
            browserView.Dock = DockStyle.Fill

            browser.DialogHandler = New DefaultDialogHandler(browserView)

            Me.Controls.Add(browserView)

            Width = 1024
            Height = 768
            AddHandler Me.Load, AddressOf WindowMain_Loaded
        End Sub

        Private Sub WindowMain_Loaded(sender As Object, e As EventArgs)
            browserView.Browser.LoadHTML("<html><body><input type='color' value='#ff0000'></body></html>")
        End Sub

        Friend Class DefaultDialogHandler
            Inherits WinFormsDefaultDialogHandler

            Public Sub New(view As Control)
                MyBase.New(view)
            End Sub

            Public Overrides Function OnColorChooser(ByVal parameters As ColorChooserParams) As CloseStatus
                parameters.Color = Color.Blue
                Return CloseStatus.OK
            End Function
        End Class
    End Class

    <STAThread>
    Sub Main()
        Dim wnd As WindowMain = New WindowMain()
        Application.Run(wnd)

        Dim browser = wnd.browserView.Browser
        wnd.browserView.Dispose()
        browser.Dispose()
    End Sub
End Module