6060 let
6161 inherit ( nixpkgs-lib ) toLower ;
6262 lowerHex = toLower hex ;
63- in if builtins . stringLength hex != 1 then
63+ in
64+ if builtins . stringLength hex != 1 then
6465 throw "Function only accepts a single character."
6566 else if hexToDecMap ? ${ lowerHex } then
6667 hexToDecMap . "${ lowerHex } "
6768 else
6869 throw "Character ${ hex } is not a hexadecimal value." ;
69- in rec {
70+ in
71+ rec {
7072 /* Converts from hexadecimal to decimal.
7173
7274 Type: hexToDec :: string -> int
@@ -88,7 +90,8 @@ in rec {
8890 decimals = builtins . map hexCharToDec ( stringToCharacters hex ) ;
8991 decimalsAscending = reverseList decimals ;
9092 decimalsPowered = imap0 base16To10 decimalsAscending ;
91- in foldl builtins . add 0 decimalsPowered ;
93+ in
94+ foldl builtins . add 0 decimalsPowered ;
9295
9396 /* Converts a 6 character hexadecimal string to RGB values.
9497
@@ -110,7 +113,8 @@ in rec {
110113 rgbStartIndex = [ 0 2 4 ] ;
111114 hexList = builtins . map ( x : builtins . substring x 2 hex ) rgbStartIndex ;
112115 hexLength = builtins . stringLength hex ;
113- in if hexLength != 6 then
116+ in
117+ if hexLength != 6 then
114118 throw ''
115119 Unsupported hex string length of ${ builtins . toString hexLength } .
116120 Length must be exactly 6.
@@ -133,5 +137,6 @@ in rec {
133137 inherit ( nixpkgs-lib ) concatStringsSep ;
134138 hexInRGB = hexToRGB hex ;
135139 hexInRGBString = map toString hexInRGB ;
136- in concatStringsSep sep hexInRGBString ;
140+ in
141+ concatStringsSep sep hexInRGBString ;
137142}
0 commit comments