Class ColorTypes.ConversionCache64

java.lang.Object
dev.lukebemish.dynamicassetgenerator.api.colors.ColorTypes.ConversionCache64
Enclosing class:
ColorTypes

public static class ColorTypes.ConversionCache64 extends Object
Tool for making conversions between 64-bit color spaces more performant. This should be used if it will have a known, short lifespan; hold a comparatively small number of items; and likely have many duplicate conversions. Otherwise, it is likely more performant to simply do conversions as needed.
  • Constructor Details

    • ConversionCache64

      public ConversionCache64(LongUnaryOperator converter)
      Creates a new cache that will use the provided converter to convert colors.
      Parameters:
      converter - conversion function to use
  • Method Details

    • convert

      public long convert(long color)
      Returns:
      the provided color after conversion. This operation is thread-safe.