PowerTip: Use PowerShell to Display Known Colors

Doctor Scripto

Summary: Boe Prox shows how to find all known colors on your computer. Hey, Scripting Guy! Question How can I use Windows PowerShell to find known colors on my computer and their hex representations?

Hey, Scripting Guy! Answer Use the Add-Type cmdlet as follows:

Add-Type –assemblyName PresentationFramework

[windows.media.colors] | Get-Member -static -Type Property |

Select -Expand Name| ForEach {

    [pscustomobject] @{

        ARGB = “$([windows.media.colors]::$_)”

        Color = $_

    }

}  

ARGB                                    Color                                 

—-                                    —–                                 

#FFF0F8FF                               AliceBlue                              

#FFFAEBD7                               AntiqueWhite                          

#FF00FFFF                               Aqua                                  

#FF7FFFD4                               Aquamarine                            

#FFF0FFFF                               Azure                                 

#FFF5F5DC                               Beige                                 

#FFFFE4C4                               Bisque                                

#FF000000                               Black                                 

#FFFFEBCD                               BlanchedAlmond                        

#FF0000FF                               Blue                                  

#FF8A2BE2                               BlueViolet                            

#FFA52A2A                               Brown                                 

#FFDEB887                               BurlyWood                             

#FF5F9EA0                               CadetBlue                              

#FF7FFF00                               Chartreuse                            

#FFD2691E                               Chocolate                             

#FFFF7F50                               Coral                                  

#FF6495ED                               CornflowerBlue     & nbsp;                  

#FFFFF8DC                               Cornsilk                              

#FFDC143C                               Crimson                               

#FF00FFFF                               Cyan 

0 comments

Discussion is closed.

Feedback usabilla icon