@ScalarFunction
    @LiteralParameters({"x", "y"})
    @Constraint(variable = "y", expression = "min(2147483647, x + 15)")
    // Color formatting uses 15 characters. Note that if the ansiColorEscape function implementation
    // changes, this value may be invalidated.
    @SqlType("varchar(y)")
    public static Slice render(@SqlType("varchar(x)") Slice value, @SqlType(ColorType.NAME) long color)
    {
        StringBuilder builder = new StringBuilder(value.length());

        // color
        builder.append(ansiColorEscape(color))
                .append(value.toStringUtf8())
                .append(ANSI_RESET);

        return utf8Slice(builder.toString());
    }
@Test
    public void testRenderBoolean()
    {
        assertEquals(render(true), toSlice("\u001b[38;5;2m✓\u001b[0m"));
        assertEquals(render(false), toSlice("\u001b[38;5;1m✗\u001b[0m"));
    }