Skip to content
This repository has been archived by the owner on Feb 27, 2024. It is now read-only.

Feature/410 cover block #516

Merged
merged 40 commits into from
Jun 16, 2021
Merged
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
73e5c32
Add all block attrs
ravewebdev Jun 10, 2021
48dfa02
Merge branch 'main' into feature/410-cover-block
ravewebdev Jun 11, 2021
70084bb
Add basic overlay color styling
ravewebdev Jun 11, 2021
fe24279
Add gradient overlay handling
ravewebdev Jun 11, 2021
dc9030d
Don't distort image on fill
ravewebdev Jun 11, 2021
09b5d48
Fix border-radius
ravewebdev Jun 11, 2021
b17e556
Ensure child elements display over background image
ravewebdev Jun 11, 2021
e200799
Add function to convert Hex to RGB
ravewebdev Jun 11, 2021
99b53ea
Add function to extract numeric RGB values from string
ravewebdev Jun 11, 2021
c17b45a
Simplify overlay handling
ravewebdev Jun 11, 2021
ca4e0e0
Add SO link
ravewebdev Jun 11, 2021
442a9d1
Add relative class to innerblocks
ravewebdev Jun 14, 2021
f860fc1
Always pass image url
ravewebdev Jun 14, 2021
bd8a2d9
Pass duotone array
ravewebdev Jun 14, 2021
c9b5863
Fix overlay display
ravewebdev Jun 14, 2021
b38770a
Create, display duotone filter component
ravewebdev Jun 14, 2021
2995822
Add image for filter, remove custom children handling
ravewebdev Jun 14, 2021
f9c19a1
Add filter styles
ravewebdev Jun 14, 2021
4bb048c
Remove additional tint
ravewebdev Jun 14, 2021
eb34e13
Hide filter
ravewebdev Jun 14, 2021
2441f07
Display plain image to allow for filter
ravewebdev Jun 14, 2021
46d5bcf
Reset z-index if only overlay, no image
ravewebdev Jun 14, 2021
2df9bc3
Set default text color to white
ravewebdev Jun 14, 2021
eace20b
Add align handling
ravewebdev Jun 14, 2021
1791fa1
Change to flex to allow text alignment
ravewebdev Jun 14, 2021
18a82a9
Don't output empty heading tag
ravewebdev Jun 14, 2021
d406414
Use min-height instead of padding
ravewebdev Jun 14, 2021
c51471a
Add content align top/bottom handling
ravewebdev Jun 14, 2021
6710037
Reset x-axis padding
ravewebdev Jun 14, 2021
af91cd9
Add horizontal content alignment
ravewebdev Jun 14, 2021
ee3edd1
Add full height support
ravewebdev Jun 14, 2021
b66b069
Add custom min-height
ravewebdev Jun 14, 2021
05324bb
Abstract focal point handling to fn
ravewebdev Jun 14, 2021
80a1f08
Abstract filter style to const
ravewebdev Jun 14, 2021
a579468
Add focal point handling
ravewebdev Jun 14, 2021
b31a77c
Add parallax handling
ravewebdev Jun 14, 2021
0727f39
Fix content z-index
ravewebdev Jun 14, 2021
109a7ea
Add repeat handling
ravewebdev Jun 14, 2021
a64aaac
Remove eslint-disable
ravewebdev Jun 14, 2021
7f69d9b
Merge branch 'main' into feature/410-cover-block
ravewebdev Jun 15, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add function to extract numeric RGB values from string
  • Loading branch information
ravewebdev committed Jun 11, 2021
commit 99b53ea8d0f7385c7dbf54f907b4340084b56c94
18 changes: 18 additions & 0 deletions functions/extractRgbValues.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/**
* Extract numeric RGB values from string.
*
* @author WebDevStudios
* @param {string} rgbString RGB string.
* @return {Array} Array of numeric RGB values.
*/
export default function extractRgbValues(rgbString) {
const rgbValues = rgbString.match(
/rgba?\((\d{1,3}), ?(\d{1,3}), ?(\d{1,3})\)?(?:, ?(\d(?:\.\d?))\))?/
)

// Remove first element (original RGB string) and last element (undefined).
rgbValues.shift()
rgbValues.pop()

return rgbValues
}