View Source Image.Color (image v0.2.0)

Functions to manage image color and color conversion.

Link to this section Summary

Types

Reference to an ICC color profile

An rbg color expressed as a list of numbers.

Functions

Returns a mapping from CSS color names to CSS hex values and RGB triplets as a list.

Returns the list of color profiles built into libvips.

Guards whether a given value can be interpreted as a color value.

Guards whether a given profile is one of the inbuilt profiles.

Returns a boolean indicating if the given profile is known and can be used for image operations.

Link to this section Types

@type icc_profile() :: :none | :cmyk | :srgb | :p3 | Path.t()

Reference to an ICC color profile

  • :none means no profile
  • :cmyk, :srgb and :p3 refer to the built-in color profiles
  • Path.t() means any file system path. If the path is a relative path then is will be loaded from the systems profile directory.
@type rgb_color() :: [number()]

An rbg color expressed as a list of numbers.

The number of list elements and the type varies depending on the image format, colorspace and dimensions.

For a common sRGB image it will be a list of three of four images. If the fourth number is provided it will be considered as an alpha transparency band.

Link to this section Functions

Returns a mapping from CSS color names to CSS hex values and RGB triplets as a list.

Returns the list of color profiles built into libvips.

Link to this macro

is_color(color)

View Source (macro)

Guards whether a given value can be interpreted as a color value.

Link to this macro

is_inbuilt_profile(profile)

View Source (macro)

Guards whether a given profile is one of the inbuilt profiles.

Link to this function

known_icc_profile?(profile)

View Source

Returns a boolean indicating if the given profile is known and can be used for image operations.

Link to this function

rgba_color!(color, a \\ 255)

View Source