It is currently Fri Dec 15, 2017 2:52 am

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Fri Sep 13, 2013 5:26 pm 
Offline
Contributor
Contributor
User avatar

Joined: Thu Oct 21, 2010 12:31 am
Posts: 217
Location: Essex, UK
Hi hi!

Now this is an age-old problem with AF, and is the main reason I have never really used it for more than a few occasional places where I could overcome the problem by using a Specific colour as background.

The problem is shown in the screengrab.
Attachment:
AF-Background problems.png
AF-Background problems.png [ 49.59 KiB | Viewed 11618 times ]

You will see that the area around the box is white - setting FFFFFF in the plugin settings.

There is no way to make this transparent. And the problem is that 99% of the stuff I do would need that background to be transparent.

So - my question is this: Is it possible to update AF to use the Alpha Layer format of colourisation that has been around in CSS for quite some time. That is: RGBA. It would mean giving the user TWO ways of inputting colours everywhere, and wouldn't just apply to backgrounds.

So you would use a dropdown to select either "RGB Value (Format 00252FF)" or "RGBA Value (Format 155,155,155,0.5 where the last number is between 0.0 and 1.0)"

This means I can have "255,0,0,0.0" and affect a fully transparent background colour.

From http://www.w3schools.com/cssref/css_colors_legal.asp

RGBA Colors
RGBA color values are supported in IE9+, Firefox 3+, Chrome, Safari, and in Opera 10+.

RGBA color values are an extension of RGB color values with an alpha channel - which specifies the opacity of the object.

An RGBA color value is specified with: rgba(red, green, blue, alpha). The alpha parameter is a number between 0.0 (fully transparent) and 1.0 (fully opaque).

Example

p
{
background-color:rgba(255,0,0,0.5);
}


Top
 Profile  
 
 Post subject: Background Colour - Alpha Channel
PostPosted: Fri Sep 13, 2013 5:26 pm 
Top  
PostPosted: Thu Feb 06, 2014 12:07 am 
Offline

Joined: Thu Feb 06, 2014 12:03 am
Posts: 2
*push*

hello,

that is exactly the topic I was looking for.
I have got a website with bg colour #131315 and {af template=white_border} does not look nice.

Is there a possibility to change the bg of the frames to a custom colour? :)

Thanks for this nice plugin.

Kind regards,
Karma


Top
 Profile  
 
PostPosted: Thu Feb 06, 2014 12:40 am 
Offline

Joined: Thu Feb 06, 2014 12:03 am
Posts: 2
ah how awesome!
in the general plugin parameters you can set the background colour and other usefull presets.

:ugeek:

thank you :)


Top
 Profile  
 
PostPosted: Thu Feb 18, 2016 3:24 am 
Offline

Joined: Thu Feb 18, 2016 3:21 am
Posts: 1
Old topic but I have a solution for when the background color is set to FFFFFF.

In /scripts/AF_gd_stream.php

After
Code:
@$dst_img = imagecreatetruecolor($dst_w, $dst_h);


Add this:
Code:
// ----  New Code -----
if($bgcolor == "FFFFFF")
{
   imagealphablending($dst_img , false);
   imagesavealpha($dst_img, true);
}
else
{
   $AF_bgcolor_RGB = array(
       base_convert(substr($bgcolor, 0, 2), 16, 10),
       base_convert(substr($bgcolor, 2, 2), 16, 10),
       base_convert(substr($bgcolor, 4, 2), 16, 10)
   );

   $AF_BGCOLOR = imagecolorallocate($dst_img, $AF_bgcolor_RGB[0], $AF_bgcolor_RGB[1], $AF_bgcolor_RGB[2]);

   imagefill($dst_img, 0, 0, $AF_BGCOLOR);
}
@imagecopyresampled($dst_img, $src_img, 0, 0, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h);


// saving
if($bgcolor == "FFFFFF")
{
imagealphablending($dst_img , false);
imagesavealpha($dst_img , true);
}
imagepng ( $dst_img, NULL );
// ---- End New Code ------


And remove everything else up until this line:
Code:
@imagedestroy($dst_img);


So it should look like this:
Code:
@$dst_img = imagecreatetruecolor($dst_w, $dst_h);

// ----  New Code -----
if($bgcolor == "FFFFFF")
{
   imagealphablending($dst_img , false);
   imagesavealpha($dst_img, true);
}
else
{
   $AF_bgcolor_RGB = array(
       base_convert(substr($bgcolor, 0, 2), 16, 10),
       base_convert(substr($bgcolor, 2, 2), 16, 10),
       base_convert(substr($bgcolor, 4, 2), 16, 10)
   );

   $AF_BGCOLOR = imagecolorallocate($dst_img, $AF_bgcolor_RGB[0], $AF_bgcolor_RGB[1], $AF_bgcolor_RGB[2]);

   imagefill($dst_img, 0, 0, $AF_BGCOLOR);
}
@imagecopyresampled($dst_img, $src_img, 0, 0, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h);


// saving
if($bgcolor == "FFFFFF")
{
imagealphablending($dst_img , false);
imagesavealpha($dst_img , true);
}
imagepng ( $dst_img, NULL );
// ---- End New Code ------
@imagedestroy($dst_img);


You'll want your C.png in your template to be transparent as well unless you want a a colored background. Don't forget to set background color to FFFFFF in plugin options.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

 


All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron

This is the official Admiror Joomla! Community Forum. You are welcome to join the Admiror Joomla! Community. All Admiror Joomla! Extensions Users, Joomla! Developers, PHP or mySQL Developers are welcome to support & contribute to Admiror Joomla! Projects.

Joomla! is a free and open source content management system (CMS) for publishing content on the World Wide Web and intranets. With a vibrant volunteer community, user-friendly features and plenty of power, Joomla is perfect for your website!

Joomla! is written in PHP, uses object-oriented programming (OOP) techniques and software patterns, stores data in a MySQL database, and includes features such as page caching, RSS feeds, printable versions of pages, news flashes, blogs, polls, search, and support for language internationalization.

Joomla! is the property of Open Source Matters, Inc. All rights reserved. Read more about Joomla! at http://www.joomla.org/.


Protected by Anti-Spam ACP Powered by phpBB® Forum Software © phpBB Group