跳转至

cf::ui::base

Namespaces

Name
cf::ui::base::device
cf::ui::base::Easing
Easing curves and spring presets for animations.
cf::ui::base::geometry

Classes

Name
class cf::ui::base::CFColor
Enhanced color class with HCT color space support.

Functions

Name
CFColor blend(constCFColor & base, CFColor & overlay, float ratio)
Blends two colors with a specified ratio.
CFColor elevationOverlay(CFColor & surface, CFColor & primary, int elevation)
Applies elevation overlay to a surface color.
float contrastRatio(CFColor & a, CFColor & b)
Calculates the contrast ratio between two colors.
QList< CFColor > tonalPalette(CFColor keyColor)
Generates a tonal palette from a key color.

Functions Documentation

function blend

CFColor blend(
    constCFColor & base,
    CFColor & overlay,
    float ratio
)

Blends two colors with a specified ratio.

Parameters:

  • base The base color to blend.
  • overlay The overlay color to blend onto the base.
  • ratio Blending ratio between 0.0 and 1.0.

Exceptions:

  • None

Return: Blended color result.

Since: 0.1

Note: None

Warning: None

function elevationOverlay

CFColor elevationOverlay(
    CFColor & surface,
    CFColor & primary,
    int elevation
)

Applies elevation overlay to a surface color.

Parameters:

  • surface The base surface color.
  • primary The primary color for overlay.
  • elevation Elevation level in dp units.

Exceptions:

  • None

Return: Color with elevation overlay applied.

Since: 0.1

Note: None

Warning: None

function contrastRatio

float contrastRatio(
    CFColor & a,
    CFColor & b
)

Calculates the contrast ratio between two colors.

Parameters:

  • a First color.
  • b Second color.

Exceptions:

  • None

Return: Contrast ratio value (typically 1.0 to 21.0).

Since: 0.1

Note: None

Warning: None

function tonalPalette

QList< CFColor > tonalPalette(
    CFColor keyColor
)

Generates a tonal palette from a key color.

Parameters:

  • keyColor The base key color for palette generation.

Exceptions:

  • None

Return: List of generated tonal colors.

Since: 0.1

Note: None

Warning: None


Updated on 2026-03-09 at 10:14:00 +0000