adjust_color_tone: Adjust Color Tone by Modifying Saturation and Luminance

View source: R/EnrichmentSpiralize.R

adjust_color_toneR Documentation

Adjust Color Tone by Modifying Saturation and Luminance

Description

This function adjusts the saturation and luminance of a given color. It works by converting the color from RGB to Luv color space, applying the scaling factors to the saturation and luminance, and then converting it back to RGB.

Usage

adjust_color_tone(color, saturation_scale, luminance_scale)

Arguments

color

A color in hexadecimal format (e.g., "#FF0000") or a valid R color name.

saturation_scale

Numeric, the scaling factor for saturation (values < 1 decrease saturation, values > 1 increase saturation).

luminance_scale

Numeric, the scaling factor for luminance (values < 1 darken the color, values > 1 lighten the color).

Value

Returns a color in hexadecimal format adjusted according to the provided scales.

Examples

  adjusted_color <- adjust_color_tone("#FF0000", saturation_scale = 0.8, luminance_scale = 1.2)
  print(adjusted_color)


TransProR documentation built on April 4, 2025, 3:16 a.m.