PreviousUpNext

15.3.741  src/lib/x-kit/xclient/src/color/hue-saturation-value.api

## hue-saturation-value.api

# Compiled by:
#     src/lib/x-kit/xclient/xclient-internals.sublib



# Specification of various color space utilities.



###               "The difference between papa and mama is,
###                that mama loves morals and papa loves cats."
###
###                                 -- Susy Clemens
###                                    (quoted in Mark Twain, a Biography)


# This api is implemented in:
#
#     src/lib/x-kit/xclient/src/color/hue-saturation-value.pkg 

stipulate
    package xt  = xtypes;                               # xtypes        is from   src/lib/x-kit/xclient/src/wire/xtypes.pkg
herein
    api Hue_Saturation_Value {

        Hsv;            # hsv = "Hue, Saturation, Value"

        from_rgb:  rgb::Rgb -> Hsv;
        to_rgb:    Hsv -> rgb::Rgb;

        to_floats:  Hsv -> { hue:          Float,
                             saturation:   Float,
                             value:        Float
                           };

        from_floats:  { hue:          Float,            # Args should be in range 0.0 through 1.0 inclusive.
                        saturation:   Float,
                        value:        Float
                      }
                      ->
                      Hsv;              

        from_name:  String -> Hsv;                      # Raises exception lib_base::NOT_FOUND if given string is not in table.
            #
            # Return a color from x11_color_name::x11_colors table.
    };
end;

## COPYRIGHT (c) 1994 by AT&T Bell Laboratories
## Subsequent changes by Jeff Prothero Copyright (c) 2010-2015,
## released per terms of SMLNJ-COPYRIGHT.


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext