That isn't possible with UNPIVOT you'll want to use PIVOT. Microsoft documentation on the subject "Using PIVOT and UNPIVOT"
But here's an example using your test data with comments:
DECLARE @Custom TABLE
(
[ID] TINYINT IDENTITY
, [value] NVARCHAR(20)
);
INSERT INTO @Custom
VALUES ( 'red' )
, ( 'green' )
, ( 'blue' );
SELECT *
FROM @Custom
PIVOT (
MAX([value]) --column being aggregated, the column values you want horizontal
FOR [ID] IN ( [1], [2], [3] ) --The column that contains the value that will become the column headers.
) AS [pvt];
Giving use the results of
1 2 3
-------------------- -------------------- --------------------
red green blue
Since you want the verbiage of 'COLOR' in the column headers we'll concat that in a sub-query with the ID column and tweak the pivot
SELECT *
FROM (
--Since you want 'COLOR' as part of the column name we do a sub-query and concat that verbiage with the ID
SELECT CONCAT('COLOR', [ID]) AS [ColumnColor]
, [value]
FROM @Custom
) AS [Cst]
PIVOT (
MAX([value]) --Same as before, column being aggregated, the column values you want horizontal
FOR [ColumnColor] IN ( [COLOR1], [COLOR2], [COLOR3] ) --This changes now to reflect the concatenated column and the new column header values
) AS [pvt];
Giving us the results of
COLOR1 COLOR2 COLOR3
-------------------- -------------------- --------------------
red green blue