camper/deploy/to_color.sql

19 lines
296 B
PL/PgSQL

-- Deploy camper:to_color to pg
-- requires: roles
-- requires: schema_camper
-- requires: color
begin;
set search_path to camper, public;
create or replace function to_color(color integer) returns color as
$$
select '#' || lpad(to_hex(color), 6, '0');
$$
language sql
immutable
;
commit;