Defines what color system is used for an object, and which colorants exist.
For a Pixmap the interface Pixmap.prototype.getColorSpace()
returns its colorspace, which defines what colorants make up the pixel
colors in the Pixmap and how those colorants are stored. If that
colorspace is e.g., ColorSpace.DeviceRGB, then
the colorants red, green and
blue are combined to make up the color of each
pixel.
Create a new ColorSpace from an ICC profile.
Buffer | ArrayBuffer | Uint8Array | string) – A buffer
containing an ICC profile.string) – A user descriptive
name for the new colorspace.var icc_colorspace = new mupdf.ColorSpace(fs.readFileSync("SWOP.icc"), "SWOP")The default Grayscale colorspace
The default RGB colorspace
The default RGB colorspace, but with components in reverse order
The default CMYK colorspace
The default Lab colorspace
Return the name of this colorspace.
A Grayscale colorspace has one component, RGB has 3, CMYK has 4, and DeviceN may have any number of components.
var cs = mupdf.ColorSpace.DeviceRGB
var num = cs.getNumberOfComponents() // 3Returns a string indicating the type of this colorspace, one of:
"None" | "Gray" | "RGB" | "BGR" | "CMYK" | "Lab" | "Indexed" | "Separation"Returns true if the object is a CMYK color space.
var bool = colorSpace.isCMYK()Returns true if the object is a Device N color
space.
var bool = colorSpace.isDeviceN()Returns true if the object is a gray color space.
var bool = colorSpace.isGray()Returns true if the object is an Indexed color
space.
var bool = colorSpace.isIndexed()Returns true if the object is a Lab color space.
var bool = colorSpace.isLab()Returns true if the object is an RGB color space.
var bool = colorSpace.isRGB()Returns true if the object is a subtractive color
space.
var bool = colorSpace.isSubtractive()Return name of this colorspace.
var cs = mupdf.ColorSpace.DeviceRGB
var name = cs.toString() // "[ColorSpace DeviceRGB]"