Color
Provides color information in HEX, RGB, and HSL formats.
Type Definition
type Color {
color: String
rgb: String
hsl: String
}Fields
| Field | Type | Description | Nullable | Relationship |
|---|---|---|---|---|
| color | String | Color as a HEX string (e.g., #RRGGBB) | Yes | None |
| rgb | String | Color as an RGB string (e.g., rgb(255, 255, 255)) | Yes | None |
| hsl | String | Color as an HSL string (e.g., hsl(0, 0%, 100%)) | Yes | None |
Relationships
The Color type is a standalone object representing color values in different string formats. It does not have direct relationships to other object types but can be used within other types to provide color information.
Usage Examples
Basic Query
{
color {
color
rgb
hsl
}
}Field Selection
{
color {
color
}
}{
color {
rgb
hsl
}
}Nested Queries
Since Color is typically nested within other objects, here is an example assuming a parent object Product has a color field of type Color:
{
product(id: 12345) {
id
title
color {
color
rgb
hsl
}
}
}Filtering and Sorting
The Color type itself does not support filtering or sorting directly as it contains only scalar string fields representing color values. Filtering or sorting by color would need to be implemented at the parent object level.
Implements
This type does not implement any interfaces.
Connections
The Color type does not have connections to other types or paginated lists.
Related Types
Color can be used as a field type within other object types that require color representation, such as product variants, themes, or design elements.
Best Practices
- Use the
colorfield to get the HEX representation when working with web color codes. - Use
rgborhslfields when you need color values in those specific formats for CSS or color manipulation libraries. - Always check for
nullvalues as all fields are optional. - When nesting
Colorinside other objects, select only the fields you need to optimize query performance.
Notes
- All color fields are optional and may return
nullif the color information is not available. - The API currently requires no authentication, but this may change in future versions.
- Since the color fields are simple strings, caching and performance impact are minimal.
- No computed or derived fields exist on the
Colortype; it only returns stored color values. - No field arguments are defined for this type.