Skip to content

Commit

Permalink
Merge pull request #32 from ShaunLawrie/prerelease
Browse files Browse the repository at this point in the history
Fix broken color transformation
  • Loading branch information
ShaunLawrie authored Feb 25, 2024
2 parents ba571b2 + 76f88a7 commit 416ef38
Show file tree
Hide file tree
Showing 39 changed files with 1,410 additions and 30 deletions.
2 changes: 1 addition & 1 deletion PwshSpectreConsole.Docs/UpdateDocs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ if($null -eq $module) {

$module | Save-MarkdownHelp -OutputPath "$PSScriptRoot\src\content\docs\reference\" -IncludeYamlHeader -YamlHeaderInformationType Metadata -ExcludeFile "*.gif", "*.png"

$new = @("New-SpectreChartItem.md", "Get-SpectreDemoColors.md", "Get-SpectreDemoEmoji.md", "Format-SpectreJson.md")
$new = @("New-SpectreChartItem.md", "Get-SpectreDemoColors.md", "Get-SpectreDemoEmoji.md", "Format-SpectreJson.md", "Write-SpectreCalendar.md", "Format-SpectreJson.md")
$experimental = @("Get-SpectreImageExperimental.md", "Invoke-SpectreScriptBlockQuietly.md")

$newTag = @"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,18 @@ title: Set-SpectreColors







### Synopsis
Sets the accent color and default value color for Spectre Console.



---


### Description

This function sets the accent color and default value color for Spectre Console. The accent color is used for highlighting important information, while the default value color is used for displaying default values.
Expand All @@ -19,8 +26,11 @@ An example of the accent color is the highlight used in `Read-SpectreSelection`:
An example of the default value color is the default value displayed in `Read-SpectreText`:
![Default value color example](/defaultcolor.png)



---


### Examples
Sets the accent color to Red and the default value color to Yellow.

Expand All @@ -33,37 +43,76 @@ Sets the accent color to Green and keeps the default value color as Grey.
Set-SpectreColors -AccentColor Green
```


---


### Parameters
#### **AccentColor**

The accent color to set. Must be a valid Spectre Console color name. Defaults to "Blue".






|Type |Required|Position|PipelineInput|
|---------|--------|--------|-------------|
|`[Color]`|false |1 |false |



#### **DefaultValueColor**

The default value color to set. Must be a valid Spectre Console color name. Defaults to "Grey".






|Type |Required|Position|PipelineInput|
|---------|--------|--------|-------------|
|`[Color]`|false |2 |false |



#### **DefaultTableHeaderColor**

The default table header color to set. Must be a valid Spectre Console color name. Defaults to "Default" which will be the standard console foreground color.






|Type |Required|Position|PipelineInput|
|---------|--------|--------|-------------|
|`[Color]`|false |3 |false |



#### **DefaultTableTextColor**

The default table text color to set. Must be a valid Spectre Console color name. Defaults to "Default" which will be the standard console foreground color.






|Type |Required|Position|PipelineInput|
|---------|--------|--------|-------------|
|`[Color]`|false |4 |false |





---


### Syntax
```powershell
Set-SpectreColors [[-AccentColor] <Color>] [[-DefaultValueColor] <Color>] [[-DefaultTableHeaderColor] <Color>] [[-DefaultTableTextColor] <Color>] [<CommonParameters>]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,40 @@ title: Get-SpectreDemoColors







### Synopsis
Retrieves a list of Spectre Console colors and displays them with their corresponding markup.
![Spectre color demo](/colors.png)



---


### Description

The Get-SpectreDemoColors function retrieves a list of Spectre Console colors and displays them with their corresponding markup.
It also provides information on how to use the colors as parameters for commands or in Spectre Console markup.



---


### Examples
Displays a list of Spectre Console colors and their corresponding markup.

```powershell
PS> Get-SpectreDemoColors
```


---


### Syntax
```powershell
Get-SpectreDemoColors [<CommonParameters>]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,49 @@ title: Get-SpectreDemoEmoji







### Synopsis
Retrieves a collection of emojis available in Spectre Console.
![Example emojis](/emoji.png)



---


### Description

The Get-SpectreDemoEmoji function retrieves a collection of emojis available in Spectre Console. It displays the general emojis, faces, and provides information on how to use emojis in Spectre Console markup.



---


### Examples
Retrieves and displays the collection of emojis available in Spectre Console.

```powershell
Get-SpectreDemoEmoji
```


---


### Notes
Emoji support is dependent on the operating system, terminal, and font support. For more information on Spectre Console markup and emojis, refer to the following links:
- Spectre Console Markup: https://spectreconsole.net/markup
- Spectre Console Emojis: https://spectreconsole.net/appendix/emojis



---


### Syntax
```powershell
Get-SpectreDemoEmoji [<CommonParameters>]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,39 @@ title: Start-SpectreDemo







### Synopsis
Runs a demo of the PwshSpectreConsole module.
![Spectre demo animation](/demo.gif)



---


### Description

This function runs a demo of the PwshSpectreConsole module, showcasing some of its features. It displays various examples of Spectre.Console functionality wrapped in PowerShell functions, such as text entry, select lists, multi-select lists, and panels.



---


### Examples
Runs the PwshSpectreConsole demo.

```powershell
PS C:\> Start-SpectreDemo
```


---


### Syntax
```powershell
Start-SpectreDemo [<CommonParameters>]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,28 @@ title: Format-SpectreBarChart







### Synopsis
Formats and displays a bar chart using the Spectre Console module.
![Example bar chart](/barchart.png)



---


### Description

This function takes an array of data and displays it as a bar chart using the Spectre Console module. The chart can be customized with a title and width.



---


### Examples
This example uses the new helper for generating chart items New-SpectreChartItem and shows the various ways of passing color values in

Expand All @@ -28,39 +38,76 @@ $data += New-SpectreChartItem -Label "Bananas" -Value 2.2 -Color "#FFFF00"
Format-SpectreBarChart -Data $data -Title "Fruit Sales" -Width 50
```


---


### Parameters
#### **Data**

An array of objects containing the data to be displayed in the chart. Each object should have a Label, Value, and Color property.






|Type |Required|Position|PipelineInput |
|---------|--------|--------|--------------|
|`[Array]`|true |1 |true (ByValue)|



#### **Title**

The title to be displayed above the chart.






|Type |Required|Position|PipelineInput|
|----------|--------|--------|-------------|
|`[String]`|false |2 |false |



#### **Width**

The width of the chart in characters.






|Type |Required|Position|PipelineInput|
|---------|--------|--------|-------------|
|`[Int32]`|false |3 |false |



#### **HideValues**

Hides the values from being displayed on the chart.






|Type |Required|Position|PipelineInput|
|----------|--------|--------|-------------|
|`[Switch]`|false |named |false |





---


### Syntax
```powershell
Format-SpectreBarChart [-Data] <Array> [[-Title] <String>] [[-Width] <Int32>] [-HideValues] [<CommonParameters>]
Expand Down
Loading

0 comments on commit 416ef38

Please sign in to comment.