Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/romansoloweow/avalonia.colorgenerator
Color generator for Avalonia framework
https://github.com/romansoloweow/avalonia.colorgenerator
avalonia colorgenerator
Last synced: 17 days ago
JSON representation
Color generator for Avalonia framework
- Host: GitHub
- URL: https://github.com/romansoloweow/avalonia.colorgenerator
- Owner: RomanSoloweow
- License: mit
- Created: 2021-02-20T12:21:19.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-11-12T11:52:51.000Z (about 3 years ago)
- Last Synced: 2024-10-23T08:50:26.034Z (23 days ago)
- Topics: avalonia, colorgenerator
- Language: C#
- Homepage:
- Size: 625 KB
- Stars: 11
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![NuGet Pre Release](https://img.shields.io/nuget/vpre/AvaloniaColorGenerator.svg)](https://www.nuget.org/packages/AvaloniaColorGenerator) [![](https://img.shields.io/github/stars/RomanSoloweow/Avalonia.ColorGenerator)](https://github.com/RomanSoloweow/Avalonia.ColorGenerator) [![](https://img.shields.io/github/license/RomanSoloweow/Avalonia.ColorGenerator)](https://github.com/RomanSoloweow/Avalonia.ColorGenerator) [![](https://img.shields.io/github/languages/code-size/RomanSoloweow/Avalonia.ColorGenerator)](https://github.com/RomanSoloweow/Avalonia.ColorGenerator)
[![]( https://img.shields.io/github/last-commit/RomanSoloweow/Avalonia.ColorGenerator)](https://github.com/RomanSoloweow/Avalonia.ColorGenerator)
# Avalonia.ColorGeneratorGenerates a number for choosing a color from a ready set.
Usage [example](https://github.com/RomanSoloweow/DraggableColors) (application with color display)
![](https://github.com/RomanSoloweow/Avalonia.ColorGenerator/blob/master/Example.png)
```C#
ColorGenerator generator = new();
```
Get random color
```C#
ColorWithValue value = generator.Next();
```
Get random unique color (in case of overflow, the list will start over or be re-formed depending on the flag)
```C#
ColorWithValue value = generator.NextUnique();
```
You can implement your own set of colors for the generator by implementing the interface
```C#
public interface IColorsPack
{
int CountColors();
ColorDefinition GetColor(int colorNumber);
ColorDefinition GetColor(string colorName);
}
```Fields of color:
- Color - Color for SolidColorBrush or other
- Name - name of current color
- Index - index of current color
- Hex - Color Hex format## Licenseπ
Licensed under the [MIT](LICENSE) license.