BlazorColorPicker 4.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package BlazorColorPicker --version 4.0.0
                    
NuGet\Install-Package BlazorColorPicker -Version 4.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="BlazorColorPicker" Version="4.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="BlazorColorPicker" Version="4.0.0" />
                    
Directory.Packages.props
<PackageReference Include="BlazorColorPicker" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add BlazorColorPicker --version 4.0.0
                    
#r "nuget: BlazorColorPicker, 4.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=BlazorColorPicker&version=4.0.0
                    
Install BlazorColorPicker as a Cake Addin
#tool nuget:?package=BlazorColorPicker&version=4.0.0
                    
Install BlazorColorPicker as a Cake Tool

Blazor-Color-Picker

NuGet BlazorColorPicker Nuget Package

Sometimes HTML5 colorpicker doesn't suit me for an application. I prefer to offer the user a predefined color palette

DEMO : https://tossnet.github.io/Blazor-Color-Picker/

Opens a palette with the Material colors

Blazor Color Picker

Installation

[!WARNING] The implementation has been improved: version 4.0 uses a service declared via dependency injection

Latest version in here: NuGet

To Install

Install-Package BlazorColorPicker

or

dotnet add package BlazorColorPicker

For client-side and server-side Blazor - add script section to index.html or _Host.cshtml (head section)

<link href="_content/BlazorColorPicker/colorpicker.css" rel="stylesheet" />

In program.cs, declare

builder.Services.AddScoped<IColorPickerService, ColorPickerService>();

ColorPicker are rendered by the <BlazorColorPicker.ColorPicker />. This component needs to be added to the main layout of your application/site. You typically do this in the MainLayout.razor file at the end of the <main> section.

Usage

@page "/"
@using BlazorColorPicker

@inject IColorPickerService ColorPickerService

<h1>Hello, world!</h1>

<button class="btn btn-primary" @onclick="OpenModal">
    <div style="background-color:@color" class="buttonColor"></div> Select a Color
</button>

@code {
    private string color = "#F1F7E9";

    private async Task OpenModal()
    {
        var parameters = new ColorPickerParameters
        {
        	ColorSelected = color,
        };
        color = await ColorPickerService.ShowColorPicker(parameters);
    }
}

<a name="ReleaseNotes"></a>Release Notes

<details open="open"><summary>Version 4.0.0</summary>

  • the implementation has been improved: version 4.0 uses a service declared via dependency injection </details>

⚠️ Breaking changes ⚠️

<details><summary>Version 3.1.0</summary>

  • you can customise the size of the palette using your CSS styles
  • A red colour of the first column was not correct
  • Re-addition of .NET7 compatibility </details>

<details><summary>Version 2.2.0</summary>

  • Remove the internal use of IJSRuntime </details>

<details><summary>Version 2.1.0</summary>

  • no need to declare the _content/BlazorColorPicker/colorpicker.js file </details>
Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on BlazorColorPicker:

Package Downloads
PrototyperThemeRCL

Do not use yet. A Razor Class Library that provides user built themes to attach to pages and components. Themes are divided into 'Sets' and a set is applied to a page or component. No knowledge of CSS is required to set up a Theme.

PrototyperMenuRCL

Do not try to use this yet. A Razor Class Library that provides data driven menus. The current version only allows very graphical menu buttons. Menu 'Sets' contain menu 'Rows' which in turn contain 'buttons'. Clicking on a button can (1) go to another menu set (2) go to a page in the host app (3) load a component from the host or the RCL. Provides easy maintence of the data and easy to implement.

KristofferStrube.Blazor.SVGEditor

A SVG Editor that is implemented in and for Blazor.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on BlazorColorPicker:

Repository Stars
KristofferStrube/Blazor.SVGEditor
A basic SVG editor written in Blazor.
Version Downloads Last updated
4.0.2 388 a month ago
4.0.1 89 a month ago
4.0.0 87 a month ago
3.1.2 2,622 5 months ago
3.1.1 9,267 3/31/2024
3.1.0 357 3/30/2024
3.0.0 1,680 1/26/2024
2.3.1 3,988 11/15/2023
2.3.0 13,965 12/2/2022
2.2.0 4,889 10/22/2022
2.1.0 27,802 4/4/2022
2.0.1 1,476 2/16/2022
2.0.0 4,298 12/16/2021
1.2.1 16,008 6/15/2021
1.2.0 673 5/17/2021
1.1.2 9,152 1/16/2021
1.1.1 7,465 11/1/2020
1.1.0 1,687 10/14/2020
1.0.9 1,748 5/27/2020
1.0.8 531 5/26/2020
1.0.7 786 5/25/2020
1.0.6 525 5/25/2020
1.0.5 518 5/25/2020
1.0.2 491 5/25/2020
1.0.1 484 5/25/2020

Update nuget package