Back to home page

Kolourify

Give Kolour to your words!

Built withPS 5.1
LicenseMIT
Checksum (SHA256)7a8422e18f9ada7bfb43261603c1d169e9127699e0206a0a51b1cce39c894b6b
NameKolourify
Version25.0.0
Stage60.50 Published
Released2025-06-18 00:00:00

Kolourify is a small PowerShell script to convert words into unique colours!

This script takes a string as input and converts it into its unique colour representation. It supports the hexadecimal and RGB colour formats and can output a list of bytes.

The unique colour is determined by hashing the input string and keeping only the first, middle, and last two bytes of the hash. The hashing algorithms supported are SHA-256, SHA-1, and MD5, although this list is easily extensible.

NAME
    .\Kolourify.ps1

SYNOPSIS
    Converts a string to a unique colour.

SYNTAX
    .\Kolourify.ps1 [-InputObject] <String> [[-OutputFormat] <String>] [[-HashAlgorithm] <String>] [<CommonParameters>]

DESCRIPTION
    This script takes a string and generates a unique colour based on its hash.

PARAMETERS
    -InputObject <String>
        The input string to be converted to a colour. Accepts pipeline input.

        Required?                    true
        Position?                    1
        Default value
        Accept pipeline input?       true (ByValue, ByPropertyName)
        Accept wildcard characters?  false

    -OutputFormat <String>
        The format of the output colour.

        Hex: Outputs the colour in hexadecimal format (e.g. #F0FF08).
        RGB: Outputs the colour in RGB format (e.g. rgb(240, 255, 8)).
        Bytes: Outputs the colour as a byte array (e.g. [240, 255, 8]).

        Required?                    false
        Position?                    2
        Default value                Hex
        Accept pipeline input?       false
        Accept wildcard characters?  false

    -HashAlgorithm <String>
        The hash algorithm to use for generating the colour.

        Required?                    false
        Position?                    3
        Default value                SHA256
        Accept pipeline input?       false
        Accept wildcard characters?  false

    <CommonParameters>
        This cmdlet supports the common parameters: Verbose, Debug,
        ErrorAction, ErrorVariable, WarningAction, WarningVariable,
        OutBuffer, PipelineVariable, and OutVariable. For more information, see
        about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).

INPUTS

OUTPUTS

NOTES

        Author: DELAN Mia
        Date: 2025-06-18
        Version: 25.0.0

        MIT License
        2025 (c) DELAN Mia

    -------------------------- EXAMPLE 1 --------------------------

    PS>"Kolourify" | .\Kolourify.ps1

    Outputs the colour in hexadecimal format (i.e. #F0FF08)

    -------------------------- EXAMPLE 2 --------------------------

    PS>"Kolourify" | .\Kolourify.ps1 -Format RGB

    Outputs the colour in RGB format (i.e. rgb(240, 255, 8))

    -------------------------- EXAMPLE 3 --------------------------

    PS>"Kolourify" | .\Kolourify.ps1 -Format Bytes -Algo SHA1

    Outputs the colour as a byte array using SHA1 hash algorithm (i.e. [181, 157, 70])