Apicat Docs
  1. Dynamic values Modules
Apicat Docs
  • What is Apicat?
  • Send requests
    • Create requests
      • Request basics
      • Parameters and body
      • Request headers
      • Request settings
      • Dynamic values
      • HTTP/2
      • SOAP/WebService
    • Authentication and authorization
      • Overview
      • CA and client certificates
      • Authorization types supported by Apidog
      • Digest Auth
      • OAuth 1.0
      • OAuth 2.0
      • Hawk Authentication
      • Kerberos
      • NTLM
      • Akamai EdgeGrid
    • Response and cookies
      • Overview
      • API response in Apidog
      • Create and send cookies
      • Debug requests
    • Dynamic values Modules
      • Airline
      • Animal
      • Color
      • Commerce
      • Company
      • Database
      • Datatype
      • Date
      • Finance
      • Food
      • Git
      • Hacker
      • Helpers
      • Image
      • Internet
      • Location
      • Lorem
      • Music
      • Number
      • Person
      • Phone
      • Science
      • String
      • System
      • Vehicle
      • Word
  • Environments & variables
    • Overview
    • Using variables
    • Environments & services
  • Pre/Post processors
    • Overview
    • Assertion
    • Extract variable
    • Wait
    • Database operations
      • Overview
      • MySQL
      • MongoDB
      • Redis
      • Oracle Client
    • Using scripts
      • Overview
      • Pre processor scripts
      • Post processor scripts
      • Public scripts
      • Postman scripts reference
      • Calling other programming languages
      • Using JS libraries
      • Visualizing responses
      • Script examples
        • Assertion scripts
        • Using variables in scripts
        • Using scripts to modify request messages
        • Other examples
  • Best practices
    • How to handle API signatures
    • How to access OAuth 2.0 protected APIs
    • Apidog collaboration workflow
    • Managing authentication state in Apidog
  • Account & preferences
    • Account settings
    • Generate OpenAPI access token
    • Language settings
    • Hot keys
    • Network proxy configuration
    • Data backup
    • Updating Apidog
    • Deleting account
    • Experimental Features
  • References
    • API-Design First Approach
    • Apidog OpenAPI/Swagger Specificaiton Extensions
    • JSONPath
    • XPath
    • Regular Expressions
    • JSON Schema
    • CSV File Format
    • Install Java Environment
    • Runner deployment environment
    • Apidog flavored Markdown
  1. Dynamic values Modules

Color

Module to generate colors.
Overview
For a human-readable color like 'red', use human().
For a hex color like #ff0000 used in HTML/CSS, use rgb(). There are also methods for other color formats such as hsl(), cmyk(), hwb(), lab(), and lch().

cmyk#

Returns a CMYK color.
Parameters
| Name | Type | Default | Description |
| --- | --- |
| format | ColorFormat | 'decimal' | Format of generated CMYK color. |
Returns: string | number[]
Examples

colorByCSSColorSpace#

Returns a random color based on CSS color space specified.
Returns: string | number[]
Parameters
NameTypeDefaultDescription
formatColorFormat'decimal'Format of generated RGB color.
spaceColorFormat\sRGB' | 'display-p3' | 'rec2020' | 'a98-rgb' | 'prophoto-rgb'Color space to generate the color for.
Examples

cssSupportedFunction#

Returns a random color based on CSS color space specified.
Returns: 'rgb' | 'rgba' | 'hsl' | 'hsla' | 'hwb' | 'cmyk' | 'lab' | 'lch' | 'color'
Examples

cssSupportedSpace#

Returns a random css supported color space name.
Returns: 'sRGB' | 'display-p3' | 'rec2020' | 'a98-rgb' | 'prophoto-rgb'
Examples

hsl#

Returns an HSL color.
Parameters
NameTypeDefaultDescription
formatColorFormat'decimal'Format of generated RGB color.
includeAlphabooleanfalseAdds an alpha value to the color (RGBA).
Returns: string | number[]
Examples

human#

Returns a random human-readable color name.
Returns: string
Examples

hwb#

Returns an HWB color.
Parameters
NameTypeDefaultDescription
formatColorFormat'decimal'Format of generated RGB color.
Returns: string | number[]
Examples

lab#

Returns a LAB (CIELAB) color.
Parameters
NameTypeDefaultDescription
formatColorFormat'decimal'Format of generated RGB color.
Returns: string | number[]
Examples

lch#

Returns an LCH color. Even though upper bound of chroma in LCH color space is theoretically unbounded, it is bounded to 230 as anything above will not make a noticeable difference in the browser.
Parameters
NameTypeDefaultDescription
formatColorFormat'decimal'Format of generated RGB color.
Returns: string | number[]
Examples

rgb#

Returns an RGB color.
Parameters
NameTypeDefaultDescription
casingCasing'lower'FLetter type case of the generated hex color. Only applied when 'hex' format is used.
formatColorFormat'decimal'Format of generated RGB color.
includeAlphaboolean'false'Adds an alpha value to the color (RGBA).
prefixstring'#'Prefix of the generated hex color. Only applied when 'hex' format is used.
Returns: string | number[]
Examples

space#

Returns a random color space name from the worldwide accepted color spaces. Source: https://en.wikipedia.org/wiki/List_of_color_spaces_and_their_uses
Returns: string
Examples
Modified at 2025-06-25 07:57:16
Previous
Animal
Next
Commerce
Built with