Class ColorRegistry.Builder

  • Enclosing class:
    ColorRegistry

    public static final class ColorRegistry.Builder
    extends java.lang.Object
    Records the state for a partially-built ColorRegistry. Create with ColorRegistry.builder()
    • Method Detail

      • withNativeObjectColors

        public ColorRegistry.Builder withNativeObjectColors​(com.google.common.collect.ImmutableMap<NativeColorId,​Color> nativeObjectColors)
        Instantiate the registry with custom implementations of the given colors

        May only be called on colors for which {@link NativeColorId::isTypesystemPrimitive} is false.

      • getNativePrimitives

        public com.google.common.collect.ImmutableMap<NativeColorId,​Color> getNativePrimitives()
        Returns a copy of all the native type-system primitive colors.

        Allows code to request default implementations of all the primitive colors, then use those default implementations to build more complex, non-default implementations of native objects like boxed scalars Number/String/etc.)