Last updated

API / geotoolkit / util / HlsColor / HlsColor

Class: HlsColor

util.HlsColor.HlsColor

Specify HLS color, which can be defined as a set of the three color components (Hue, Luminosity and Saturation). It provides several functions to manipulate colors based on (HLS) as well as to convert colors to RgbaColor

Table of contents

Constructors
[new HlsColor()](/solutions/geotoolkit/apis/classes/geotoolkit.util.hlscolor.hlscolor.md#new hlscolor())[new HlsColor(hue, luminosity, saturation)](/solutions/geotoolkit/apis/classes/geotoolkit.util.hlscolor.hlscolor.md#new hlscolor(hue, luminosity, saturation))[new HlsColor(rgba)](/solutions/geotoolkit/apis/classes/geotoolkit.util.hlscolor.hlscolor.md#new hlscolor(rgba))
Methods

Contents

Constructors

new HlsColor()

new HlsColor()


new HlsColor(hue, luminosity, saturation)

new HlsColor(hue, luminosity, saturation)

Parameters

Name Type Description
huenumberRGBA color between 0 - 360
luminositynumberbetween 0 - 1
saturationnumberbetween 0 - 1

new HlsColor(rgba)

new HlsColor(rgba)

Parameters

Name Type
rgbaRgbaColor
Methods

darker

darker(percDarker): RgbaColor

Make the color darker

Parameters

Name Type Description
percDarkernumberpercentage to make the color darker

Returns

RgbaColor


getClassName

getClassName(): string

Returns

string


getHue

getHue(): number

Return hue

Returns

number


getLuminosity

getLuminosity(): number

Return luminosity

Returns

number


getSaturation

getSaturation(): number

Return saturation

Returns

number


lighter

lighter(percLighter): RgbaColor

Make the color lighter

Parameters

Name Type Description
percLighternumberpercentage to lighten the color

Returns

RgbaColor


toRgbaColor

toRgbaColor(): RgbaColor

Convert color from HLS to RGBA

Returns

RgbaColor


toRgbaString

toRgbaString(): string

Convert color from HLS to RGBA string

Returns

string


getClassName

Static getClassName(): string

Returns

string