Module: Sai::Conversion::RGB Private

Defined in:
lib/sai/conversion/rgb.rb,
lib/sai/conversion/rgb/color_space.rb,
lib/sai/conversion/rgb/color_indexer.rb,
lib/sai/conversion/rgb/color_classifier.rb,
lib/sai/conversion/rgb/color_transformer.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

RGB color conversion utilities

Author:

Since:

  • 0.1.0

Defined Under Namespace

Modules: ColorClassifier, ColorIndexer, ColorSpace, ColorTransformer

Class Method Summary collapse

Class Method Details

.classify ⇒ Module<ColorClassifier>

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Color classification utilities

Returns:

Author:

Since:

  • 0.3.1



28
29
30
# File 'lib/sai/conversion/rgb.rb', line 28

def classify
  ColorClassifier
end

.index ⇒ Module<ColorIndexer>

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Color indexing utilities

Returns:

Author:

Since:

  • 0.3.1



41
42
43
# File 'lib/sai/conversion/rgb.rb', line 41

def index
  ColorIndexer
end

.resolve(color) ⇒ Array<Integer>

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Convert a color value to RGB components

Parameters:

  • color (String, Array<Integer>) —

    the color to convert

Returns:

  • (Array<Integer>) —

    the RGB components

Raises:

  • (ArgumentError) —

    if the color format is invalid

Author:

Since:

  • 0.1.0



57
58
59
# File 'lib/sai/conversion/rgb.rb', line 57

def resolve(color)
  ColorSpace.resolve(color)
end

.transform ⇒ Module<ColorTransformer>

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Transform RGB values

Returns:

Author:

Since:

  • 0.3.1



70
71
72
# File 'lib/sai/conversion/rgb.rb', line 70

def transform
  ColorTransformer
end