File tree Expand file tree Collapse file tree 2 files changed +33
-1
lines changed Expand file tree Collapse file tree 2 files changed +33
-1
lines changed Original file line number Diff line number Diff line change @@ -368,10 +368,10 @@ section h3.section-subheading {
368
368
width : 100% ;
369
369
height : 100% ;
370
370
opacity : 0 ;
371
- background : rgba (254 , 209 , 54 , .9 );
372
371
-webkit-transition : all ease .5s ;
373
372
-moz-transition : all ease .5s ;
374
373
transition : all ease .5s ;
374
+ background : rgba ({{ site .color .primary | hex_to_rgb | join : ', ' }}, .9);
375
375
}
376
376
377
377
#portfolio .portfolio-item .portfolio-link .portfolio-hover:hover {
Original file line number Diff line number Diff line change
1
+ # Simple hex conversion Liquid filter plugin
2
+ #
3
+ # Convert a string of hex values into an array of decimal values.
4
+ #
5
+ # Examples:
6
+ # {{ "aabbcc" | hex_to_rgb }}
7
+ # # => [170, 187, 204]
8
+ #
9
+ # {{ "abc" | hex_to_rgb }}
10
+ # # => [170, 187, 204]
11
+ #
12
+ # {{ "0a0b0c" | hex_to_rgb }}
13
+ # # => [10, 11, 12]
14
+ #
15
+ # hexval - string of valid hexidecimal characters
16
+ #
17
+ # Returns an array of decimal values for the parse hex characters
18
+ #
19
+
20
+ module Jekyll
21
+ module HexToRGB
22
+ def hex_to_rgb ( hexval )
23
+ if hexval . length . even?
24
+ hexval . scan ( /../ ) . map { |color | color . to_i ( 16 ) }
25
+ else
26
+ hexval . scan ( /./ ) . map { |color | ( color +color ) . to_i ( 16 ) }
27
+ end
28
+ end
29
+ end
30
+ end
31
+
32
+ Liquid ::Template . register_filter ( Jekyll ::HexToRGB )
You can’t perform that action at this time.
0 commit comments