Color Object Simplified Format

Explicit format

Defined as a JSON object:

Color class JSON object
Book color {
    "book": book,
    "name": name,
    "bookID": bookID,
    "bookKey": bookKey
}

or
{
    "book": book,
    "name": name
}

or
{
    "bookID": bookID,
    "bookKey": bookKey
}
CMYK color {
    "cyan": cyan,
    "magenta": magenta,
    "yellowColor": yellowColor,
    "black": black
}
Grayscale {
    "gray": gray
}
HSB color {
    "hue": hue,
    "saturation": saturation,
    "brightness": brightness
}
Lab color {
    "luminance": luminance,
    "a": a,
    "b": b
}
RGB color {
    "red": red,
    "green": green,
    "blue": blue
}

book : string
name : string
bookID : number
bookKey : string

cyan : number (percentage; 0% to 100%)
magenta : number (percentage; 0% to 100%)
yellowColor : number (percentage; 0% to 100%)
black : number (percentage; 0% to 100%)

gray : number (percentage; 0% to 100%)

hue : number (0° to 360°)
saturation : number (percentage; 0% to 100%)
brightness : number (percentage; 0% to 100%)

luminance : number (0 to 100)
a : number (-128 to 127)
b : number (-128 to 127)

red : number (0 to 255)
green : number (0 to 255)
blue : number (0 to 255)

Minimal format

Defined as a two-element JSON array: [ colorClass, colorComponents ]

colorClass : string (among "bookColor", "CMYKColorClass", "grayscale", "HSBColorClass", "labColor", "RGBColor")

colorComponents : JSON array whose length and contents depend on colorClass :

colorClass colorComponents
"bookColor" [ book, name, bookID, bookKey ]
or
[ book, name ]
or
[ bookID, bookKey ]
"CMYKColorClass" [ cyan, magenta, yellowColor, black ]
"grayscale" [ gray ]
or
gray
"HSBColorClass" [ hue, saturation, brightness ]
"labColor" [ luminance, a, b ]
"RGBColor" [ red, green, blue ]

book : string
name : string
bookID : number
bookKey : string

cyan : number (percentage; 0% to 100%)
magenta : number (percentage; 0% to 100%)
yellowColor : number (percentage; 0% to 100%)
black : number (percentage; 0% to 100%)

gray : number (percentage; 0% to 100%)

hue : number (0° to 360°)
saturation : number (percentage; 0% to 100%)
brightness : number (percentage; 0% to 100%)

luminance : number (0 to 100)
a : number (-128 to 127)
b : number (-128 to 127)

red : number (0 to 255)
green : number (0 to 255)
blue : number (0 to 255)

Examples

{
    "book": "PANTONE® solid coated",
    "name": "PANTONE 265 C"
}
{
    "cyan": 17,
    "magenta": 92,
    "yellowColor": 0,
    "black": 0
}
{
    "gray": 50
}
{
    "hue": 0,
    "saturation": 50,
    "brightness": 100
}
{
    "luminance": 90,
    "a": -10,
    "b": 80
}
{
    "red": 0,
    "green": 128,
    "blue": 128
}

Test Colors Layers Palette

[ "bookColor", [ "PANTONE® solid coated", "PANTONE 265 C" ] ]
[ "CMYKColorClass", [ 17, 92, 0, 0 ] ]
[ "grayscale", [ 50 ] ]
[ "HSBColorClass", [ 0, 50, 100 ] ]
[ "labColor", [ 90, -10, 80 ] ]
[ "RGBColor", [ 0, 128, 128 ] ]

Tags: , , , , ,

Comments are closed.