You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Get a range of colors that wrap around the hue of the HSL color spectrum.
23
+
24
+
NOTE: this calls Gradient.GetRainbow, but is named more correctly. When you ask for a lot of colors, the color wheel will wrap around. To avoid repeating colors, it defaults to a HueStep of 50 (meaning it goes a full 360 degrees and wraps around fter 7 steps), but it also changes the brightness, so by the time it wraps around, it's not the same shade. As a result, it doesn't actually repeat unless you ask for hundreds of colors, but the more colors you ask for, the more similar they get. You can tweak that by using BrightStep or HueStep
25
+
26
+
## EXAMPLES
27
+
28
+
### ---- Example 1 -------------------------------------------------------------
29
+
30
+
```
31
+
PS C:\> Get-ColorWheel Magenta -Bright 0
32
+
```
33
+
34
+
Get a 7-color rainbow. Since we specified Magenta as the starting point, the first returned color is Red.
35
+
36
+
37
+
### ---- Example 2 -------------------------------------------------------------
38
+
39
+
```
40
+
PS C:\> Get-ColorWheel Magenta
41
+
```
42
+
43
+
Gets a 2D gradient from the ConsoleColor Red to Blue, with as many colors as the current width of the console.
44
+
45
+
46
+
## PARAMETERS
47
+
48
+
### -BrightStep
49
+
How much to adjust the lightness (alias Light step)
50
+
51
+
```yaml
52
+
Type: Int32
53
+
Parameter Sets: (All)
54
+
Aliases: LightStep
55
+
56
+
Required: False
57
+
Position: Named
58
+
Default value: 4
59
+
Accept pipeline input: False
60
+
Accept wildcard characters: False
61
+
```
62
+
63
+
### -Color
64
+
The starting color (as an RGB color value)
65
+
66
+
```yaml
67
+
Type: RgbColor
68
+
Parameter Sets: (All)
69
+
Aliases: StartColor
70
+
71
+
Required: False
72
+
Position: 0
73
+
Default value: Red
74
+
Accept pipeline input: True (ByValue)
75
+
Accept wildcard characters: False
76
+
```
77
+
78
+
### -Count
79
+
How many colors to return
80
+
81
+
```yaml
82
+
Type: Int32
83
+
Parameter Sets: (All)
84
+
Aliases:
85
+
86
+
Required: False
87
+
Position: Named
88
+
Default value: 7
89
+
Accept pipeline input: False
90
+
Accept wildcard characters: False
91
+
```
92
+
93
+
### -HueStep
94
+
How many degrees of the color wheel to go for a new color.
95
+
96
+
```yaml
97
+
Type: Int32
98
+
Parameter Sets: (All)
99
+
Aliases:
100
+
101
+
Required: False
102
+
Position: Named
103
+
Default value: 50
104
+
Accept pipeline input: False
105
+
Accept wildcard characters: False
106
+
```
107
+
108
+
### -Passthru
109
+
If set, returns the start color in addition to the Count
110
+
111
+
```yaml
112
+
Type: SwitchParameter
113
+
Parameter Sets: (All)
114
+
Aliases:
115
+
116
+
Required: False
117
+
Position: Named
118
+
Default value: False
119
+
Accept pipeline input: False
120
+
Accept wildcard characters: False
121
+
```
122
+
123
+
### CommonParameters
124
+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
Copy file name to clipboardexpand all lines: Docs/Pansies.md
+10-5
Original file line number
Diff line number
Diff line change
@@ -17,12 +17,18 @@ It requires PowerShell 5 or higher, and an ANSI-capable host like the Windows 10
17
17
18
18
## Cmdlets
19
19
20
+
### [Get-ColorWheel](Get-ColorWheel.md)
21
+
Like Get-Gradient, but allows you to specify the Hue step and by default adjusts the brightness so you don't get exact color repeatition
22
+
20
23
### [Get-Complement](Get-Complement.md)
21
24
Get the Hue complement color
22
25
23
26
### [Get-Gradient](Get-Gradient.md)
24
27
Get a range of colors between two colors
25
28
29
+
### [New-Hyperlink](New-Hyperlink.md)
30
+
Takes a Uri and optional text and writes [a hyperlink](https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda#file-hyperlinks_in_terminal_emulators-md) supported by most terminals
31
+
26
32
### [New-Text](New-Text.md)
27
33
Create a Text object with specified background and foreground colors. Supports [HTML named entities](https://www.w3schools.com/charsets/ref_html_entities_4.asp) like `♥` and `½` or `ü` and numerical unicode character entities in both decimal (e.g. `Ξ`) and hexadeximal (`Ξ`)
28
34
@@ -45,13 +51,12 @@ Pansies provides a few important classes:
45
51
46
52
*Text* is a text class which contains BackgroundColor and ForegroundColor properties and a `ToString()` implementation based on VT escape sequences. It also supports HTML named enties like the `♥` example above.
47
53
48
-
There are also *Palette* classes which support the XTerm 256 color palette, the X11 named colors palette (with over 650 named colors), and the default 16 color console palette (which includes loading the actual palette of the console in Windows). Each of these Palettes has the ability to find the closest match to any given RgbColor.
54
+
### Color Spaces
49
55
50
-
You can play with setting `[PoshCode.Pansies.RgbColor]::ColorMode` to change how the colors are down-sampled, and modify the actual palettes in `[PoshCode.Pansies.RgbColor]::ConsolePalette` and `[PoshCode.Pansies.RgbColor]::XTermPalette`
56
+
Pansies includes versions of all the old Colormine library classes, so it's a very complete library for color spaces regardless of whether you're doing terminal work or color work in graphical or web applications. There are colorspace classes for HSL, HSB, LAB, and Hunter LAB, CMY and CMYK, LCH, LUV, XYZ, YXY, and of course, RGB. These color spaces support converting colors between them, doing color math like measuring distance, calculating midpoints and gradients, etc. There are also color comparison libraries with implementations of [Cie 76]9http://en.wikipedia.org/wiki/Color_difference#CIE76), [Cie 94](http://en.wikipedia.org/wiki/Color_difference#CIE94), [Cie delta-e 2000](http://en.wikipedia.org/wiki/Color_difference#CIEDE2000) and [Cmc l:c](http://en.wikipedia.org/wiki/Color_difference#CMC_l:c_.281984.29).
51
57
52
58
53
-
## Contribute
59
+
We also have *palette* classes which support the XTerm 256 color palette, the X11 named colors palette (with over 650 named colors), and the default 16 color console palette (which includes loading the actual palette of the `console` when in Windows console). Any palette has the ability to find the closest match to any given RgbColor (by default, using the Cie De2000 algorithm) so you can downscale nicely from full color to 256 or 16 color.
54
60
55
-
The end goal for this project is for the Color and Text classes (possibly without the color space conversions) to make it into the core PowerShell product, so what I'm most interested in here is [any ideas](https://github.com/PoshCode/Pansies/issues) people have for a better user experience for writing text and partially colored text, as well as other ANSI Virtual Terminal escape sequences.
61
+
You can play with setting `[PoshCode.Pansies.RgbColor]::ColorMode`to change how the colors are down-sampled, and you can even modify the actual palettes in `[PoshCode.Pansies.RgbColor]::ConsolePalette`and `[PoshCode.Pansies.RgbColor]::XTermPalette`
56
62
57
-
For the sake of PowerShell 5, I intend to keep this module around. Any features that don't belong in PowerShell core will stay here too, and I may even split some of the Windows-specific features into a `PANSIES.Windows` module or something, to support themes on older versions of PowerShell for Windows (running in ConEmu with ANSI support, or just downsampling everything to ConsoleColors).
Copy file name to clipboardexpand all lines: README.md
+3-2
Original file line number
Diff line number
Diff line change
@@ -48,15 +48,16 @@ Note: Because I'm including p2f as a submodule, you may ocassionally need to upd
48
48
git submodule update --init --recursive
49
49
```
50
50
51
-
### Currently Pansies provides five commands:
51
+
### Currently Pansies provides six commands:
52
52
53
53
Cmdlet | Description
54
54
------ | -----------
55
55
New-Text | Creates a `Text` object. Provides parameters for `BackgroundColor` and `ForegroundColor` properties, that renders in console
56
56
New-Hyperlink | Takes a Uri and optional text and writes [a hyperlink](https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda#file-hyperlinks_in_terminal_emulators-md) supported by most terminals
57
57
Write-Host | Writes to host just like Write-Host, but with full RGBColor support and a -PersistentColor option
58
58
Get-Gradient | Get a range of colors between two colors
59
-
Get-Complement | Gets the Hue complement of a color
59
+
Get-ColorWheel | Like Get-Gradient, but allows you to specify the Hue step and by default adjusts the brightness so you don't get exact color repeatition
60
+
Get-Complement | Get the Hue complement of a color
60
61
61
62
One key feature is that `New-Text` and `Write-Host` both support [HTML named entities](https://www.w3schools.com/charsets/ref_html_entities_4.asp) like `♥` and `½` or `ü`, and numerical unicode character entities in both decimal (e.g. `Ξ`) and hexadeximal (`Ξ`), so you can easily embed characters, and even color them, so to write out "I ♥ PS" with a red heart you can just:
0 commit comments