Skip to content

io7m-com/cxbutton

Repository files navigation

cxbutton

Maven Central Maven Central (snapshot) Codecov Java Version

com.io7m.cxbutton

JVM Platform Status
OpenJDK (Temurin) Current Linux Build (OpenJDK (Temurin) Current, Linux)
OpenJDK (Temurin) LTS Linux Build (OpenJDK (Temurin) LTS, Linux)
OpenJDK (Temurin) Current Windows Build (OpenJDK (Temurin) Current, Windows)
OpenJDK (Temurin) LTS Windows Build (OpenJDK (Temurin) LTS, Windows)

cxbutton

Embossed CSS buttons.

Features

  • Templated, customizable CSS buttons.
  • OSGi ready.
  • JPMS ready.
  • ISC license.
  • High-coverage automated test suite.

Usage

Use the CxButtonCSS class to generate CSS text.

final CxButtonCSS css =
  CxButtonCSS.create();

final String text =
  css.cssOf(Optional.empty(), false, CxButtonCSS.defaultColors());

It's possible to specify custom colors, and the package can automatically derive the correct color variations for embossing:

final String text =
  css.cssOf(
    Optional.of("Ocean"),
    true,
    CxButtonCSS.colorsForScheme(
      new CxColor(1.0, 1.0, 1.0),
      new CxColor(0.0, 0.0, 0.0),
      new CxColor(0.105, 0.313, 0.454),
      0.2,
      0.2,
      0.5
    )
  );