visual-center

所属分类:其他
开发工具:JavaScript
文件大小:0KB
下载次数:0
上传日期:2023-05-20 02:04:21
上 传 者sh-1993
说明:  用于在容器中心更好地对齐徽标的工具。,
(Tool to better align logos in the center of a container.,)

文件列表:
.editorconfig (192, 2022-05-02)
.prettierrc (264, 2022-05-02)
.vercel/ (0, 2022-05-02)
.vercel/project.json (83, 2022-05-02)
CHANGELOG.md (131, 2022-05-02)
LICENSE (1523, 2022-05-02)
docs-assets/ (0, 2022-05-02)
docs-assets/thumbnail.jpg (18411, 2022-05-02)
gh/ (0, 2022-05-02)
gh/screenshot.jpg (48925, 2022-05-02)
package-lock.json (1122849, 2022-05-02)
package.json (1143, 2022-05-02)
public/ (0, 2022-05-02)
public/index.html (4446, 2022-05-02)
public/javier-xyz-visual-center.jpg (39671, 2022-05-02)
public/robots.txt (57, 2022-05-02)
src/ (0, 2022-05-02)
src/app.jsx (8590, 2022-05-02)
src/assets/ (0, 2022-05-02)
src/assets/demo.js (8665, 2022-05-02)
src/index.js (260, 2022-05-02)
src/style.css (1907, 2022-05-02)
src/visualCenter.js (4594, 2022-05-02)

# [Visual Center](https://javier.xyz/visual-center/) Tool that will find the visual center of your images / logos. [![visual-center](public/javier-xyz-visual-center.jpg)](https://javier.xyz/visual-center/) ## How it works. It calculates a visual weight value for every pixel on the image: the square root of the difference between that pixel and the background color. And then the algorithm tries to balance that weight in all directions. Why the square root? http://spectrum.ieee.org/podcast/biomedical/bionics/does-the-brain-work-logarithmically ## Programmatic Usage. ``` npm install visual-center --save ``` ```js const getVisualCenter = require('visual-center') getVisualCenter(, function(err, result) { /* results in an object with the data as: { visualTop: visualLeft: bgColor: width: height: } */ }) ``` ## License BSD-3-Clause License

近期下载者

相关文件


收藏者